From 7f6fc148bd6f8337781efe59fd4f189fa94a2fda Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Wed, 11 Feb 2015 09:57:35 +0100 Subject: Fix issue #2279. ok @zeno- --- src/game.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3