From: Rudolf Polzer Date: Sat, 30 Oct 2010 11:14:03 +0000 (+0200) Subject: don't attenuate your own tuba soudn X-Git-Tag: xonotic-v0.1.0preview~231 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bffe79f5a00b8a633d2b099bd831ffde30de1901;p=xonotic%2Fxonotic-data.pk3dir.git don't attenuate your own tuba soudn --- diff --git a/qcsrc/client/tuba.qc b/qcsrc/client/tuba.qc index 5265cb1bb..cda2a415f 100644 --- a/qcsrc/client/tuba.qc +++ b/qcsrc/client/tuba.qc @@ -1,5 +1,6 @@ #define TUBA_STARTNOTE(n) strcat((checkextension("DP_SND_SETPARAMS") ? "weapons/tuba_loopnote" : "weapons/tuba_note"), ftos(n), ".wav") .float cnt; // note +.float attenuate; // if set, attenuate it void Ent_TubaNote_Think() { @@ -16,14 +17,14 @@ void Ent_TubaNote_Think() remove(self); } else - sound(self, CHAN_PROJECTILE, "", self.cnt, cvar("g_balance_tuba_attenuation")); + sound(self, CHAN_PROJECTILE, "", self.cnt, self.attenuate * cvar("g_balance_tuba_attenuation")); } void Ent_TubaNote_UpdateSound() { self.enemy.cnt = bound(0, VOL_BASE * cvar("g_balance_tuba_volume"), 1); self.enemy.count = self.enemy.cnt; - sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, cvar("g_balance_tuba_attenuation")); + sound(self.enemy, CHAN_PROJECTILE, TUBA_STARTNOTE(self.cnt), self.enemy.cnt, self.attenuate * cvar("g_balance_tuba_attenuation")); } void Ent_TubaNote_StopSound() @@ -52,6 +53,7 @@ void Ent_TubaNote(float bIsNew) self.enemy.origin_y = ReadCoord(); self.enemy.origin_z = ReadCoord(); setorigin(self.enemy, self.enemy.origin); + self.enemy.attenuate = ReadByte(); } self.think = Ent_TubaNote_StopSound; self.entremove = Ent_TubaNote_StopSound; diff --git a/qcsrc/server/w_tuba.qc b/qcsrc/server/w_tuba.qc index c89735e55..491030fcb 100644 --- a/qcsrc/server/w_tuba.qc +++ b/qcsrc/server/w_tuba.qc @@ -83,13 +83,14 @@ float W_Tuba_NoteSendEntity(entity to, float sf) WriteCoord(MSG_ENTITY, self.origin_x); WriteCoord(MSG_ENTITY, self.origin_y); WriteCoord(MSG_ENTITY, self.origin_z); + WriteByte(MSG_ENTITY, self.owner != to); } return TRUE; } void W_Tuba_NoteThink() { - float needchange, dist_mult; + float dist_mult; float vol0, vol1; vector dir0, dir1; vector v; @@ -102,7 +103,6 @@ void W_Tuba_NoteThink() } self.nextthink = time; dist_mult = cvar("g_balance_tuba_attenuation") / cvar("snd_soundradius"); - needchange = 0; FOR_EACH_REALCLIENT(e) if(e != self.owner) {