]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge remote branch 'origin/master' into samual/hud_updates
authorSamual <samual@xonotic.org>
Mon, 3 Oct 2011 14:57:38 +0000 (10:57 -0400)
committerSamual <samual@xonotic.org>
Mon, 3 Oct 2011 14:57:38 +0000 (10:57 -0400)
26 files changed:
qcsrc/client/csqc_constants.qc
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/tuba.qc
qcsrc/menu/xonotic/serverlist.c
qcsrc/server/cl_client.qc
qcsrc/server/cl_weapons.qc
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/mutators/mutator_nix.qc
qcsrc/server/playerstats.qc
qcsrc/server/scores.qc
qcsrc/server/vehicles/vehicles.qc
qcsrc/server/w_crylink.qc
qcsrc/server/w_electro.qc
qcsrc/server/w_fireball.qc
qcsrc/server/w_grenadelauncher.qc
qcsrc/server/w_hagar.qc
qcsrc/server/w_hlac.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_rifle.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_uzi.qc

index e82f4399bdb0ce9921ceabe7bf059ab9ff8673fd..f6e04e7b322e04a87f910c497f0b31a53a167b7b 100644 (file)
@@ -1,4 +1,4 @@
-const entity   NULL                                                    = world;
+#define NULL world
 
 // Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
 const float            MASK_ENGINE                                             = 1;
index c4364a209ba091ffd8224f0ea6e3d1f5e237cb32..76a2db6794315aa1372ae80f97ac2749d01fc6f7 100644 (file)
@@ -2483,19 +2483,20 @@ void HUD_Score_Rankings(vector pos, vector mySize, entity me, float team_count)
        entity tm, pl;
 #define SCOREPANEL_MAX_ENTRIES 6
 #define SCOREPANEL_ASPECTRATIO 2
-       const float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
-       const vector fontsize = '1 1 0' * (mySize_y/entries);
+       float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize_y/mySize_x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
+       vector fontsize = '1 1 0' * (mySize_y/entries);
 
        vector rgb, score_color;
        rgb = '1 1 1';
        score_color = '1 1 1';
 
-       const float name_size = mySize_x*0.75;
-       const float spacing_size = mySize_x*0.04;
+       float name_size = mySize_x*0.75;
+       float spacing_size = mySize_x*0.04;
        const float highlight_alpha = 0.2;
        float i, me_printed, first_pl;
        string s;
-       i, first_pl = 0;
+       i = 0;
+       first_pl = 0;
        if (autocvar__hud_configure)
        {
                float players_per_team;
index 082353049178ca485501d2df2d27245b6b2b12c3..c7922eebc4db7040185ebcda71166bb1b5906226 100644 (file)
@@ -682,7 +682,7 @@ float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
                float k, level, start_pos_x;
                vector candidate_pos;
                const float LEVELS_NUM = 4;
-               const float level_height = vid_conheight / LEVELS_NUM;
+               float level_height = vid_conheight / LEVELS_NUM;
 :find_tab_panel
                level = floor(tab_panel_pos_y / level_height) * level_height; //starting level
                candidate_pos_x = (!tab_backward) ? vid_conwidth : 0;
index 7a29154d66827c88bad2d7a70d54e225b22acd88..6e1c1f9bd78b2ab3480a1054020fbec475edbc86 100644 (file)
@@ -1,11 +1,13 @@
 #define TUBA_MIN -18
 #define TUBA_MAX  27
+#define TUBA_INSTRUMENTS 1
 
-#define TUBA_STARTNOTE(n) strcat("weapons/tuba_loopnote", ftos(n), ".wav")
+#define TUBA_STARTNOTE(i,n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
 .float note; // note
 .float attenuate; // if set, attenuate it
 .float cnt; // current volume
 .float count; // initial volume
+.float tuba_instrument;
 
 float Tuba_PitchStep;
 
@@ -34,23 +36,23 @@ void tubasound(entity e, float restart)
                        if(e.note - m < TUBA_MIN)
                        {
                                if(restart)
-                                       snd1 = TUBA_STARTNOTE(e.note - m + Tuba_PitchStep);
+                                       snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                p1 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
                        }
                        else if(e.note - m + Tuba_PitchStep > TUBA_MAX)
                        {
                                if(restart)
-                                       snd1 = TUBA_STARTNOTE(e.note - m);
+                                       snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                p1 = pow(2.0, m / 12.0);
                        }
                        else
                        {
                                if(restart)
-                                       snd1 = TUBA_STARTNOTE(e.note - m);
+                                       snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m);
                                f1 = cos(M_PI_2 * m / Tuba_PitchStep);
                                p1 = pow(2.0, m / 12.0);
                                if(restart)
-                                       snd2 = TUBA_STARTNOTE(e.note - m + Tuba_PitchStep);
+                                       snd2 = TUBA_STARTNOTE(e.tuba_instrument, e.note - m + Tuba_PitchStep);
                                f2 = sin(M_PI_2 * m / Tuba_PitchStep);
                                p2 = pow(2.0, (m - Tuba_PitchStep) / 12.0);
                        }
