cleaned a bit, lets try again
This commit is contained in:
parent
f4bb0228ae
commit
70f2d23d4a
1 changed files with 3 additions and 6 deletions
|
@ -301,11 +301,8 @@ void weapon_prepareattack_do(entity actor, .entity weaponentity, bool secondary,
|
|||
entity this = actor.(weaponentity);
|
||||
if (this == NULL) return;
|
||||
|
||||
if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) // 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
|
||||
}
|
||||
if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) StatusEffects_remove(STATUSEFFECT_SpawnShield, actor, STATUSEFFECT_REMOVE_CLEAR); // given this is performed often, perform a lighter check first
|
||||
|
||||
this.state = WS_INUSE;
|
||||
// if the weapon hasn't been firing continuously, reset the timer
|
||||
if (attacktime >= 0)
|
||||
|
@ -422,7 +419,7 @@ bool weaponUseForbidden(entity player)
|
|||
{
|
||||
if (round_handler_IsActive() && !round_handler_IsRoundStarted()) 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue