cleaned a bit, lets try again

This commit is contained in:
Alex 2023-08-26 18:05:31 +02:00
parent f4bb0228ae
commit 70f2d23d4a

View file

@ -301,11 +301,8 @@ void weapon_prepareattack_do(entity actor, .entity weaponentity, bool secondary,
entity this = actor.(weaponentity); entity this = actor.(weaponentity);
if (this == NULL) return; if (this == NULL) return;
if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) // given this is performed often, perform a lighter check first if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) StatusEffects_remove(STATUSEFFECT_SpawnShield, actor, STATUSEFFECT_REMOVE_CLEAR); // given this is performed often, perform a lighter check first
{
if(autocvar_g_weapons_spawnshield_forbid_firing) return;
if(!autocvar_g_weapons_spawnshield_forbid_firing) StatusEffects_remove(STATUSEFFECT_SpawnShield, actor, STATUSEFFECT_REMOVE_CLEAR); // kill spawn shield when you fire
}
this.state = WS_INUSE; this.state = WS_INUSE;
// if the weapon hasn't been firing continuously, reset the timer // if the weapon hasn't been firing continuously, reset the timer
if (attacktime >= 0) if (attacktime >= 0)
@ -422,7 +419,7 @@ bool weaponUseForbidden(entity player)
{ {
if (round_handler_IsActive() && !round_handler_IsRoundStarted()) return true; if (round_handler_IsActive() && !round_handler_IsRoundStarted()) return true;
if (MUTATOR_CALLHOOK(ForbidWeaponUse, player)) return true; if (MUTATOR_CALLHOOK(ForbidWeaponUse, player)) return true;
if (autocvar_g_weapons_spawnshield_forbid_firing && StatusEffects_active(STATUSEFFECT_SpawnShield, player)) return true; if (autocvar_g_spawnshield_blockfiring && StatusEffects_active(STATUSEFFECT_SpawnShield, player)) return true;
return false; return false;
} }