]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix mob state error (#21431)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Wed, 8 Nov 2023 01:30:05 +0000 (12:30 +1100)
committerGitHub <noreply@github.com>
Wed, 8 Nov 2023 01:30:05 +0000 (18:30 -0700)
Content.Shared/Mobs/Systems/MobStateSystem.Subscribers.cs
Content.Shared/Mobs/Systems/MobStateSystem.cs

index 4442d87d8850d8e24b9d097888db3e09a9b04519..15999322465ed4b0ea236e8a3e95774bd61c3f42 100644 (file)
@@ -70,6 +70,11 @@ public partial class MobStateSystem
 
     private void OnStateEnteredSubscribers(EntityUid target, MobStateComponent component, MobState state)
     {
+        // All of the state changes here should already be networked, so we do nothing if we are currently applying a
+        // server state.
+        if (_timing.ApplyingState)
+            return;
+
         _blocker.UpdateCanMove(target); //update movement anytime a state changes
         switch (state)
         {
index ad2de1c80137fe9ab3587062e8127f6576e72bd7..ff54c30aaf4f181e2ef4825de4ada60cebc957e6 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Mobs.Components;
 using Content.Shared.Standing;
 using Robust.Shared.GameStates;
 using Robust.Shared.Physics.Systems;
+using Robust.Shared.Timing;
 
 namespace Content.Shared.Mobs.Systems;
 
@@ -16,6 +17,7 @@ public partial class MobStateSystem : EntitySystem
     [Dependency] private readonly StandingStateSystem _standing = default!;
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
     [Dependency] private readonly ILogManager _logManager = default!;
+    [Dependency] private readonly IGameTiming _timing = default!;
     private ISawmill _sawmill = default!;
 
     public override void Initialize()