NPC wake / sleep cleanup (#5679)

This commit is contained in:
metalgearsloth
2021-12-05 14:08:35 +11:00
committed by GitHub
parent ae65418c52
commit 5d63411113
10 changed files with 175 additions and 217 deletions

View File

@@ -311,11 +311,8 @@ namespace Content.Shared.MobState.Components
state.EnterState(OwnerUid, Owner.EntityManager);
state.UpdateState(OwnerUid, threshold, Owner.EntityManager);
var message = new MobStateChangedMessage(this, old, state);
#pragma warning disable 618
SendMessage(message);
#pragma warning restore 618
Owner.EntityManager.EventBus.RaiseEvent(EventSource.Local, message);
var message = new MobStateChangedEvent(this, old, state);
Owner.EntityManager.EventBus.RaiseLocalEvent(OwnerUid, message);
Dirty();
}

View File

@@ -4,11 +4,9 @@ using Robust.Shared.GameObjects;
namespace Content.Shared.MobState
{
#pragma warning disable 618
public class MobStateChangedMessage : ComponentMessage
#pragma warning restore 618
public class MobStateChangedEvent : EntityEventArgs
{
public MobStateChangedMessage(
public MobStateChangedEvent(
MobStateComponent component,
IMobState? oldMobState,
IMobState currentMobState)