Fix Whoopie Cushions from lagging the game. (#39194)

This commit is contained in:
Princess Cheeseballs
2025-11-23 15:22:22 -06:00
committed by Vanessa
parent f4b216db8d
commit 03ffd9c959
5 changed files with 72 additions and 12 deletions
@@ -22,6 +22,13 @@ public sealed partial class StatusEffectsSystem
TimeSpan duration
)
{
if (duration == TimeSpan.Zero)
{
statusEffect = null;
return false;
}
// We check to make sure time is greater than zero here because sometimes you want to use TryAddStatusEffect to remove duration instead...
if (!TryGetStatusEffect(target, effectProto, out statusEffect))
return TryAddStatusEffect(target, effectProto, out statusEffect, duration);
@@ -53,6 +60,12 @@ public sealed partial class StatusEffectsSystem
TimeSpan? duration = null
)
{
if (duration <= TimeSpan.Zero)
{
statusEffect = null;
return false;
}
if (!TryGetStatusEffect(target, effectProto, out statusEffect))
return TryAddStatusEffect(target, effectProto, out statusEffect, duration);
@@ -83,6 +96,12 @@ public sealed partial class StatusEffectsSystem
TimeSpan? duration = null
)
{
if (duration <= TimeSpan.Zero)
{
statusEffect = null;
return false;
}
if (!TryGetStatusEffect(target, effectProto, out statusEffect))
return TryAddStatusEffect(target, effectProto, out statusEffect, duration);