Fix isDead()/autoforward crash (#9031)

Crash occurred in singleplayer when leaving a world with
autoforward enabled then re-entering a world.
This commit is contained in:
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

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