[Bf-blender-cvs] [1258328] master: BGE: Fix T45341: Crash when camera is eliminated

Jorge Bernal noreply at git.blender.org
Mon Jul 6 15:41:06 CEST 2015


Commit: 12583287e78505f45d62d9fd419371be66debf93
Author: Jorge Bernal
Date:   Mon Jul 6 15:40:09 2015 +0200
Branches: master
https://developer.blender.org/rB12583287e78505f45d62d9fd419371be66debf93

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

===================================================================

M	source/gameengine/Ketsji/KX_Scene.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 3a59654..d33cbb9 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++) {




More information about the Bf-blender-cvs mailing list