Lets Hamlet Dance (#30478)
Allow Ghost Roles that have NPC to turn on Combat Mode
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Shared.Actions;
|
using Content.Shared.Actions;
|
||||||
|
using Content.Shared.Mind;
|
||||||
using Content.Shared.MouseRotator;
|
using Content.Shared.MouseRotator;
|
||||||
using Content.Shared.Movement.Components;
|
using Content.Shared.Movement.Components;
|
||||||
using Content.Shared.Popups;
|
using Content.Shared.Popups;
|
||||||
@@ -13,6 +14,7 @@ public abstract class SharedCombatModeSystem : EntitySystem
|
|||||||
[Dependency] private readonly INetManager _netMan = default!;
|
[Dependency] private readonly INetManager _netMan = default!;
|
||||||
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
|
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@@ -82,7 +84,7 @@ public abstract class SharedCombatModeSystem : EntitySystem
|
|||||||
_actionsSystem.SetToggled(component.CombatToggleActionEntity, component.IsInCombatMode);
|
_actionsSystem.SetToggled(component.CombatToggleActionEntity, component.IsInCombatMode);
|
||||||
|
|
||||||
// Change mouse rotator comps if flag is set
|
// Change mouse rotator comps if flag is set
|
||||||
if (!component.ToggleMouseRotator || IsNpc(entity))
|
if (!component.ToggleMouseRotator || IsNpc(entity) && !_mind.TryGetMind(entity, out _, out _))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SetMouseRotatorComponents(entity, value);
|
SetMouseRotatorComponents(entity, value);
|
||||||
|
|||||||
Reference in New Issue
Block a user