Skip to content

Commit

Permalink
Fixes the crash upon receival of snapshot while the client controller…
Browse files Browse the repository at this point in the history
… is not initialized.
  • Loading branch information
AndreaCatania committed Feb 19, 2024
1 parent 9744bee commit ebc17ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scene_synchronizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3667,7 +3667,7 @@ bool ClientSynchronizer::parse_snapshot(DataBuffer &p_snapshot) {
ParseData *pd = static_cast<ParseData *>(p_user_pointer);

// Extract the InputID for the controller processed as Authority by this client.
const FrameIndex authority_frame_index = MapFunc::at(p_peers_frames_index, pd->player_controller->get_authority_peer(), FrameIndex::NONE);
const FrameIndex authority_frame_index = pd->player_controller ? MapFunc::at(p_peers_frames_index, pd->player_controller->get_authority_peer(), FrameIndex::NONE) : FrameIndex::NONE;

// Store it.
pd->snapshot.input_id = authority_frame_index;
Expand Down

0 comments on commit ebc17ba

Please sign in to comment.