Cache CanMove (#7480)

This commit is contained in:
Leon Friedrich
2022-04-10 16:48:11 +12:00
committed by GitHub
parent 4135d9813b
commit 87eede8785
26 changed files with 218 additions and 109 deletions

View File

@@ -1,16 +1,11 @@
using Content.Shared.Examine;
using Content.Shared.PAI;
using Content.Shared.Verbs;
using Content.Shared.Instruments;
using Content.Server.Popups;
using Content.Server.Instruments;
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind.Components;
using Robust.Server.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Content.Shared.Actions;
using Content.Shared.Interaction.Events;
@@ -21,7 +16,6 @@ namespace Content.Server.PAI
{
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly InstrumentSystem _instrumentSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
public override void Initialize()
{
@@ -32,21 +26,6 @@ namespace Content.Server.PAI
SubscribeLocalEvent<PAIComponent, MindAddedMessage>(OnMindAdded);
SubscribeLocalEvent<PAIComponent, MindRemovedMessage>(OnMindRemoved);
SubscribeLocalEvent<PAIComponent, GetVerbsEvent<ActivationVerb>>(AddWipeVerb);
SubscribeLocalEvent<PAIComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<PAIComponent, ComponentShutdown>(OnShutdown);
}
private void OnStartup(EntityUid uid, PAIComponent component, ComponentStartup args)
{
if (component.MidiAction != null)
_actionsSystem.AddAction(uid, component.MidiAction, null);
}
private void OnShutdown(EntityUid uid, PAIComponent component, ComponentShutdown args)
{
if (component.MidiAction != null)
_actionsSystem.RemoveAction(uid, component.MidiAction);
}
private void OnExamined(EntityUid uid, PAIComponent component, ExaminedEvent args)