diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-11 09:57:35 +0100 |
---|---|---|
committer | Craig Robbins <kde.psych@gmail.com> | 2015-02-14 21:02:19 +1000 |
commit | 7f6fc148bd6f8337781efe59fd4f189fa94a2fda (patch) | |
tree | eae41c6a5cc712fbad3ef4a32ddea69d9a9d6dd0 /src | |
parent | 878e9f759481948af73e5129c5a79e44425a534e (diff) | |
download | minetest-7f6fc148bd6f8337781efe59fd4f189fa94a2fda.tar.gz minetest-7f6fc148bd6f8337781efe59fd4f189fa94a2fda.tar.bz2 minetest-7f6fc148bd6f8337781efe59fd4f189fa94a2fda.zip |
Fix issue #2279. ok @zeno-
Diffstat (limited to 'src')
-rw-r--r-- | src/game.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp index ba28aa789..a1e2b807a 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -3218,10 +3218,13 @@ void Game::updateCamera(VolatileRunFlags *flags, u32 busy_time, v3s16 old_camera_offset = camera->getOffset(); if (input->wasKeyDown(keycache.key[KeyCache::KEYMAP_ID_CAMERA_MODE])) { - camera->toggleCameraMode(); GenericCAO *playercao = player->getCAO(); - assert(playercao != NULL); + // If playercao not loaded, don't change camera + if (playercao == NULL) + return; + + camera->toggleCameraMode(); playercao->setVisible(camera->getCameraMode() > CAMERA_MODE_FIRST); } |