From 84c08e6ed971f6903f1231c1593c709e47c01aba Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 7 May 2024 00:24:49 -0500 Subject: [PATCH] work around collide not returning false with a nul object fix a crash caused by having boundingBoxCollision on, while projecting the mouse so that there is nothing between it and a globalbounds object it would seem we're somehow ending up in a state of WorldEditor::collide returning true it hit somethging, but NULL as far as *what* until we properly fix this, doublecheck to make sure the hitObject isn't NULL before we start trying to reference membervars/methods --- Engine/source/gui/worldEditor/worldEditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index 888c629f4..b6effcf93 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -1999,7 +1999,7 @@ void WorldEditor::on3DMouseMove(const Gui3DMouseEvent & event) if ( !mHitObject ) { SceneObject *hitObj = NULL; - if ( collide(event, &hitObj) && !hitObj->isDeleted() && hitObj->isSelectionEnabled() && !objClassIgnored(hitObj) ) + if ( collide(event, &hitObj) && hitObj && !hitObj->isDeleted() && hitObj->isSelectionEnabled() && !objClassIgnored(hitObj) ) { mHitObject = hitObj; } @@ -2060,7 +2060,7 @@ void WorldEditor::on3DMouseDown(const Gui3DMouseEvent & event) } SceneObject *hitObj = NULL; - if ( collide( event, &hitObj ) && hitObj->isSelectionEnabled() && !objClassIgnored( hitObj ) ) + if ( collide( event, &hitObj ) && hitObj && hitObj->isSelectionEnabled() && !objClassIgnored( hitObj ) ) { mPossibleHitObject = hitObj; mNoMouseDrag = true;