Refactor mind and ghost deletion code (#3680)
* Refactor mind and ghost deletion code * Refactor to use EventBus and clean up deletes * Fix mind eject when being deleted * Refactor entity manager calls to use IEntity.EntityManager
This commit is contained in:
@@ -61,15 +61,8 @@ namespace Content.Server.Administration.Commands
|
||||
|
||||
DebugTools.AssertNotNull(mind);
|
||||
|
||||
var oldEntity = mind!.CurrentEntity;
|
||||
|
||||
mindComponent.Mind?.TransferTo(null);
|
||||
mind.TransferTo(target);
|
||||
|
||||
DebugTools.AssertNotNull(oldEntity);
|
||||
|
||||
if (oldEntity!.HasComponent<GhostComponent>())
|
||||
oldEntity.Delete();
|
||||
mind!.TransferTo(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user