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:
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.
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue