Fix hostile simplemob rotation (#20900)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user