From 358cac2f0a048a38938cec12eb139ab37670e508 Mon Sep 17 00:00:00 2001 From: cc9cii Date: Mon, 3 Nov 2014 10:03:54 +1100 Subject: [PATCH] Fix deleting object physics again. --- apps/opencs/view/world/physicssystem.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/opencs/view/world/physicssystem.cpp b/apps/opencs/view/world/physicssystem.cpp index 57a35168b6..fc75d8d2c0 100644 --- a/apps/opencs/view/world/physicssystem.cpp +++ b/apps/opencs/view/world/physicssystem.cpp @@ -39,7 +39,7 @@ namespace CSVWorld Ogre::SceneManager *sceneManager = findSceneManager(sceneNodeName); if(sceneManager) { - // update maps + // update maps (NOTE: sometimes replaced) mSceneNodeToRefId[sceneNodeName] = referenceId; mSceneNodeToMesh[sceneNodeName] = mesh; mRefIdToSceneNode[referenceId][sceneManager] = sceneNodeName; @@ -127,11 +127,8 @@ namespace CSVWorld if(referenceId != "") { - if(mRefIdToSceneNode.find(referenceId) == mRefIdToSceneNode.end()) - { - mEngine->removeRigidBody(referenceId); - mEngine->deleteRigidBody(referenceId); - } + mEngine->removeRigidBody(referenceId); + mEngine->deleteRigidBody(referenceId); } }