]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Further secure dropping while loading, and also create a WR_DROP event for weapons...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 12 Apr 2011 23:04:23 +0000 (02:04 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 12 Apr 2011 23:04:23 +0000 (02:04 +0300)
qcsrc/common/constants.qh
qcsrc/server/cl_weapons.qc
qcsrc/server/w_hagar.qc

index 7b0ef3834257784a8d379bcd971218ad1f4410ca..6ace0dd1f0953278d51110adc364d1b20fe5316e 100644 (file)
@@ -629,6 +629,7 @@ float WR_RESETPLAYER    = 10; // (SVQC) does not need to do anything
 float WR_IMPACTEFFECT  = 11; // (CSQC) impact effect
 float WR_SWITCHABLE    = 12; // (CSQC) impact effect
 float WR_PLAYERDEATH    = 13; // (SVQC) does not need to do anything
+float WR_DROP    = 14; // (SVQC) does not need to do anything
 
 
 float HUD_PANEL_WEAPONS                = 0;
index e605a0637cbd98b18c5420d7a744388ae829e228..04f6185bfb2ba90e6ab60f2eb274a4d49d695e57 100644 (file)
@@ -179,6 +179,8 @@ string W_ThrowNewWeapon(entity own, float wpn, float doreduce, vector org, vecto
        string s;
        var .float ammofield;
 
+       weapon_action(own.weapon, WR_DROP);
+
        wep = spawn();
 
        setorigin(wep, org);
index 3ab7836369e86fad12edb76686243343db17ee94..fda056e06728272141e3265bbff5a7523917a471 100644 (file)
@@ -330,6 +330,14 @@ float w_hagar(float req)
                if(self.hagar_load && autocvar_g_balance_hagar_secondary_load_releasedeath)
                        W_Hagar_Attack2_Load_Release();
        }
+       else if (req == WR_DROP)
+       {
+               if(self.hagar_load)
+               {
+                       W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo if necessary
+                       self.hagar_load = 0;
+               }
+       }
        else if (req == WR_RELOAD)
        {
                W_Reload(min(autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_secondary_ammo), autocvar_g_balance_hagar_reload_ammo, autocvar_g_balance_hagar_reload_time, "weapons/reload.wav");