a small fix for code and... really small (#19751)
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using Content.Server.Ghost.Roles.Components;
|
using Content.Server.Ghost.Roles.Components;
|
||||||
using Content.Server.PAI;
|
|
||||||
using Content.Shared.Examine;
|
using Content.Shared.Examine;
|
||||||
using Content.Shared.Interaction.Events;
|
using Content.Shared.Interaction.Events;
|
||||||
using Content.Shared.Mind;
|
using Content.Shared.Mind;
|
||||||
@@ -17,8 +16,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
|
|||||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||||
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
[Dependency] private readonly SharedPopupSystem _popup = default!;
|
||||||
[Dependency] private readonly SharedMindSystem _mind = 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/>
|
/// <inheritdoc/>
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
@@ -86,6 +83,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnMindRemoved(EntityUid uid, ToggleableGhostRoleComponent component, MindRemovedMessage args)
|
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);
|
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,11 +109,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
|
|||||||
return;
|
return;
|
||||||
// Wiping device :(
|
// Wiping device :(
|
||||||
// The shutdown of the Mind should cause automatic reset of the pAI during OnMindRemoved
|
// 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);
|
_mind.TransferTo(mindId, null, mind: mind);
|
||||||
_popup.PopupEntity(Loc.GetString(component.WipeVerbPopup), uid, args.User, PopupType.Large);
|
_popup.PopupEntity(Loc.GetString(component.WipeVerbPopup), uid, args.User, PopupType.Large);
|
||||||
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
|
|
||||||
_pai.PAITurningOff(uid);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
@@ -132,7 +128,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
|
|||||||
RemCompDeferred<GhostRoleComponent>(uid);
|
RemCompDeferred<GhostRoleComponent>(uid);
|
||||||
_popup.PopupEntity(Loc.GetString(component.StopSearchVerbPopup), uid, args.User);
|
_popup.PopupEntity(Loc.GetString(component.StopSearchVerbPopup), uid, args.User);
|
||||||
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
|
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
|
||||||
_pai.PAITurningOff(uid);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
args.Verbs.Add(verb);
|
args.Verbs.Add(verb);
|
||||||
|
|||||||
Reference in New Issue
Block a user