Event-ify Rejuvenate (#11145)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Rejuvenate;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
@@ -22,6 +23,7 @@ namespace Content.Shared.StatusEffect
|
||||
|
||||
SubscribeLocalEvent<StatusEffectsComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<StatusEffectsComponent, ComponentHandleState>(OnHandleState);
|
||||
SubscribeLocalEvent<StatusEffectsComponent, RejuvenateEvent>(OnRejuvenate);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -82,6 +84,11 @@ namespace Content.Shared.StatusEffect
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRejuvenate(EntityUid uid, StatusEffectsComponent component, RejuvenateEvent args)
|
||||
{
|
||||
TryRemoveAllStatusEffects(uid, component);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to add a status effect to an entity, with a given component added as well.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user