diff --git a/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs b/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs index a5b16f9e40..207c8f17c2 100644 --- a/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs +++ b/Content.Client/GameObjects/Components/Mobs/State/MobStateManagerComponent.cs @@ -54,7 +54,7 @@ namespace Content.Client.GameObjects.Components.Mobs.State } _currentDamageState = state.DamageState; - CurrentMobState.ExitState(Owner); + CurrentMobState?.ExitState(Owner); CurrentMobState = Behavior[CurrentDamageState]; CurrentMobState.EnterState(Owner); } diff --git a/Content.Shared/GameObjects/Components/Mobs/State/SharedMobStateManagerComponent.cs b/Content.Shared/GameObjects/Components/Mobs/State/SharedMobStateManagerComponent.cs index 98a6899e8f..091b7163ca 100644 --- a/Content.Shared/GameObjects/Components/Mobs/State/SharedMobStateManagerComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/State/SharedMobStateManagerComponent.cs @@ -25,17 +25,11 @@ namespace Content.Shared.GameObjects.Components.Mobs.State public virtual DamageState CurrentDamageState { get; protected set; } - public override void OnAdd() - { - base.OnAdd(); - - CurrentDamageState = DamageState.Alive; - } - public override void Initialize() { base.Initialize(); + CurrentDamageState = DamageState.Alive; CurrentMobState = Behavior[CurrentDamageState]; CurrentMobState.EnterState(Owner); CurrentMobState.UpdateState(Owner);