@@ -58,7 +60,7 @@ void tubasound(entity e, float restart)
                else
                {
                        if(restart)
-                               snd1 = TUBA_STARTNOTE(e.note);
+                               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);
@@ -68,7 +70,7 @@ void tubasound(entity e, float restart)
        else
        {
                if(restart)
-                       snd1 = TUBA_STARTNOTE(e.note);
+                       snd1 = TUBA_STARTNOTE(e.tuba_instrument, e.note);
                sound(e, CH_TUBA, snd1, e.cnt, e.attenuate * autocvar_g_balance_tuba_attenuation);
        }
 }
@@ -103,6 +105,7 @@ void Ent_TubaNote_UpdateSound()
        self.enemy.cnt = bound(0, VOL_BASE * autocvar_g_balance_tuba_volume, 1);
        self.enemy.count = self.enemy.cnt;
        self.enemy.note = self.note;
+       self.enemy.tuba_instrument = self.tuba_instrument;
        tubasound(self.enemy, 1);
 }
 
@@ -114,47 +117,63 @@ void Ent_TubaNote_StopSound()
 
 void Ent_TubaNote(float bIsNew)
 {
-       float f, n;
+       float f, n, i, att;
        f = ReadByte();
-       n = floor(f / 2) - 42;
-       if(n != self.note || bIsNew)
-               if(self.enemy)
-                       Ent_TubaNote_StopSound();
-       if(!self.enemy)
+
+       if(f & 1)
        {
-               self.enemy = spawn();
-               self.enemy.classname = "tuba_note";
-               if(Tuba_PitchStep)
+               n = ReadChar();
+               i = ReadByte();
+               att = (i & 1);
+               i = floor(i / 2);
+
+               if(n != self.note || i != self.tuba_instrument || bIsNew)
+               {
+                       if(self.enemy)
+                               Ent_TubaNote_StopSound();
+               }
+
+               if(!self.enemy)
+               {
+                       self.enemy = spawn();
+                       self.enemy.classname = "tuba_note";
+                       if(Tuba_PitchStep)
+                       {
+                               self.enemy.enemy = spawn();
+                               self.enemy.enemy.classname = "tuba_note_2";
+                       }
+                       bIsNew = TRUE;
+               }
+
+               self.enemy.attenuate = att;
+
+               if(bIsNew)
                {
-                       self.enemy.enemy = spawn();
-                       self.enemy.enemy.classname = "tuba_note_2";
+                       self.note = n;
+                       self.tuba_instrument = i;
+                       Ent_TubaNote_UpdateSound();
                }
-               bIsNew = TRUE;
        }
-       if(f & 1)
+
+       if(f & 2)
        {
                self.enemy.origin_x = ReadCoord();
                self.enemy.origin_y = ReadCoord();
                self.enemy.origin_z = ReadCoord();
                setorigin(self.enemy, self.enemy.origin);
-               self.enemy.attenuate = ReadByte();
                if(self.enemy.enemy)
                        setorigin(self.enemy.enemy, self.enemy.origin);
        }
+
        self.think = Ent_TubaNote_StopSound;
        self.entremove = Ent_TubaNote_StopSound;
        self.enemy.think = Ent_TubaNote_Think;
        self.enemy.nextthink = time + 10;
-       if(bIsNew)
-       {
-               self.note = n;
-               Ent_TubaNote_UpdateSound();
-       }
 }
 
 void Tuba_Precache()
 {
-       float i;
+       float i, n;
        Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
        if(Tuba_PitchStep)
        {
@@ -164,9 +183,12 @@ void Tuba_Precache()
                        Tuba_PitchStep = 0;
                }
        }
