Fix Whoopie Cushions from lagging the game. (#39194)
This commit is contained in:
committed by
GitHub
parent
2b8145ce87
commit
ce7b7c1adf
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user