]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
tuba: fix notes playing too loud in first frame
authorRudolf Polzer <divverent@xonotic.org>
Sun, 9 Oct 2011 19:57:20 +0000 (21:57 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sun, 9 Oct 2011 19:57:20 +0000 (21:57 +0200)
qcsrc/client/tuba.qc

index 6e1c1f9bd78b2ab3480a1054020fbec475edbc86..13e37f0e770fc748366256a94e877804ede48aaa 100644 (file)
@@ -117,9 +117,11 @@ void Ent_TubaNote_StopSound()
 
 void Ent_TubaNote(float bIsNew)
 {
-       float f, n, i, att;
+       float f, n, i, att, upd;
        f = ReadByte();
 
+       upd = 0;
+
        if(f & 1)
        {
                n = ReadChar();
@@ -151,7 +153,7 @@ void Ent_TubaNote(float bIsNew)
                {
                        self.note = n;
                        self.tuba_instrument = i;
-                       Ent_TubaNote_UpdateSound();
+                       upd = 1;
                }
        }
 
@@ -169,6 +171,9 @@ void Ent_TubaNote(float bIsNew)
        self.entremove = Ent_TubaNote_StopSound;
        self.enemy.think = Ent_TubaNote_Think;
        self.enemy.nextthink = time + 10;
+
+       if(upd)
+               Ent_TubaNote_UpdateSound();
 }
 
 void Tuba_Precache()