From 04adb9f2409df1f3520eceae7940e24882fb98e9 Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 21 May 2016 14:44:24 -0500 Subject: [PATCH] Added a small sanity check so we don't pointlessly throw an error when expanding an Entity's component stack in the scene tree. --- Engine/source/gui/controls/guiTreeViewCtrl.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index 1e3dfa712..b96418845 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -3795,16 +3795,19 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) //We check if our object is an entity, and if it is, we call a 'onInspect' function. //This function is pretty much a special notifier to the entity so if it has any behaviors that do special //stuff in the editor, it can fire that up - Entity* e = dynamic_cast(item->getObject()); - if (item->mScriptInfo.mText != StringTable->insert("Components")) + if (item->isInspectorData()) { Entity* e = dynamic_cast(item->getObject()); - if (e) + if (item->mScriptInfo.mText != StringTable->insert("Components")) { - if (item->isExpanded()) - e->onInspect(); - else - e->onEndInspect(); + Entity* e = dynamic_cast(item->getObject()); + if (e) + { + if (item->isExpanded()) + e->onInspect(); + else + e->onEndInspect(); + } } } #endif -- 2.11.4.GIT