lets get scuffed

This commit is contained in:
Alex 2023-08-20 17:03:56 +02:00
parent 4697d30502
commit c3e6fef7fe

View file

@ -300,11 +300,13 @@ 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;
this.state = WS_INUSE;
if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) // given this is performed often, perform a lighter check first if(StatusEffects_active(STATUSEFFECT_SpawnShield, actor)) // given this is performed often, perform a lighter check first
StatusEffects_remove(STATUSEFFECT_SpawnShield, actor, STATUSEFFECT_REMOVE_CLEAR); // kill spawn shield when you fire {
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;
// 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)
{ {