mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 12:53:51 +00:00
Enabled collision when new game
This commit is contained in:
parent
6222b3f52a
commit
74de8b83b6
4 changed files with 12 additions and 7 deletions
|
@ -368,7 +368,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
||||||
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mMaster, mPlugins,
|
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mMaster, mPlugins,
|
||||||
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,
|
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,
|
||||||
mActivationDistanceOverride));
|
mActivationDistanceOverride));
|
||||||
MWBase::Environment::get().getWorld()->setupPlayer(mNewGame);
|
MWBase::Environment::get().getWorld()->setupPlayer();
|
||||||
|
|
||||||
//Load translation data
|
//Load translation data
|
||||||
mTranslationDataStorage.setEncoder(mEncoder);
|
mTranslationDataStorage.setEncoder(mEncoder);
|
||||||
|
|
|
@ -323,7 +323,7 @@ namespace MWBase
|
||||||
virtual void changeVanityModeScale(float factor) = 0;
|
virtual void changeVanityModeScale(float factor) = 0;
|
||||||
virtual bool vanityRotateCamera(float * rot) = 0;
|
virtual bool vanityRotateCamera(float * rot) = 0;
|
||||||
|
|
||||||
virtual void setupPlayer(bool newGame) = 0;
|
virtual void setupPlayer() = 0;
|
||||||
virtual void renderPlayer() = 0;
|
virtual void renderPlayer() = 0;
|
||||||
|
|
||||||
virtual void activateDoor(const MWWorld::Ptr& door) = 0;
|
virtual void activateDoor(const MWWorld::Ptr& door) = 0;
|
||||||
|
|
|
@ -163,7 +163,8 @@ namespace MWWorld
|
||||||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap, int mActivationDistanceOverride)
|
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap, int mActivationDistanceOverride)
|
||||||
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
||||||
mSky (true), mCells (mStore, mEsm),
|
mSky (true), mCells (mStore, mEsm),
|
||||||
mNumFacing(0), mActivationDistanceOverride (mActivationDistanceOverride),mFallback(fallbackMap)
|
mNumFacing(0), mActivationDistanceOverride (mActivationDistanceOverride),
|
||||||
|
mFallback(fallbackMap), mNewGame(newGame)
|
||||||
{
|
{
|
||||||
mPhysics = new PhysicsSystem(renderer);
|
mPhysics = new PhysicsSystem(renderer);
|
||||||
mPhysEngine = mPhysics->getEngine();
|
mPhysEngine = mPhysics->getEngine();
|
||||||
|
@ -214,7 +215,7 @@ namespace MWWorld
|
||||||
// global variables
|
// global variables
|
||||||
mGlobalVariables = new Globals (mStore);
|
mGlobalVariables = new Globals (mStore);
|
||||||
|
|
||||||
if (newGame)
|
if (mNewGame)
|
||||||
{
|
{
|
||||||
// set new game mark
|
// set new game mark
|
||||||
mGlobalVariables->setInt ("chargenstate", 1);
|
mGlobalVariables->setInt ("chargenstate", 1);
|
||||||
|
@ -1465,12 +1466,12 @@ namespace MWWorld
|
||||||
return mRendering->vanityRotateCamera(rot);
|
return mRendering->vanityRotateCamera(rot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::setupPlayer(bool newGame)
|
void World::setupPlayer()
|
||||||
{
|
{
|
||||||
const ESM::NPC* player = mStore.get<ESM::NPC>().find ("player");
|
const ESM::NPC* player = mStore.get<ESM::NPC>().find ("player");
|
||||||
mPlayer = new MWWorld::Player (player, *this);
|
mPlayer = new MWWorld::Player (player, *this);
|
||||||
mRendering->attachCameraTo(mPlayer->getPlayer());
|
mRendering->attachCameraTo(mPlayer->getPlayer());
|
||||||
if (newGame)
|
if (mNewGame)
|
||||||
{
|
{
|
||||||
MWWorld::Class::get(mPlayer->getPlayer()).getContainerStore(mPlayer->getPlayer()).fill(player->mInventory, "", mStore);
|
MWWorld::Class::get(mPlayer->getPlayer()).getContainerStore(mPlayer->getPlayer()).fill(player->mInventory, "", mStore);
|
||||||
MWWorld::Class::get(mPlayer->getPlayer()).getInventoryStore(mPlayer->getPlayer()).autoEquip (mPlayer->getPlayer());
|
MWWorld::Class::get(mPlayer->getPlayer()).getInventoryStore(mPlayer->getPlayer()).autoEquip (mPlayer->getPlayer());
|
||||||
|
@ -1481,6 +1482,8 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
mRendering->renderPlayer(mPlayer->getPlayer());
|
mRendering->renderPlayer(mPlayer->getPlayer());
|
||||||
mPhysics->addActor(mPlayer->getPlayer());
|
mPhysics->addActor(mPlayer->getPlayer());
|
||||||
|
if (mNewGame)
|
||||||
|
toggleCollisionMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
void World::setupExternalRendering (MWRender::ExternalRendering& rendering)
|
void World::setupExternalRendering (MWRender::ExternalRendering& rendering)
|
||||||
|
|
|
@ -85,6 +85,8 @@ namespace MWWorld
|
||||||
float mFaced2Distance;
|
float mFaced2Distance;
|
||||||
int mNumFacing;
|
int mNumFacing;
|
||||||
|
|
||||||
|
bool mNewGame;
|
||||||
|
|
||||||
std::map<MWWorld::Ptr, int> mDoorStates;
|
std::map<MWWorld::Ptr, int> mDoorStates;
|
||||||
///< only holds doors that are currently moving. 0 means closing, 1 opening
|
///< only holds doors that are currently moving. 0 means closing, 1 opening
|
||||||
|
|
||||||
|
@ -371,7 +373,7 @@ namespace MWWorld
|
||||||
|
|
||||||
virtual bool vanityRotateCamera(float * rot);
|
virtual bool vanityRotateCamera(float * rot);
|
||||||
|
|
||||||
virtual void setupPlayer(bool newGame);
|
virtual void setupPlayer();
|
||||||
virtual void renderPlayer();
|
virtual void renderPlayer();
|
||||||
|
|
||||||
virtual void activateDoor(const MWWorld::Ptr& door);
|
virtual void activateDoor(const MWWorld::Ptr& door);
|
||||||
|
|
Loading…
Reference in a new issue