From 6c8320a638b4b46b7cb11b61c4ec4f1def06ecd7 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 27 Oct 2014 12:09:20 +1100 Subject: [PATCH] More cleanup. --- apps/opencs/view/render/pagedworldspacewidget.cpp | 15 ++++++++++----- apps/opencs/view/world/physicssystem.hpp | 1 - 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/opencs/view/render/pagedworldspacewidget.cpp b/apps/opencs/view/render/pagedworldspacewidget.cpp index a84164dc8..b33c83342 100644 --- a/apps/opencs/view/render/pagedworldspacewidget.cpp +++ b/apps/opencs/view/render/pagedworldspacewidget.cpp @@ -297,7 +297,7 @@ void CSVRender::PagedWorldspaceWidget::mouseDoubleClickEvent (QMouseEvent *event // debug drawer. Hence only the first subview that creates the debug drawer // can view the debug lines. Will need to keep a map in OEngine if multiple // subviews are to be supported. - //CSVWorld::PhysicsSystem::instance()->setSceneManager(getSceneManager()); + CSVWorld::PhysicsSystem::instance()->setSceneManager(getSceneManager()); CSVWorld::PhysicsSystem::instance()->toggleDebugRendering(); flagAsModified(); } @@ -444,11 +444,16 @@ CSVRender::PagedWorldspaceWidget::~PagedWorldspaceWidget() for(;iter != mSelectedEntities.end(); ++iter) { removeHitPoint(getSceneManager(), iter->first); - Ogre::SceneNode *scene = getSceneManager()->getSceneNode(iter->first); - if(scene) + + if(getSceneManager()->hasSceneNode(iter->first)) { - scene->removeAndDestroyAllChildren(); - getSceneManager()->destroySceneNode(iter->first); + Ogre::SceneNode *scene = getSceneManager()->getSceneNode(iter->first); + + if(scene) + { + scene->removeAndDestroyAllChildren(); + getSceneManager()->destroySceneNode(iter->first); + } } } } diff --git a/apps/opencs/view/world/physicssystem.hpp b/apps/opencs/view/world/physicssystem.hpp index eb0028253..c19486d17 100644 --- a/apps/opencs/view/world/physicssystem.hpp +++ b/apps/opencs/view/world/physicssystem.hpp @@ -61,7 +61,6 @@ namespace CSVWorld private: - void initDebug(); void updateSelectionHighlight(std::string sceneNode, const Ogre::Vector3 &position); }; }