1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 11:52:40 +01:00

Fix crash starting new game

The player doesn't always exist, so we do need to check..
This commit is contained in:
Daniel Evans 2016-11-24 21:29:25 +00:00
parent c63d12b70a
commit 6ef99c0de9

View File

@ -125,6 +125,7 @@ void IngameState::tick(float dt) {
auto player = game->getPlayer();
if (player) {
// Force all input to 0 if player input is disabled
/// @todo verify 0ing input is the correct behaviour
const auto inputEnabled = player->isInputEnabled();
@ -140,7 +141,6 @@ void IngameState::tick(float dt) {
return inputEnabled && world->state->input[0].pressed(c);
};
if (player) {
float viewDistance = 4.f;
switch (camMode) {
case IngameState::CAMERA_CLOSE: