]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/w_hagar.qc
Merge branch 'master' into Mario/modpack
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / w_hagar.qc
index 1085c315afae03ef3992de648a29ad3c48344097..808d7733af18fe718d885c24ca40303165dfeac3 100644 (file)
@@ -75,7 +75,7 @@ void W_Hagar_Explode2(void)
        remove(self);
 }
 
-void W_Hagar_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Hagar_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if(self.health <= 0)
                return;
@@ -160,7 +160,7 @@ void W_Hagar_Attack(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 void W_Hagar_Attack2(void)
@@ -204,7 +204,7 @@ void W_Hagar_Attack2(void)
 
        CSQCProjectile(missile, true, PROJECTILE_HAGAR_BOUNCING, true);
 
-       other = missile; MUTATOR_CALLHOOK(EditProjectile);
+       MUTATOR_CALLHOOK(EditProjectile, self, missile);
 }
 
 .float hagar_loadstep, hagar_loadblock, hagar_loadbeep, hagar_warning;
@@ -280,7 +280,7 @@ void W_Hagar_Attack2_Load_Release(void)
 
                CSQCProjectile(missile, true, PROJECTILE_HAGAR, true);
 
-               other = missile; MUTATOR_CALLHOOK(EditProjectile);
+               MUTATOR_CALLHOOK(EditProjectile, self, missile);
        }
 
        weapon_thinkf(WFRAME_FIRE2, WEP_CVAR_SEC(hagar, load_animtime), w_ready);
@@ -299,7 +299,9 @@ void W_Hagar_Attack2_Load(void)
        loaded = self.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
 
        // this is different than WR_CHECKAMMO when it comes to reloading
-       if(autocvar_g_balance_hagar_reload_ammo)
+       if(self.items & IT_UNLIMITED_WEAPON_AMMO)
+               enough_ammo = true;
+       else if(autocvar_g_balance_hagar_reload_ammo)
                enough_ammo = self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
        else
                enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
@@ -383,6 +385,7 @@ void W_Hagar_Attack2_Load(void)
 
        // we aren't checking ammo during an attack, so we must do it here
        if(!(WEP_ACTION(self.weapon, WR_CHECKAMMO1) + WEP_ACTION(self.weapon, WR_CHECKAMMO2)))
+       if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
        {
                // note: this doesn't force the switch
                W_SwitchToOtherWeapon(self);
@@ -390,7 +393,7 @@ void W_Hagar_Attack2_Load(void)
        }
 }
 
-float W_Hagar(float req)
+bool W_Hagar(int req)
 {
        float ammo_amount;
        switch(req)
@@ -519,7 +522,7 @@ float W_Hagar(float req)
 }
 #endif
 #ifdef CSQC
-float W_Hagar(float req)
+bool W_Hagar(int req)
 {
        switch(req)
        {