diff options
author | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-11 09:57:35 +0100 |
---|---|---|
committer | Loic Blot <loic.blot@unix-experience.fr> | 2015-02-11 10:03:29 +0100 |
commit | 8252e1ecd097abd83a3e9ef95aba37a3d837e00b (patch) | |
tree | f5a0c1f69359d11ac3a5b6bbc4dc016030c4025d /src/game.cpp | |
parent | 10b208f5c16d3d608fd029372422dd801aaa56ae (diff) | |
download | minetest-8252e1ecd097abd83a3e9ef95aba37a3d837e00b.tar.gz minetest-8252e1ecd097abd83a3e9ef95aba37a3d837e00b.tar.bz2 minetest-8252e1ecd097abd83a3e9ef95aba37a3d837e00b.zip |
Fix issue #2279. ok @zeno-
Diffstat (limited to 'src/game.cpp')
-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); } |