]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_hagar.qc
Merge commit '6f440770dbdb' into atheros/item_keys
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_hagar.qc
index 76d2f9414aef874b2a883460bd22c64d3d0867d9..12abae6eac7463294df678d82cf4e496263665e1 100644 (file)
@@ -26,8 +26,13 @@ void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deat
                return;
                
        float is_linkexplode = ((inflictor.realowner == self.realowner) 
-               && ((inflictor.projectiledeathtype & HITTYPE_SECONDARY) && (self.projectiledeathtype & HITTYPE_SECONDARY))
-               && autocvar_g_balance_hagar_secondary_load_linkexplode);
+               && (inflictor.projectiledeathtype & HITTYPE_SECONDARY) 
+               && (self.projectiledeathtype & HITTYPE_SECONDARY));
+       
+       if(is_linkexplode)
+               is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode);
+       else
+               is_linkexplode = -1; // not secondary load, so continue as normal without exception.
                
        if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
                return; // g_projectiles_damage says to halt
@@ -62,7 +67,7 @@ void W_Hagar_Touch2 (void)
 
 void W_Hagar_Attack (void)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_primary_ammo, autocvar_g_balance_hagar_reload_ammo);
 
@@ -104,7 +109,7 @@ void W_Hagar_Attack (void)
 
 void W_Hagar_Attack2 (void)
 {
-       local entity missile;
+       entity missile;
 
        W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo);
 
@@ -150,9 +155,9 @@ void W_Hagar_Attack2_Load_Release (void)
 {
        // time to release the rockets we've loaded
 
-       local entity missile;
-       local float counter, shots, spread_pershot;
-       local vector s;
+       entity missile;
+       float counter, shots, spread_pershot;
+       vector s;
        vector forward, right, up;
 
        if(!self.hagar_load)
@@ -231,7 +236,7 @@ void W_Hagar_Attack2_Load (void)
 {
        // loadable hagar secondary attack, must always run each frame
 
-       local float loaded, enough_ammo;
+       float loaded, enough_ammo;
        loaded = self.hagar_load >= autocvar_g_balance_hagar_secondary_load_max;
 
        // this is different than WR_CHECKAMMO when it comes to reloading
@@ -344,7 +349,7 @@ float w_hagar(float req)
                }
        else if (req == WR_THINK)
        {
-               local float loadable_secondary;
+               float loadable_secondary;
                loadable_secondary = autocvar_g_balance_hagar_secondary_load && autocvar_g_balance_hagar_secondary;
 
                if (loadable_secondary)
@@ -427,7 +432,7 @@ float w_hagar(float req)
                        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");
        }
        return TRUE;
-};
+}
 #endif
 #ifdef CSQC
 float w_hagar(float req)