fixes ghost duplication on aghosting (#3235)

Co-authored-by: Injazz <injazza@gmail.com>
This commit is contained in:
Injazz
2021-02-25 06:14:16 +05:00
committed by GitHub
parent 94bdf01ab7
commit 5ae1b06095

View File

@@ -33,14 +33,12 @@ namespace Content.Server.Administration.Commands
return; return;
} }
if (mind.VisitingEntity != null && mind.VisitingEntity.Prototype?.ID == "AdminObserver") if (mind.VisitingEntity != null && mind.VisitingEntity.HasComponent<GhostComponent>())
{ {
var visiting = mind.VisitingEntity; shell.WriteLine("Aren't you a ghost already?");
mind.UnVisit(); return;
visiting.Delete();
} }
else
{
var canReturn = mind.CurrentEntity != null; var canReturn = mind.CurrentEntity != null;
var ghost = IoCManager.Resolve<IEntityManager>() var ghost = IoCManager.Resolve<IEntityManager>()
.SpawnEntity("AdminObserver", player.AttachedEntity?.Transform.Coordinates .SpawnEntity("AdminObserver", player.AttachedEntity?.Transform.Coordinates
@@ -61,4 +59,3 @@ namespace Content.Server.Administration.Commands
} }
} }
} }
}