mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Set PlayerEntity in Client::clean_state
. This fixes several issues where interpolation would kick in after changing characters, causing the player to be locked in place or shoot into the sky on respawn or teleport.
This commit is contained in:
parent
bf5be892d8
commit
03d0748d40
@ -1808,7 +1808,13 @@ impl Client {
|
||||
Ok(frontend_events)
|
||||
}
|
||||
|
||||
pub fn entity(&self) -> EcsEntity { self.entity }
|
||||
pub fn entity(&self) -> EcsEntity {
|
||||
debug_assert_eq!(
|
||||
self.state.ecs().read_resource::<PlayerEntity>().0,
|
||||
Some(self.entity)
|
||||
);
|
||||
self.entity
|
||||
}
|
||||
|
||||
pub fn uid(&self) -> Option<Uid> { self.state.read_component_copied(self.entity) }
|
||||
|
||||
@ -1891,6 +1897,7 @@ impl Client {
|
||||
.allocate(entity_builder.entity, Some(client_uid));
|
||||
|
||||
self.entity = entity_builder.with(uid).build();
|
||||
self.state.ecs().write_resource::<PlayerEntity>().0 = Some(self.entity);
|
||||
}
|
||||
|
||||
/// Change player alias to "You" if client belongs to matching player
|
||||
|
Loading…
Reference in New Issue
Block a user