Skip to content

Commit

Permalink
Fix isDead()/autoforward crash (#9031)
Browse files Browse the repository at this point in the history
Crash occurred in singleplayer when leaving a world with
autoforward enabled then re-entering a world.
  • Loading branch information
paramat committed Oct 9, 2019
1 parent cbcb9e0 commit f483a1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/client/game.cpp
Expand Up @@ -2481,7 +2481,8 @@ void Game::updatePlayerControl(const CameraOrientation &cam)
}

// autoforward if set: simulate "up" key
if (player->getPlayerSettings().continuous_forward && !player->isDead()) {
if (player->getPlayerSettings().continuous_forward &&
client->activeObjectsReceived() && !player->isDead()) {
control.up = true;
keypress_bits |= 1U << 0;
}
Expand Down

0 comments on commit f483a1a

Please sign in to comment.