diff options
Diffstat (limited to 'azalea-client/src/packet_handling')
| -rw-r--r-- | azalea-client/src/packet_handling/game.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index d92f2464..0d5a6afe 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -500,6 +500,9 @@ pub fn process_packet_events(ecs: &mut World) { **position = new_pos; } + // old_pos is set to the current position when we're teleported + physics.set_old_pos(&position); + // send the relevant packets send_packet_events.send(SendPacketEvent::new( @@ -853,10 +856,14 @@ pub fn process_packet_events(ecs: &mut World) { if new_pos != **position { **position = new_pos; } + let position = *position; let mut look_direction = entity.get_mut::<LookDirection>().unwrap(); if new_look_direction != *look_direction { *look_direction = new_look_direction; } + // old_pos is set to the current position when we're teleported + let mut physics = entity.get_mut::<Physics>().unwrap(); + physics.set_old_pos(&position); }), }); |
