]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/tuba.qc
Add hud_panel_ammo_noncurrent_scale cvar
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / tuba.qc
index 2fea077c5d0c928c6629289de9273886b3e98fd9..73d72b61e716c5ad200630d46b05365f217f74eb 100644 (file)
@@ -1,6 +1,6 @@
 #define TUBA_MIN -18
 #define TUBA_MAX  27
-#define TUBA_INSTRUMENTS 2
+#define TUBA_INSTRUMENTS 3
 
 #define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
 .float note; // note
@@ -30,7 +30,7 @@ void tubasound(entity e, float restart)
                f2 = 0;
                p2 = 1;
 
-               m = mod(e.note, Tuba_PitchStep);
+               m = e.note % Tuba_PitchStep;
                if(m)
                {
                        if(e.note - m < TUBA_MIN)
@@ -63,15 +63,15 @@ void tubasound(entity e, float restart)
                                snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                }
 
-               sound7(e, CH_TUBA, snd1, e.cnt * f1, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p1, 0);
+               sound7(e, CH_TUBA_SINGLE, snd1, e.cnt * f1, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p1, 0);
                if(f2)
-                       sound7(e.enemy, CH_TUBA, snd2, e.cnt * f2, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p2, 0);
+                       sound7(e.enemy, CH_TUBA_SINGLE, snd2, e.cnt * f2, e.attenuate * autocvar_g_balance_tuba_attenuation, 100 * p2, 0);
        }
        else
        {
                if(restart)
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
-               sound(e, CH_TUBA, snd1, e.cnt, e.attenuate * autocvar_g_balance_tuba_attenuation);
+               sound(e, CH_TUBA_SINGLE, snd1, e.cnt, e.attenuate * autocvar_g_balance_tuba_attenuation);
        }
 }
 
@@ -86,10 +86,10 @@ void Ent_TubaNote_Think()
        self.nextthink = time;
        if(self.cnt <= 0)
        {
-               sound(self, CH_TUBA, "misc/null.wav", 0, 0);
+               sound(self, CH_TUBA_SINGLE, "misc/null.wav", 0, 0);
                if(self.enemy)
                {
-                       sound(self.enemy, CH_TUBA, "misc/null.wav", 0, 0);
+                       sound(self.enemy, CH_TUBA_SINGLE, "misc/null.wav", 0, 0);
                        remove(self.enemy);
                }
                remove(self);
@@ -190,7 +190,7 @@ void Tuba_Precache()
        }
        for(n = TUBA_MIN; n <= TUBA_MAX; ++n)
        {
-               if(!Tuba_PitchStep || (mod(n, Tuba_PitchStep) == 0))
+               if(!Tuba_PitchStep || ((n % Tuba_PitchStep) == 0))
                {
                        for(i = 0; i < TUBA_INSTRUMENTS; ++i)
                                precache_sound(TUBA_STARTNOTE(i, n));