diff --git a/apps/openmw/mwworld/world.cpp b/apps/openmw/mwworld/world.cpp index f655b6143..4439d4c66 100644 --- a/apps/openmw/mwworld/world.cpp +++ b/apps/openmw/mwworld/world.cpp @@ -148,7 +148,7 @@ namespace MWWorld const std::string& master, const boost::filesystem::path& resDir, bool newGame, Environment& environment, const std::string& encoding) : mRendering (renderer,resDir, physEng, environment),mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0), - mSky (false), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this) + mSky (false), bCollision(false), mEnvironment (environment), mNextDynamicRecord (0), mCells (mStore, mEsm, *this) { mPhysEngine = physEng; @@ -183,10 +183,15 @@ namespace MWWorld } void World::makeNewPlayer(){ + bool initialCollision = bCollision; + if(bCollision) + toggleCollisionMode(); MWRender::Player* play = &(mRendering.getPlayer()); delete mPlayer; mPlayer = new MWWorld::Player (play, mStore.npcs.find ("player"), *this); mPhysics->addActor (mPlayer->getPlayer().getRefData().getHandle(), "", Ogre::Vector3 (0, 0, 0)); + if(initialCollision) + toggleCollisionMode(); } World::~World() @@ -619,7 +624,8 @@ namespace MWWorld bool World::toggleCollisionMode() { - return mPhysics->toggleCollisionMode(); + bCollision = mPhysics->toggleCollisionMode(); + return bCollision; } bool World::toggleRenderMode (RenderMode mode) diff --git a/apps/openmw/mwworld/world.hpp b/apps/openmw/mwworld/world.hpp index 71231998a..eef2f8da3 100644 --- a/apps/openmw/mwworld/world.hpp +++ b/apps/openmw/mwworld/world.hpp @@ -77,6 +77,7 @@ namespace MWWorld bool mSky; Environment& mEnvironment; int mNextDynamicRecord; + bool bCollision; Cells mCells;