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:
@@ -55,13 +55,9 @@ namespace Content.Server.GlobalVerbs
|
||||
var userMind = player.ContentData()?.Mind;
|
||||
|
||||
var targetMind = target.GetComponent<MindComponent>();
|
||||
var oldEntity = userMind?.CurrentEntity;
|
||||
|
||||
targetMind.Mind?.TransferTo(null);
|
||||
userMind?.TransferTo(target);
|
||||
|
||||
if (oldEntity != null && oldEntity.HasComponent<GhostComponent>())
|
||||
oldEntity.Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user