-       for(i = TUBA_MIN; i <= TUBA_MAX; ++i)
+       for(n = TUBA_MIN; n <= TUBA_MAX; ++n)
        {
-               if(!Tuba_PitchStep || (mod(i, Tuba_PitchStep) == 0))
-                       precache_sound(TUBA_STARTNOTE(i));
+               if(!Tuba_PitchStep || (mod(n, Tuba_PitchStep) == 0))
+               {
+                       for(i = 0; i < TUBA_INSTRUMENTS; ++i)
+                               precache_sound(TUBA_STARTNOTE(i, n));
+               }
        }
 }
index 6e9bf1790751764bd48bf9007c5e519106fa08ee..e6b0d6232f5ef0760f430e19c6e244dbf2f22081 100644 (file)
@@ -469,17 +469,17 @@ void ServerList_ShowFull_Click(entity box, entity me)
        me.ipAddressBox.cursorPos = 0;
        me.ipAddressBoxFocused = -1;
 }
-void XonoticServerList_setSortOrder(entity me, float field, float direction)
+void XonoticServerList_setSortOrder(entity me, float fld, float direction)
 {
-       if(me.currentSortField == field)
+       if(me.currentSortField == fld)
                direction = -me.currentSortOrder;
        me.currentSortOrder = direction;
-       me.currentSortField = field;
-       me.sortButton1.forcePressed = (field == SLIST_FIELD_PING);
-       me.sortButton2.forcePressed = (field == SLIST_FIELD_NAME);
-       me.sortButton3.forcePressed = (field == SLIST_FIELD_MAP);
+       me.currentSortField = fld;
+       me.sortButton1.forcePressed = (fld == SLIST_FIELD_PING);
+       me.sortButton2.forcePressed = (fld == SLIST_FIELD_NAME);
+       me.sortButton3.forcePressed = (fld == SLIST_FIELD_MAP);
        me.sortButton4.forcePressed = 0;
-       me.sortButton5.forcePressed = (field == SLIST_FIELD_NUMHUMANS);
+       me.sortButton5.forcePressed = (fld == SLIST_FIELD_NUMHUMANS);
        me.selectedItem = 0;
        if(me.selectedServer)
                strunzone(me.selectedServer);
index 6ee5dfc3c3131844233aba5725254e102195f69e..4a2de06131ffe3ad6bba6c06ba9269b570bbd411 100644 (file)
@@ -1091,7 +1091,7 @@ void PutClientInServer (void)
                        entity e;
                        e = get_weaponinfo(j);
                        if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
-                               self.weapon_load[j] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+                               self.(weapon_load[j]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                }
 
                oldself = self;
index f0981f5e29cac8bc88e73893d7cf3579b3c2de63..4a333934ae84a5ddc83f4281e2f7406daff1ef9a 100644 (file)
@@ -233,10 +233,10 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
                                        s = strcat(s, " and ", ftos(thisammo), " ", Item_CounterFieldName(j));
 
                                        // if our weapon is loaded, give its load back to the player
-                                       if(self.weapon_load[self.weapon] > 0)
+                                       if(self.(weapon_load[self.weapon]) > 0)
                                        {
-                                               own.ammofield += self.weapon_load[self.weapon];
-                                               self.weapon_load[self.weapon] = -1; // schedule the weapon for reloading
+                                               own.ammofield += self.(weapon_load[self.weapon]);
+                                               self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
                                        }
                                }
                        }
@@ -368,7 +368,7 @@ void W_WeaponFrame()
                        e = get_weaponinfo(self.switchweapon);
                        if(e.spawnflags & WEP_FLAG_RELOADABLE && cvar(strcat("g_balance_", e.netname, "_reload_ammo"))) // prevent accessing undefined cvars
                        {
-                               self.clip_load = self.weapon_load[self.switchweapon];
+                               self.clip_load = self.(weapon_load[self.switchweapon]);
                                self.clip_size = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
                        }
                        else
