a small fix for code and... really small (#19751)

This commit is contained in:
Jark255
2023-09-03 21:32:40 +03:00
committed by GitHub
parent a268c890ed
commit 1c19dbb9fb

View File

@@ -1,5 +1,4 @@
using Content.Server.Ghost.Roles.Components;
using Content.Server.PAI;
using Content.Server.Ghost.Roles.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction.Events;
using Content.Shared.Mind;
@@ -17,8 +16,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
//todo this really shouldn't be in here but this system was converted from PAIs
[Dependency] private readonly PAISystem _pai = default!;
/// <inheritdoc/>
public override void Initialize()
@@ -86,6 +83,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
private void OnMindRemoved(EntityUid uid, ToggleableGhostRoleComponent component, MindRemovedMessage args)
{
// Mind was removed, prepare for re-toggle of the role
RemCompDeferred<GhostRoleComponent>(uid);
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
}
@@ -110,11 +109,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
return;
// Wiping device :(
// The shutdown of the Mind should cause automatic reset of the pAI during OnMindRemoved
// EDIT: But it doesn't!!!! Wtf? Do stuff manually
_mind.TransferTo(mindId, null, mind: mind);
_popup.PopupEntity(Loc.GetString(component.WipeVerbPopup), uid, args.User, PopupType.Large);
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
_pai.PAITurningOff(uid);
}
};
args.Verbs.Add(verb);
@@ -132,7 +128,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
RemCompDeferred<GhostRoleComponent>(uid);
_popup.PopupEntity(Loc.GetString(component.StopSearchVerbPopup), uid, args.User);
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
_pai.PAITurningOff(uid);
}
};
args.Verbs.Add(verb);