Skip to content

Commit

Permalink
Physics: Fix a regression from the multithreading refactoring that ma…
Browse files Browse the repository at this point in the history
…de the movement tracker panic when playing remote, because the player wasn't loaded yet at the time the first physics tick was made (the map isn't loaded either).
  • Loading branch information
MeFisto94 committed Jan 29, 2025
1 parent 73c4a48 commit 44053a5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/networking/movement_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ impl MovementTracker {
.upgrade()
.expect("World Server to outlive Movement Tracker");

let player_guid = world.player_guid.get().expect("Player Guid is already set");
let Some(player_guid) = world.player_guid.get() else {
return; // The physics thread is started before we're even properly loaded and connected.
};

let timestamp = world.get_timestamp();

let info = Self::build_movement_info(delta_unrotated, absolute_position, orientation, timestamp);
Expand Down

0 comments on commit 44053a5

Please sign in to comment.