]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Set weapons to fully loaded on respawn in each weapon file instead of cl_client....
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 23 Jan 2011 15:46:21 +0000 (17:46 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 23 Jan 2011 15:46:21 +0000 (17:46 +0200)
16 files changed:
qcsrc/server/cl_client.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_laser.qc
qcsrc/server/w_minelayer.qc
qcsrc/server/w_minstanex.qc
qcsrc/server/w_nex.qc
qcsrc/server/w_rocketlauncher.qc
qcsrc/server/w_seeker.qc
qcsrc/server/w_shotgun.qc
qcsrc/server/w_sniperrifle.qc
qcsrc/server/w_uzi.qc

index 7916e27a3917340002235a44d92514007202025d..77d00be41913a82f817ef5036178dbb0aceaa254 100644 (file)
@@ -889,23 +889,6 @@ void PutClientInServer (void)
                        self.nex_charge = autocvar_g_balance_nex_charge_start;
                }
 
-               // all weapons must be fully loaded the first time we pick them up, so set their load to maximum at respawn
-               self.laser_load = autocvar_g_balance_laser_reload_ammo;
-               self.shotgun_load = autocvar_g_balance_shotgun_reload_ammo;
-               self.uzi_load = autocvar_g_balance_uzi_reload_ammo;
-               self.grenadelauncher_load = autocvar_g_balance_grenadelauncher_reload_ammo;
-               self.minelayer_load = autocvar_g_balance_minelayer_reload_ammo;
-               self.electro_load = autocvar_g_balance_electro_reload_ammo;
-               self.crylink_load = autocvar_g_balance_crylink_reload_ammo;
-               self.hlac_load = autocvar_g_balance_hlac_reload_ammo;
-               self.nex_load = autocvar_g_balance_nex_reload_ammo;
-               self.minstanex_load = autocvar_g_balance_minstanex_reload_ammo;
-               self.sniperrifle_load = autocvar_g_balance_sniperrifle_reload_ammo;
-               self.seeker_load = autocvar_g_balance_seeker_reload_ammo;
-               self.hagar_load = autocvar_g_balance_hagar_reload_ammo;
-               self.fireball_load = autocvar_g_balance_fireball_reload_ammo;
-               self.rocketlauncher_load = autocvar_g_balance_rocketlauncher_reload_ammo;
-
                if(inWarmupStage)
                {
                        self.ammo_shells = warmup_start_ammo_shells;
index e4f488168eae87b8598f56f9c61afe4e9852ce56..6a823b920622fd24224825385ca43108eb495387 100644 (file)
@@ -687,6 +687,11 @@ float w_crylink(float req)
                ammo_amount += (autocvar_g_balance_crylink_reload_ammo && self.crylink_load >= autocvar_g_balance_crylink_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.crylink_load = autocvar_g_balance_crylink_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Crylink_Reload();
index cdc8c97e2d91673b36b009b5a46f4898fcbb995d..a6edd8f2d2f28e5c861fea99065c3ae4f5d5b3ba 100644 (file)
@@ -572,6 +572,9 @@ float w_electro(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.electro_secondarytime = time;
+
+               // all weapons must be fully loaded when we spawn
+               self.electro_load = autocvar_g_balance_electro_reload_ammo;
        }
        else if (req == WR_RELOAD)
        {
index 54743e536e6f0e99b9d0b41c45db17ef6f5f907b..f8f745a967f9fa698e36cbd42319cd3471b81d7c 100644 (file)
@@ -453,6 +453,9 @@ float w_fireball(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.fireball_primarytime = time;
+
+               // all weapons must be fully loaded when we spawn
+               self.fireball_load = autocvar_g_balance_fireball_reload_ammo;
        }
        else if (req == WR_RELOAD)
        {
index 47698e429149ad333cb07755356764537a5e8917..43ca764747a358a5f8899abe302e891b7bccbf60 100644 (file)
@@ -422,6 +422,11 @@ float w_glauncher(float req)
                ammo_amount += (autocvar_g_balance_grenadelauncher_reload_ammo && self.grenadelauncher_load >= autocvar_g_balance_grenadelauncher_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.grenadelauncher_load = autocvar_g_balance_grenadelauncher_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_GrenadeLauncher_Reload();
index 00dec6033bf6633cebf79b6b04a1da28391dd618..cbc146915c122e05180851ec3f383afc0f2595be 100644 (file)
@@ -246,6 +246,11 @@ float w_hagar(float req)
                ammo_amount += (autocvar_g_balance_hagar_reload_ammo && self.hagar_load >= autocvar_g_balance_hagar_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.hagar_load = autocvar_g_balance_hagar_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Hagar_Reload();
index 9090d41e5b0aa0a7d1f02dedc6ad10b460e901af..ad12e740d76101b7f6a7a188d089c163dc97f858 100644 (file)
@@ -285,6 +285,11 @@ float w_hlac(float req)
                ammo_amount += (autocvar_g_balance_hlac_reload_ammo && self.hlac_load >= autocvar_g_balance_hlac_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.hlac_load = autocvar_g_balance_hlac_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_HLAC_Reload();
index 7d2ac54448e60a68d01463d07dde1c1b78df45a3..222feb1c56a3261dc4c1899195bd64e5764411c2 100644 (file)
@@ -333,11 +333,22 @@ float w_laser(float req)
                W_Laser_SetAmmoCounter();
        }
        else if (req == WR_CHECKAMMO1)
+       {
                return TRUE;
+       }
        else if (req == WR_CHECKAMMO2)
+       {
                return TRUE;
+       }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.laser_load = autocvar_g_balance_laser_reload_ammo;
+       }
        else if (req == WR_RELOAD)
+       {
                W_Laser_Reload();
+       }
        return TRUE;
 };
 #endif
index 7b08c2e4fefc095b91c3dc25b0810a25e30a0b77..b8adb65ff0ef464e2076b89e41b2298bb2009b25 100644 (file)
@@ -490,6 +490,11 @@ float w_minelayer(float req)
        {
                return FALSE;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.minelayer_load = autocvar_g_balance_minelayer_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_MineLayer_Reload();
index 32d299b5308ce1aa4b5e4a697ea2ffceb9e8ec4e..03b072b8df8d8c0f1aec1db5eadec1d86e592f42 100644 (file)
@@ -331,6 +331,9 @@ float w_minstanex(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.minstanex_lasthit = 0;
+
+               // all weapons must be fully loaded when we spawn
+               self.minstanex_load = autocvar_g_balance_minstanex_reload_ammo;
        }
        else if (req == WR_RELOAD)
        {
index 6a66d9a804736eaef9d07a2f8bca86ea5448e829..1210372d1aa310d0389e065f21200c1fab1f184a 100644 (file)
@@ -297,6 +297,11 @@ float w_nex(float req)
                ammo_amount += (autocvar_g_balance_nex_reload_ammo && self.nex_load >= autocvar_g_balance_nex_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.nex_load = autocvar_g_balance_nex_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Nex_Reload();
index 37b4ba6d450841f2e4b1f18ed058e018c11833dd..85f855e137fcb0871725f6bb0752c2284a77c87e 100644 (file)
@@ -532,6 +532,9 @@ float w_rlauncher(float req)
        else if (req == WR_RESETPLAYER)
        {
                self.rl_release = 0;
+
+               // all weapons must be fully loaded when we spawn
+               self.rocketlauncher_load = autocvar_g_balance_rocketlauncher_reload_ammo;
        }
        else if (req == WR_RELOAD)
        {
index 361c1e99687eaa60549b70856e339a474d700cbf..a259c74afa00feb8bde9a8ee9e4095d8c5093f5c 100644 (file)
@@ -547,6 +547,11 @@ float w_seeker(float req)
                ammo_amount += (autocvar_g_balance_seeker_reload_ammo && self.seeker_load >= autocvar_g_balance_seeker_flac_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.seeker_load = autocvar_g_balance_seeker_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Seeker_Reload();
index a691386b5ec4ec4a7d5e37b58e199344d1fbbd4c..78060ec7d66b34785047a63420ea3a3aca644040 100644 (file)
@@ -220,9 +220,14 @@ float w_shotgun(float req)
        }
        else if (req == WR_CHECKAMMO2)
        {
-               // melee attack must always be available
+               // melee attack is always available
                return TRUE;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.shotgun_load = autocvar_g_balance_shotgun_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_Shotgun_Reload();
index 500773925a775371f17f95c46762c6af8a5da3f9..9e016b256036790c6e0a663713fb85483e02fc15 100644 (file)
@@ -256,6 +256,11 @@ float w_sniperrifle(float req)
                ammo_amount += (autocvar_g_balance_sniperrifle_reload_ammo && self.sniperrifle_load >= autocvar_g_balance_sniperrifle_secondary_ammo);
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.sniperrifle_load = autocvar_g_balance_sniperrifle_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_SniperRifle_Reload();
index 92fa62bd8d538abff232434c7de21b7ea6c4a0f8..b52a741a3971c41a236562ca4721039ae17971e2 100644 (file)
@@ -369,6 +369,11 @@ float w_uzi(float req)
                }
                return ammo_amount;
        }
+       else if (req == WR_RESETPLAYER)
+       {
+               // all weapons must be fully loaded when we spawn
+               self.uzi_load = autocvar_g_balance_uzi_reload_ammo;
+       }
        else if (req == WR_RELOAD)
        {
                W_UZI_Reload();