Make any mind added remove ghost role (#6127)
This commit is contained in:
@@ -48,6 +48,7 @@ namespace Content.Server.Ghost.Roles
|
||||
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
|
||||
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
|
||||
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MindAddedMessage>(OnMindAdded);
|
||||
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MindRemovedMessage>(OnMindRemoved);
|
||||
SubscribeLocalEvent<GhostTakeoverAvailableComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
_playerManager.PlayerStatusChanged += PlayerStatusChanged;
|
||||
@@ -228,6 +229,12 @@ namespace Content.Server.Ghost.Roles
|
||||
CloseEui(message.Player);
|
||||
}
|
||||
|
||||
private void OnMindAdded(EntityUid uid, GhostTakeoverAvailableComponent component, MindAddedMessage args)
|
||||
{
|
||||
component.Taken = true;
|
||||
UnregisterGhostRole(component);
|
||||
}
|
||||
|
||||
private void OnMindRemoved(EntityUid uid, GhostRoleComponent component, MindRemovedMessage args)
|
||||
{
|
||||
// Avoid re-registering it for duplicate entries and potential exceptions.
|
||||
|
||||
@@ -4,11 +4,6 @@ using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Ghost.Roles
|
||||
{
|
||||
public abstract class SharedGhostRoleSystem : EntitySystem
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GhostRole
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user