mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed issue caused by Uid component being removed too soon on logout
This commit is contained in:
parent
9bfd396c36
commit
7039bf7a0c
@ -18,6 +18,10 @@ pub fn handle_exit_ingame(server: &mut Server, entity: EcsEntity) {
|
||||
span!(_guard, "handle_exit_ingame");
|
||||
let state = server.state_mut();
|
||||
|
||||
// Sync the player's character data to the database. This must be done before
|
||||
// removing any components from the entity
|
||||
let entity = persist_entity(state, entity);
|
||||
|
||||
// Create new entity with just `Client`, `Uid`, `Player`, and `...Stream`
|
||||
// components Easier than checking and removing all other known components
|
||||
// Note: If other `ServerEvent`s are referring to this entity they will be
|
||||
@ -83,9 +87,6 @@ pub fn handle_exit_ingame(server: &mut Server, entity: EcsEntity) {
|
||||
// Erase group component to avoid group restructure when deleting the entity
|
||||
state.ecs().write_storage::<group::Group>().remove(entity);
|
||||
|
||||
// Sync the player's character data to the database
|
||||
let entity = persist_entity(state, entity);
|
||||
|
||||
// Delete old entity
|
||||
if let Err(e) = state.delete_entity_recorded(entity) {
|
||||
error!(
|
||||
|
Loading…
Reference in New Issue
Block a user