index 095e839becc0f33602b9378d8a7bc0d90384b766..73928031f5951f5979c21d6dac05ef8a7e7d9432 100644 (file)
@@ -1654,7 +1654,7 @@ void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
        if(ammo_reload)
        {
                self.clip_load -= ammo_use;
-               self.weapon_load[self.weapon] = self.clip_load;
+               self.(weapon_load[self.weapon]) = self.clip_load;
        }
        else
                self.(self.current_ammo) -= ammo_use;
@@ -1683,7 +1683,7 @@ void W_ReloadedAndReady()
                        self.(self.current_ammo) -= 1;
                }
        }
-       self.weapon_load[self.weapon] = self.clip_load;
+       self.(weapon_load[self.weapon]) = self.clip_load;
 
        // do not set ATTACK_FINISHED in reload code any more. This causes annoying delays if eg: You start reloading a weapon,
        // then quickly switch to another weapon and back. Reloading is canceled, but the reload delay is still there,
@@ -1766,5 +1766,5 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
        if(self.clip_load < 0)
                self.clip_load = 0;
        self.old_clip_load = self.clip_load;
-       self.clip_load = self.weapon_load[self.weapon] = -1;
+       self.clip_load = self.(weapon_load[self.weapon]) = -1;
 }
index 6e85e7aff695290dfd75e2a9609ea06b233b4a84..519d51daa2510edd8f23ecef335e454127bd4f9c 100644 (file)
@@ -109,7 +109,7 @@ void NIX_GiveCurrentWeapon()
                entity e;
                e = get_weaponinfo(nix_weapon);
                if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
-                       self.weapon_load[nix_weapon] = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
+                       self.(weapon_load[nix_weapon]) = cvar(strcat("g_balance_", e.netname, "_reload_ammo"));
 
                // nex too
                if(autocvar_g_balance_nex_charge)
index 9f40a453ead2bfdad1a40fc0a4829e6051e8165b..35ad9b6185fc8d6b5471079c26b09b99ce867d4d 100644 (file)
@@ -335,13 +335,13 @@ void PlayerStats_Accuracy(entity p)
     {
         w = get_weaponinfo(i);
 
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.accuracy_hit[i-1]);
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.accuracy_fired[i-1]);
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-hit"), a.(accuracy_hit[i-1]));
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-fired"), a.(accuracy_fired[i-1]));
 
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.accuracy_cnt_hit[i-1]);
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.accuracy_cnt_fired[i-1]);
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-hit"), a.(accuracy_cnt_hit[i-1]));
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-cnt-fired"), a.(accuracy_cnt_fired[i-1]));
 
-        PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.accuracy_frags[i-1]);
+        PlayerStats_Event(p, strcat("acc-", w.netname, "-frags"), a.(accuracy_frags[i-1]));
     }
 }
 
index 8d5fa100c92eec6bdc2f34a793ed917ccd7e5a92..782c567ceb09ab92b9c94cf5a00522a0aec71ed0 100644 (file)
@@ -56,7 +56,7 @@ float TeamScore_SendEntity(entity to, float sendflags)
 
        longflags = 0;
        for(i = 0, p = 1; i < MAX_TEAMSCORE; ++i, p *= 2)
-               if(self.teamscores[i] > 127 || self.teamscores[i] <= -128)
+               if(self.(teamscores[i]) > 127 || self.(teamscores[i]) <= -128)
                        longflags |= p;
 
 #if MAX_TEAMSCORE <= 8
@@ -70,9 +70,9 @@ float TeamScore_SendEntity(entity to, float sendflags)
                if(sendflags & p)
                {
                        if(longflags & p)
-                               WriteInt24_t(MSG_ENTITY, self.teamscores[i]);
+                               WriteInt24_t(MSG_ENTITY, self.(teamscores[i]));
                        else
-                               WriteChar(MSG_ENTITY, self.teamscores[i]);
+                               WriteChar(MSG_ENTITY, self.(teamscores[i]));
                }
 
        return TRUE;
@@ -222,7 +222,7 @@ float PlayerScore_SendEntity(entity to, float sendflags)
 
        longflags = 0;
        for(i = 0, p = 1; i < MAX_SCORE; ++i, p *= 2)
