Mobstate Refactor (#13389)
Refactors mobstate and moves mob health thresholds to their own component Co-authored-by: DrSmugleaf <drsmugleaf@gmail.com>
This commit is contained in:
@@ -5,8 +5,8 @@ using Content.Server.GameTicking;
|
||||
using Content.Server.Roles;
|
||||
using Content.Shared.CCVar;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.MobState;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Players.PlayTimeTracking;
|
||||
using Content.Shared.Roles;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -74,7 +74,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
if (!TryComp<MobStateComponent>(attached, out var state))
|
||||
return false;
|
||||
|
||||
return state.CurrentState is DamageState.Alive or DamageState.Critical;
|
||||
return state.CurrentState is MobState.Alive or MobState.Critical;
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetTimedRoles(Mind.Mind mind)
|
||||
@@ -142,7 +142,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
|
||||
|
||||
private void OnMobStateChanged(MobStateChangedEvent ev)
|
||||
{
|
||||
if (!TryComp(ev.Entity, out ActorComponent? actor))
|
||||
if (!TryComp(ev.Target, out ActorComponent? actor))
|
||||
return;
|
||||
|
||||
_tracking.QueueRefreshTrackers(actor.PlayerSession);
|
||||
|
||||
Reference in New Issue
Block a user