Event-ify Rejuvenate (#11145)
This commit is contained in:
@@ -5,6 +5,7 @@ using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Temperature.Systems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Rejuvenate;
|
||||
using Robust.Server.GameObjects;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Containers;
|
||||
@@ -132,6 +133,7 @@ namespace Content.Server.Atmos.Miasma
|
||||
SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<PerishableComponent, BeingGibbedEvent>(OnGibbed);
|
||||
SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<RottingComponent, RejuvenateEvent>(OnRejuvenate);
|
||||
// Containers
|
||||
SubscribeLocalEvent<AntiRottingContainerComponent, EntInsertedIntoContainerMessage>(OnEntInserted);
|
||||
SubscribeLocalEvent<AntiRottingContainerComponent, EntRemovedFromContainerMessage>(OnEntRemoved);
|
||||
@@ -198,6 +200,11 @@ namespace Content.Server.Atmos.Miasma
|
||||
args.PushMarkup(Loc.GetString(description));
|
||||
}
|
||||
|
||||
private void OnRejuvenate(EntityUid uid, RottingComponent component, RejuvenateEvent args)
|
||||
{
|
||||
EntityManager.RemoveComponentDeferred<RottingComponent>(uid);
|
||||
}
|
||||
|
||||
/// Containers
|
||||
|
||||
private void OnEntInserted(EntityUid uid, AntiRottingContainerComponent component, EntInsertedIntoContainerMessage args)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
namespace Content.Server.Atmos.Miasma
|
||||
{
|
||||
[RegisterComponent]
|
||||
/// <summary>
|
||||
/// Tracking component for stuff that has started to rot.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class RottingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user