Fix isDead()/autoforward crash (#9031)

Crash occurred in singleplayer when leaving a world with
autoforward enabled then re-entering a world.
master
Paramat 2019-10-09 19:39:50 +01:00 committed by GitHub
parent cbcb9e0b1c
commit f483a1a9b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}