}
#endif
#ifdef SVQC
-void StatusEffects_apply(StatusEffects this, entity actor, float eff_time, int eff_flags)
+void StatusEffects_apply_timecheck(StatusEffects this, entity actor, float eff_time, int eff_flags, bool timecheck)
{
+ if (!actor || (timecheck && eff_time <= time))
+ return;
+
this.m_apply(this, actor, eff_time, eff_flags);
}
#endif
#ifdef SVQC
// call when applying the effect to an entity
-void StatusEffects_apply(StatusEffects this, entity actor, float eff_time, int eff_flags);
+void StatusEffects_apply_timecheck(StatusEffects this, entity actor, float eff_time, int eff_flags, bool timecheck);
+#define StatusEffects_apply(this, actor, eff_time, eff_flags) StatusEffects_apply_timecheck(this, actor, eff_time, eff_flags, true)
+#define StatusEffects_apply_notimecheck(this, actor, eff_time, eff_flags) StatusEffects_apply_timecheck(this, actor, eff_time, eff_flags, false)
// copies all the status effect fields to the specified storage entity
// does not perform an update
if(!StatusEffects_active(STATUSEFFECT_Superweapons, e))
{
if(!g_weaponarena && (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
- StatusEffects_apply(STATUSEFFECT_Superweapons, e, autocvar_g_balance_superweapons_time, 0);
+ StatusEffects_apply_notimecheck(STATUSEFFECT_Superweapons, e, autocvar_g_balance_superweapons_time, 0);
}
if(e.statuseffects)
else
e.statuseffects.statuseffect_time[it.m_id] += time;
});
-
StatusEffects_update(e);
}