]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/tuba.qc
Merge branch 'terencehill/vec2_optimizations' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / tuba.qc
index 09d050833b46de6323e9cf880cce3c80b2b2cd44..ef3c4dc83ccfeb798396159ea4c2d3beba3226c8 100644 (file)
@@ -2,8 +2,8 @@
 #ifndef IMPLEMENTATION
 CLASS(Tuba, Weapon)
 /* impulse   */ ATTRIB(Tuba, impulse, int, 1);
-/* flags     */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH);
-/* rating    */ ATTRIB(Tuba, bot_pickupbasevalue, float, BOT_PICKUP_RATING_MID);
+/* flags     */ ATTRIB(Tuba, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_SPLASH | WEP_FLAG_NODUAL);
+/* rating    */ ATTRIB(Tuba, bot_pickupbasevalue, float, 2000);
 /* color     */ ATTRIB(Tuba, wpcolor, vector, '0 1 0');
 /* modelname */ ATTRIB(Tuba, mdl, string, "tuba");
 #ifdef GAMEQC
@@ -157,7 +157,7 @@ void W_Tuba_NoteOff(entity this)
        if (actor.(weaponentity).tuba_note == this)
        {
                actor.(weaponentity).tuba_lastnotes_last = (actor.(weaponentity).tuba_lastnotes_last + 1) % MAX_TUBANOTES;
-               actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = eX * this.spawnshieldtime + eY * time + eZ * this.cnt;
+               actor.(weaponentity).(tuba_lastnotes[actor.(weaponentity).tuba_lastnotes_last]) = vec3(this.spawnshieldtime, time, this.cnt);
                actor.(weaponentity).tuba_note = NULL;
                actor.(weaponentity).tuba_lastnotes_cnt = bound(0, actor.(weaponentity).tuba_lastnotes_cnt + 1, MAX_TUBANOTES);
 
@@ -493,23 +493,23 @@ void tubasound(entity e, bool restart)
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
-                               speed1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                               speed1 = (2.0 ** ((m - Tuba_PitchStep) / 12.0));
                        } else if (e.note - m + Tuba_PitchStep > TUBA_MAX) {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
-                               speed1 = pow(2.0, m / 12.0);
+                               speed1 = (2.0 ** (m / 12.0));
                        } else {
                                if (restart) {
                                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                }
                                vol1 = cos(M_PI_2 * m / Tuba_PitchStep);
-                               speed1 = pow(2.0, m / 12.0);
+                               speed1 = (2.0 ** (m / 12.0));
                                if (restart) {
                                        snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                }
                                vol2 = sin(M_PI_2 * m / Tuba_PitchStep);
-                               speed2 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
+                               speed2 = (2.0 ** ((m - Tuba_PitchStep) / 12.0));
                        }
                } else if (restart) {
                        snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);