1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-10 11:25:07 -05:00

Fix issue #2279. ok @zeno-

This commit is contained in:
Loic Blot 2015-02-11 09:57:35 +01:00 committed by Craig Robbins
parent 878e9f7594
commit 7f6fc148bd

View File

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