-               if(self.scores[i] > 127 || self.scores[i] <= -128)
+               if(self.(scores[i]) > 127 || self.(scores[i]) <= -128)
                        longflags |= p;
 
 #if MAX_SCORE <= 8
@@ -236,9 +236,9 @@ float PlayerScore_SendEntity(entity to, float sendflags)
                if(sendflags & p)
                {
                        if(longflags & p)
-                               WriteInt24_t(MSG_ENTITY, self.scores[i]);
+                               WriteInt24_t(MSG_ENTITY, self.(scores[i]));
                        else
-                               WriteChar(MSG_ENTITY, self.scores[i]);
+                               WriteChar(MSG_ENTITY, self.(scores[i]));
                }
 
        return TRUE;
index 6006dcf92edb6f0e2acf0bf3094211e1e4756e39..683b43669536cc76a3ce2d3defe1762f2844701f 100644 (file)
@@ -42,7 +42,7 @@ void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
     entity axh;
 
     axh_id = bound(0, axh_id, MAX_AXH);
-    axh = own.AuxiliaryXhair[axh_id];
+    axh = own.(AuxiliaryXhair[axh_id]);
 
     if(axh == world || wasfreed(axh))  // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
     {
@@ -56,7 +56,7 @@ void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
     setorigin(axh, loc);
     axh.colormod            = clr;
     axh.SendFlags           = 0x01;
-    own.AuxiliaryXhair[axh_id] = axh;
+    own.(AuxiliaryXhair[axh_id]) = axh;
 }
 
 /*
index 3866284a4c2007efeb3c0e55c99ec32044a2bc6e..aa72d8ec1736590dc0c1bb42b8f2489d289a7bea 100644 (file)
@@ -616,7 +616,7 @@ float w_crylink(float req)
                        return TRUE;
 
                ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
@@ -626,7 +626,7 @@ float w_crylink(float req)
                        return TRUE;
 
                ammo_amount = self.ammo_cells >= autocvar_g_balance_crylink_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_CRYLINK] >= autocvar_g_balance_crylink_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_CRYLINK]) >= autocvar_g_balance_crylink_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
index dcacee6c46b936cc7e701bac7f0e0acc5a587f2e..271b4f49146dd495d96dd70a8cd439ba270f1c7c 100644 (file)
@@ -268,7 +268,7 @@ void lgbeam_think()
                        {
                                dt = min(dt, owner_player.clip_load / autocvar_g_balance_electro_primary_ammo);
                                owner_player.clip_load = max(0, owner_player.clip_load - autocvar_g_balance_electro_primary_ammo * frametime);
-                               owner_player.weapon_load[WEP_ELECTRO] = owner_player.clip_load;
+                               owner_player.(weapon_load[WEP_ELECTRO]) = owner_player.clip_load;
                        }
                        else
                        {
@@ -507,19 +507,19 @@ float w_electro(float req)
                                ammo_amount = 1;
                        else
                                ammo_amount = self.ammo_cells > 0;
-                       ammo_amount += self.weapon_load[WEP_ELECTRO] > 0;
+                       ammo_amount += self.(weapon_load[WEP_ELECTRO]) > 0;
                }
                else
                {
                        ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_primary_ammo;
-                       ammo_amount += self.weapon_load[WEP_ELECTRO] >= autocvar_g_balance_electro_primary_ammo;
+                       ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_primary_ammo;
                }
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_cells >= autocvar_g_balance_electro_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_ELECTRO] >= autocvar_g_balance_electro_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_ELECTRO]) >= autocvar_g_balance_electro_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
index d916edd9f60e18005a6700223f5256f88cbc1d5d..9469c354dbf24d8f5262fccb8bb0011e61c81c9a 100644 (file)
@@ -365,13 +365,13 @@ float w_fireball(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_FIREBALL] >= autocvar_g_balance_fireball_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_fuel >= autocvar_g_balance_fireball_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_FIREBALL] >= autocvar_g_balance_fireball_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_FIREBALL]) >= autocvar_g_balance_fireball_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
index 968f157c7aa29735b7791b9ad417bdd90f1f14b3..4a9d672dc3a980c07ac8402b0f4e1a63a2ebf5d6 100644 (file)
@@ -346,13 +346,13 @@ float w_glauncher(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_GRENADE_LAUNCHER] >= autocvar_g_balance_grenadelauncher_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_GRENADE_LAUNCHER]) >= autocvar_g_balance_grenadelauncher_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_grenadelauncher_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_GRENADE_LAUNCHER] >= autocvar_g_balance_grenadelauncher_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_GRENADE_LAUNCHER]) >= autocvar_g_balance_grenadelauncher_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
index adecf1487fbb8c1e43c52de08d1ba884215e1709..61d3fb5bdd459a04fa1fee62ab365cb29193137d 100644 (file)
@@ -197,7 +197,7 @@ void W_Hagar_Attack2_Load (void)
 
        // this is different than WR_CHECKAMMO when it comes to reloading
        if(autocvar_g_balance_hagar_reload_ammo)
-               enough_ammo = self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
+               enough_ammo = self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo;
        else
                enough_ammo = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
 
@@ -347,13 +347,13 @@ float w_hagar(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_hagar_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_HAGAR] >= autocvar_g_balance_hagar_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_HAGAR]) >= autocvar_g_balance_hagar_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
index bcda0a807829b384885550b0e774bcddd74b2c43..f218838f7262b1bf73bcd7eb0e3c2bddecd8f665 100644 (file)
@@ -205,13 +205,13 @@ float w_hlac(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_HLAC] >= autocvar_g_balance_hlac_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_cells >= autocvar_g_balance_hlac_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_HLAC] >= autocvar_g_balance_hlac_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_HLAC]) >= autocvar_g_balance_hlac_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
index a2c57004ff9fa813df69df2186fb31667458aa98..f4a2fa2a8b6118a7f89f5a117e44750db6ed14ad 100644 (file)
@@ -486,7 +486,7 @@ float w_minelayer(float req)
                if (ATTACK_FINISHED(self) <= time || self.weapon != WEP_MINE_LAYER)
                {
                        ammo_amount = self.ammo_rockets >= autocvar_g_balance_minelayer_ammo;
-                       ammo_amount += self.weapon_load[WEP_MINE_LAYER] >= autocvar_g_balance_minelayer_ammo;
+                       ammo_amount += self.(weapon_load[WEP_MINE_LAYER]) >= autocvar_g_balance_minelayer_ammo;
                        return ammo_amount;
                }
        }
index 8c071ed1d84f9ab6170d33e4328cc97aec7758cb..6045fdb3cd0c8d96b52bfa8ddacf63560176baba 100644 (file)
@@ -246,7 +246,7 @@ float w_minstanex(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_cells >= minstanex_ammo;
-               ammo_amount += self.weapon_load[WEP_MINSTANEX] >= minstanex_ammo;
+               ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= minstanex_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
@@ -254,7 +254,7 @@ float w_minstanex(float req)
                if(!autocvar_g_balance_minstanex_laser_ammo)
                        return TRUE;
                ammo_amount = self.ammo_cells >= autocvar_g_balance_minstanex_laser_ammo;
-               ammo_amount += self.weapon_load[WEP_MINSTANEX] >= autocvar_g_balance_minstanex_laser_ammo;
+               ammo_amount += self.(weapon_load[WEP_MINSTANEX]) >= autocvar_g_balance_minstanex_laser_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
index 6847d89b96542c9c95c4695007042fc06c06af8e..95da666fc68018476e6f02f8c7de77de3e801cf2 100644 (file)
@@ -161,7 +161,7 @@ float w_nex(float req)
                                                                                {
                                                                                        self.clip_load = max(autocvar_g_balance_nex_secondary_ammo, self.clip_load - autocvar_g_balance_nex_secondary_ammo * dt);
                                                                                }
-                                                                               self.weapon_load[WEP_NEX] = self.clip_load;
+                                                                               self.(weapon_load[WEP_NEX]) = self.clip_load;
                                                                        }
                                                                        else
                                                                        {
@@ -216,14 +216,14 @@ float w_nex(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_primary_ammo;
-               ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_primary_ammo);
+               ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_primary_ammo);
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                // don't allow charging if we don't have enough ammo
                ammo_amount = self.ammo_cells >= autocvar_g_balance_nex_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_NEX] >= autocvar_g_balance_nex_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_NEX]) >= autocvar_g_balance_nex_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
index 4a8ed746a289dd5ee82bf9dae8f9755e57239ded..b184e730a4cfbd489cec6b4083a31e2fb44ff182 100644 (file)
@@ -183,13 +183,13 @@ float w_rifle(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_nails >= autocvar_g_balance_rifle_secondary_ammo;
-               ammo_amount += self.weapon_load[WEP_RIFLE] >= autocvar_g_balance_rifle_secondary_ammo;
+               ammo_amount += self.(weapon_load[WEP_RIFLE]) >= autocvar_g_balance_rifle_secondary_ammo;
                return ammo_amount;
        }
        else if (req == WR_RESETPLAYER)
index 280899fba78ff30129e93589e995c42d71408fdb..d582229da4756d8b0e9d4f2e463a67d6ffbe4384 100644 (file)
@@ -461,7 +461,7 @@ float w_rlauncher(float req)
                {
                        if(autocvar_g_balance_rocketlauncher_reload_ammo)
                        {
-                               if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.weapon_load[WEP_ROCKET_LAUNCHER] < autocvar_g_balance_rocketlauncher_ammo)
+                               if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo && self.(weapon_load[WEP_ROCKET_LAUNCHER]) < autocvar_g_balance_rocketlauncher_ammo)
                                        ammo_amount = TRUE;
                        }
                        else if(self.ammo_rockets < autocvar_g_balance_rocketlauncher_ammo)
index b74eb3d1d3facced36b523cdfe441aa94ab993cd..0a7b4761442f86026b1d0c0638ff0a243cbda8f2 100644 (file)
@@ -588,13 +588,13 @@ float w_seeker(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_missile_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_missile_ammo;
+               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_missile_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
        {
                ammo_amount = self.ammo_rockets >= autocvar_g_balance_seeker_tag_ammo;
-               ammo_amount += self.weapon_load[WEP_SEEKER] >= autocvar_g_balance_seeker_tag_ammo;
+               ammo_amount += self.(weapon_load[WEP_SEEKER]) >= autocvar_g_balance_seeker_tag_ammo;
                return ammo_amount;
        }
        else if (req == WR_RELOAD)
index 62b190bb223541901a862c541ec319211f20c977..bca8222da62c26d43988ffd28103ccf1eb813452 100644 (file)
@@ -170,7 +170,7 @@ float w_shotgun(float req)
        else if (req == WR_CHECKAMMO1)
        {
                ammo_amount = self.ammo_shells >= autocvar_g_balance_shotgun_primary_ammo;
-               ammo_amount += self.weapon_load[WEP_SHOTGUN] >= autocvar_g_balance_shotgun_primary_ammo;
+               ammo_amount += self.(weapon_load[WEP_SHOTGUN]) >= autocvar_g_balance_shotgun_primary_ammo;
                return ammo_amount;
        }
        else if (req == WR_CHECKAMMO2)
index e63d54a4152456988a2f2b4c9cc013323edd60f3..d7c5ea9cd4a725e1f482f616dd0889d2843fe3c0 100644 (file)
@@ -263,9 +263,9 @@ float w_uzi(float req)
                if(autocvar_g_balance_uzi_reload_ammo)
                {
                        if(autocvar_g_balance_uzi_mode == 1)
-                               ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_sustained_ammo;
+                               ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_sustained_ammo;
                        else
-                               ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_first_ammo;
+                               ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_first_ammo;
                }
                return ammo_amount;
        }
@@ -279,9 +279,9 @@ float w_uzi(float req)
                if(autocvar_g_balance_uzi_reload_ammo)
                {
                        if(autocvar_g_balance_uzi_mode == 1)
-                               ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_burst_ammo;
+                               ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_burst_ammo;
                        else
-                               ammo_amount += self.weapon_load[WEP_UZI] >= autocvar_g_balance_uzi_first_ammo;
+                               ammo_amount += self.(weapon_load[WEP_UZI]) >= autocvar_g_balance_uzi_first_ammo;
                }
                return ammo_amount;
        }