Fix dead mobs falling asleep (#12917)
* Dead or zombie mobs can no longer sleep * Removed zombie fix * Moved dead-checks to OnEvent * Cleanup
This commit is contained in:
@@ -178,6 +178,10 @@ namespace Content.Server.Bed.Sleep
|
||||
if (!HasComp<MobStateComponent>(uid))
|
||||
return false;
|
||||
|
||||
var tryingToSleepEvent = new TryingToSleepEvent(uid);
|
||||
RaiseLocalEvent(uid, ref tryingToSleepEvent);
|
||||
if (tryingToSleepEvent.Cancelled) return false;
|
||||
|
||||
if (_prototypeManager.TryIndex<InstantActionPrototype>("Sleep", out var sleepAction))
|
||||
_actionsSystem.RemoveAction(uid, sleepAction);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user