X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fsounds%2Fall.qc;h=9096dddfa8c0e6a31dd1dc2d3f5f8ba069df4b56;hb=b9671f63469586007314131f3f53728795c035cd;hp=92c5ef059ae7e160b2f282f886c96135b6f86467;hpb=05d2ce7189cf77c3f5b997a972ea12370abd479e;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/sounds/all.qc b/qcsrc/common/sounds/all.qc index 92c5ef059..9096dddfa 100644 --- a/qcsrc/common/sounds/all.qc +++ b/qcsrc/common/sounds/all.qc @@ -76,7 +76,7 @@ void soundat(entity e, vector o, int chan, string samp, float vol, float _atten) void stopsoundto(int _dest, entity e, int chan) { if (!sound_allowed(_dest, e)) return; - int entno = num_for_edict(e); + int entno = etof(e); if (entno >= 8192 || chan < 0 || chan > 7) { int idx = precache_sound_index(SND(Null)); @@ -108,7 +108,7 @@ void stopsound(entity e, int chan) void play2(entity e, string filename) { msg_entity = e; - soundtoat(MSG_ONE, world, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE); + soundtoat(MSG_ONE, NULL, '0 0 0', CH_INFO, filename, VOL_BASE, ATTEN_NONE); } .float spamtime; @@ -128,17 +128,13 @@ float spamsound(entity e, int chan, string samp, float vol, float _atten) void play2team(float t, string filename) { if (autocvar_bot_sound_monopoly) return; - entity head; - FOR_EACH_REALPLAYER(head) - { - if (head.team == t) play2(head, filename); - } + FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && it.team == t, play2(it, filename)); } void play2all(string samp) { if (autocvar_bot_sound_monopoly) return; - _sound(world, CH_INFO, samp, VOL_BASE, ATTEN_NONE); + _sound(NULL, CH_INFO, samp, VOL_BASE, ATTEN_NONE); } #endif