Fix crash for terrain without data, part 2

celladd
scrawl 10 years ago
parent 960e99c4f3
commit 2f2a95f735

@ -199,7 +199,7 @@ namespace MWWorld
(*iter)->getCell()->getGridX(), (*iter)->getCell()->getGridX(),
(*iter)->getCell()->getGridY() (*iter)->getCell()->getGridY()
); );
if (land) if (land && land->mDataTypes&ESM::Land::DATA_VHGT)
mPhysics->removeHeightField ((*iter)->getCell()->getGridX(), (*iter)->getCell()->getGridY()); mPhysics->removeHeightField ((*iter)->getCell()->getGridX(), (*iter)->getCell()->getGridY());
} }

@ -414,13 +414,17 @@ namespace Physic
+ boost::lexical_cast<std::string>(x) + "_" + boost::lexical_cast<std::string>(x) + "_"
+ boost::lexical_cast<std::string>(y); + boost::lexical_cast<std::string>(y);
HeightField hf = mHeightFieldMap [name]; HeightFieldContainer::iterator it = mHeightFieldMap.find(name);
if (it == mHeightFieldMap.end())
return;
const HeightField& hf = it->second;
mDynamicsWorld->removeRigidBody(hf.mBody); mDynamicsWorld->removeRigidBody(hf.mBody);
delete hf.mShape; delete hf.mShape;
delete hf.mBody; delete hf.mBody;
mHeightFieldMap.erase(name); mHeightFieldMap.erase(it);
} }
void PhysicEngine::adjustRigidBody(RigidBody* body, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation, void PhysicEngine::adjustRigidBody(RigidBody* body, const Ogre::Vector3 &position, const Ogre::Quaternion &rotation,

Loading…
Cancel
Save