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
This commit is contained in:
Jorge Bernal 2015-07-06 15:40:09 +02:00
parent 266459c7da
commit 12583287e7
Notes: blender-bot 2023-02-14 08:55:36 +01:00
Referenced by issue #45341, Blender (game engine) crashes when an object(with any physics mode) collides with another object. read description for the details.
1 changed files with 4 additions and 0 deletions

View File

@ -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++) {