mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Merge remote-tracking branch 'glorf/bugfix-4'
This commit is contained in:
commit
bab899513a
6 changed files with 20 additions and 8 deletions
|
@ -368,7 +368,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mMaster, mPlugins,
|
||||
mResDir, mCfgMgr.getCachePath(), mNewGame, mEncoder, mFallbackMap,
|
||||
mActivationDistanceOverride));
|
||||
MWBase::Environment::get().getWorld()->setupPlayer(mNewGame);
|
||||
MWBase::Environment::get().getWorld()->setupPlayer();
|
||||
|
||||
//Load translation data
|
||||
mTranslationDataStorage.setEncoder(mEncoder);
|
||||
|
|
|
@ -323,7 +323,7 @@ namespace MWBase
|
|||
virtual void changeVanityModeScale(float factor) = 0;
|
||||
virtual bool vanityRotateCamera(float * rot) = 0;
|
||||
|
||||
virtual void setupPlayer(bool newGame) = 0;
|
||||
virtual void setupPlayer() = 0;
|
||||
virtual void renderPlayer() = 0;
|
||||
|
||||
virtual void activateDoor(const MWWorld::Ptr& door) = 0;
|
||||
|
|
|
@ -1110,6 +1110,13 @@ namespace MWGui
|
|||
{
|
||||
mLoadingScreen->loadingDone ();
|
||||
}
|
||||
bool WindowManager::getRestEnabled()
|
||||
{
|
||||
//Enable rest dialogue if character creation finished
|
||||
if(mRestAllowed==false && MWBase::Environment::get().getWorld()->getGlobalVariable ("chargenstate").mFloat==-1)
|
||||
mRestAllowed=true;
|
||||
return mRestAllowed;
|
||||
}
|
||||
|
||||
bool WindowManager::getPlayerSleeping ()
|
||||
{
|
||||
|
|
|
@ -220,7 +220,7 @@ namespace MWGui
|
|||
virtual void loadingDone();
|
||||
|
||||
virtual void enableRest() { mRestAllowed = true; }
|
||||
virtual bool getRestEnabled() { return mRestAllowed; }
|
||||
virtual bool getRestEnabled();
|
||||
|
||||
virtual bool getPlayerSleeping();
|
||||
virtual void wakeUpPlayer();
|
||||
|
|
|
@ -163,7 +163,8 @@ namespace MWWorld
|
|||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap, int mActivationDistanceOverride)
|
||||
: mPlayer (0), mLocalScripts (mStore), mGlobalVariables (0),
|
||||
mSky (true), mCells (mStore, mEsm),
|
||||
mNumFacing(0), mActivationDistanceOverride (mActivationDistanceOverride),mFallback(fallbackMap)
|
||||
mNumFacing(0), mActivationDistanceOverride (mActivationDistanceOverride),
|
||||
mFallback(fallbackMap), mNewGame(newGame)
|
||||
{
|
||||
mPhysics = new PhysicsSystem(renderer);
|
||||
mPhysEngine = mPhysics->getEngine();
|
||||
|
@ -214,7 +215,7 @@ namespace MWWorld
|
|||
// global variables
|
||||
mGlobalVariables = new Globals (mStore);
|
||||
|
||||
if (newGame)
|
||||
if (mNewGame)
|
||||
{
|
||||
// set new game mark
|
||||
mGlobalVariables->setInt ("chargenstate", 1);
|
||||
|
@ -1474,12 +1475,12 @@ namespace MWWorld
|
|||
return mRendering->vanityRotateCamera(rot);
|
||||
}
|
||||
|
||||
void World::setupPlayer(bool newGame)
|
||||
void World::setupPlayer()
|
||||
{
|
||||
const ESM::NPC* player = mStore.get<ESM::NPC>().find ("player");
|
||||
mPlayer = new MWWorld::Player (player, *this);
|
||||
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()).getInventoryStore(mPlayer->getPlayer()).autoEquip (mPlayer->getPlayer());
|
||||
|
@ -1490,6 +1491,8 @@ namespace MWWorld
|
|||
{
|
||||
mRendering->renderPlayer(mPlayer->getPlayer());
|
||||
mPhysics->addActor(mPlayer->getPlayer());
|
||||
if (mNewGame)
|
||||
toggleCollisionMode();
|
||||
}
|
||||
|
||||
void World::setupExternalRendering (MWRender::ExternalRendering& rendering)
|
||||
|
|
|
@ -85,6 +85,8 @@ namespace MWWorld
|
|||
float mFaced2Distance;
|
||||
int mNumFacing;
|
||||
|
||||
bool mNewGame;
|
||||
|
||||
std::map<MWWorld::Ptr, int> mDoorStates;
|
||||
///< only holds doors that are currently moving. 0 means closing, 1 opening
|
||||
|
||||
|
@ -371,7 +373,7 @@ namespace MWWorld
|
|||
|
||||
virtual bool vanityRotateCamera(float * rot);
|
||||
|
||||
virtual void setupPlayer(bool newGame);
|
||||
virtual void setupPlayer();
|
||||
virtual void renderPlayer();
|
||||
|
||||
virtual void activateDoor(const MWWorld::Ptr& door);
|
||||
|
|
Loading…
Reference in a new issue