Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJorge Bernal <jbernalmartinez@gmail.com>2015-07-06 16:40:09 +0300
committerJorge Bernal <jbernalmartinez@gmail.com>2015-07-06 16:40:50 +0300
commit12583287e78505f45d62d9fd419371be66debf93 (patch)
treef8de18e89e8b06f5d9667c8ea6901ab69b4eb246 /source/gameengine/Ketsji
parent266459c7da24bd54fbe20a6eac8e6db4f5ac7be7 (diff)
BGE: Fix T45341: Crash when camera is eliminated
A null check is added to avoid crashes when the camera is removed during the game and no other is available
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 3a596548cfa..d33cbb9e2ae 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1756,6 +1756,10 @@ void KX_Scene::RenderFonts()
void KX_Scene::UpdateObjectLods(void)
{
KX_GameObject* gameobj;
+
+ if (!this->m_active_camera)
+ return;
+
MT_Vector3 cam_pos = this->m_active_camera->NodeGetWorldPosition();
for (int i = 0; i < this->GetObjectList()->GetCount(); i++) {