]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix hostile simplemob rotation (#20900)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sat, 14 Oct 2023 07:15:20 +0000 (03:15 -0400)
committerGitHub <noreply@github.com>
Sat, 14 Oct 2023 07:15:20 +0000 (00:15 -0700)
Content.Client/CombatMode/CombatModeSystem.cs
Content.Server/CombatMode/CombatModeSystem.cs
Content.Shared/CombatMode/SharedCombatModeSystem.cs

index 69f149c310a95bfeacd5a5594ece12cb9120aafb..34ae0b1338b50d74fdb42e2f1018beab4a513768 100644 (file)
@@ -1,4 +1,5 @@
 using Content.Client.Hands.Systems;
+using Content.Client.NPC.HTN;
 using Content.Shared.CCVar;
 using Content.Shared.CombatMode;
 using Robust.Client.Graphics;
@@ -59,6 +60,11 @@ public sealed class CombatModeSystem : SharedCombatModeSystem
         UpdateHud(entity);
     }
 
+    protected override bool IsNpc(EntityUid uid)
+    {
+        return HasComp<HTNComponent>(uid);
+    }
+
     private void UpdateHud(EntityUid entity)
     {
         if (entity != _playerManager.LocalPlayer?.ControlledEntity || !Timing.IsFirstTimePredicted)
index 1c1df817e68ca680fb2c9965385cf53ed80df7f0..e04463c534dc89e7ef5c89856ef34ed00be252bd 100644 (file)
@@ -1,7 +1,12 @@
+using Content.Server.NPC.HTN;
 using Content.Shared.CombatMode;
 
 namespace Content.Server.CombatMode;
 
 public sealed class CombatModeSystem : SharedCombatModeSystem
 {
+    protected override bool IsNpc(EntityUid uid)
+    {
+        return HasComp<HTNComponent>(uid);
+    }
 }
index 5fe763370fdb0cd78f974cf35eab50752b055981..60d1362bb0bd9dbcd5878edfc6f85790aed35892 100644 (file)
@@ -82,7 +82,7 @@ public abstract class SharedCombatModeSystem : EntitySystem
             _actionsSystem.SetToggled(component.CombatToggleActionEntity, component.IsInCombatMode);
 
         // Change mouse rotator comps if flag is set
-        if (!component.ToggleMouseRotator)
+        if (!component.ToggleMouseRotator || IsNpc(entity))
             return;
 
         SetMouseRotatorComponents(entity, value);
@@ -101,6 +101,12 @@ public abstract class SharedCombatModeSystem : EntitySystem
             RemComp<NoRotateOnMoveComponent>(uid);
         }
     }
+
+    // todo: When we stop making fucking garbage abstract shared components, remove this shit too.
+    protected abstract bool IsNpc(EntityUid uid);
 }
 
-public sealed partial class ToggleCombatActionEvent : InstantActionEvent { }
+public sealed partial class ToggleCombatActionEvent : InstantActionEvent
+{
+
+}