]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/weapons/weapon/hagar.qc
Purge SetResourceAmountExplicit
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / weapons / weapon / hagar.qc
index 4d13e9cb7bccf68aa66902a2f5d4a5828eb38758..417a425685fbb7dc4eb234173c64d2fda4acfa3b 100644 (file)
@@ -91,7 +91,7 @@ void W_Hagar_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        missile.bot_dodgerating = WEP_CVAR_PRI(hagar, damage);
 
        missile.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(hagar, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_PRI(hagar, health));
        missile.damageforcescale = WEP_CVAR_PRI(hagar, damageforcescale);
        missile.event_damage = W_Hagar_Damage;
        missile.damagedbycontents = true;
@@ -137,7 +137,7 @@ void W_Hagar_Attack2(Weapon thiswep, entity actor, .entity weaponentity)
        missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
        missile.takedamage = DAMAGE_YES;
-       SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
+       SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
        missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
        missile.event_damage = W_Hagar_Damage;
        missile.damagedbycontents = true;
@@ -200,7 +200,7 @@ void W_Hagar_Attack2_Load_Release(Weapon thiswep, entity actor, .entity weaponen
                missile.bot_dodgerating = WEP_CVAR_SEC(hagar, damage);
 
                missile.takedamage = DAMAGE_YES;
-               SetResourceAmountExplicit(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
+               SetResourceAmount(missile, RESOURCE_HEALTH, WEP_CVAR_SEC(hagar, health));
                missile.damageforcescale = WEP_CVAR_SEC(hagar, damageforcescale);
                missile.event_damage = W_Hagar_Damage;
                missile.damagedbycontents = true;
@@ -379,16 +379,9 @@ void W_Hagar_Attack_Auto(Weapon thiswep, entity actor, .entity weaponentity, int
 
        W_Hagar_Attack(thiswep, actor, weaponentity);
 
-       int slot = weaponslot(weaponentity);
-       ATTACK_FINISHED(actor, slot) = time + WEP_CVAR_PRI(hagar, refire) * W_WeaponRateFactor(actor);
-       int theframe = WFRAME_FIRE1;
-       entity this = actor.(weaponentity);
-       if(this)
-       {
-               if(this.wframe == WFRAME_FIRE1)
-                       theframe = WFRAME_DONTCHANGE;
-       }
-       weapon_thinkf(actor, weaponentity, theframe, WEP_CVAR_PRI(hagar, refire), W_Hagar_Attack_Auto);
+       ATTACK_FINISHED(actor, weaponentity) = time + WEP_CVAR_PRI(hagar, refire) * W_WeaponRateFactor(actor);
+       actor.(weaponentity).wframe = WFRAME_FIRE1;
+       weapon_thinkf(actor, weaponentity, WFRAME_DONTCHANGE, WEP_CVAR_PRI(hagar, refire), W_Hagar_Attack_Auto);
 }
 
 METHOD(Hagar, wr_aim, void(entity thiswep, entity actor, .entity weaponentity))