mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 14:45:37 +00:00
Moved mStartupScript to World, so that it is executed for a New game
This commit is contained in:
parent
9fe505c8fa
commit
b39b572c5a
3 changed files with 8 additions and 7 deletions
|
@ -380,7 +380,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
// Create the world
|
||||
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mContentFiles,
|
||||
mResDir, mCfgMgr.getCachePath(), mEncoder, mFallbackMap,
|
||||
mActivationDistanceOverride, mCellName));
|
||||
mActivationDistanceOverride, mCellName, mStartupScript));
|
||||
MWBase::Environment::get().getWorld()->setupPlayer();
|
||||
input->setPlayer(&mEnvironment.getWorld()->getPlayer());
|
||||
|
||||
|
@ -464,9 +464,6 @@ void OMW::Engine::go()
|
|||
else
|
||||
{
|
||||
MWBase::Environment::get().getStateManager()->newGame (true);
|
||||
|
||||
if (!mStartupScript.empty())
|
||||
MWBase::Environment::get().getWindowManager()->executeInConsole (mStartupScript);
|
||||
}
|
||||
|
||||
// Start the main rendering loop
|
||||
|
|
|
@ -126,14 +126,14 @@ namespace MWWorld
|
|||
const std::vector<std::string>& contentFiles,
|
||||
const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir,
|
||||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
||||
int activationDistanceOverride, const std::string& startCell)
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript)
|
||||
: mPlayer (0), mLocalScripts (mStore),
|
||||
mSky (true), mCells (mStore, mEsm),
|
||||
mActivationDistanceOverride (activationDistanceOverride),
|
||||
mFallback(fallbackMap), mTeleportEnabled(true), mLevitationEnabled(true),
|
||||
mFacedDistance(FLT_MAX), mGodMode(false), mContentFiles (contentFiles),
|
||||
mGoToJail(false),
|
||||
mStartCell (startCell)
|
||||
mStartCell (startCell), mStartupScript(startupScript)
|
||||
{
|
||||
mPhysics = new PhysicsSystem(renderer);
|
||||
mPhysEngine = mPhysics->getEngine();
|
||||
|
@ -241,6 +241,8 @@ namespace MWWorld
|
|||
delete mWeatherManager;
|
||||
mWeatherManager = 0;
|
||||
mWeatherManager = new MWWorld::WeatherManager(mRendering,&mFallback);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->executeInConsole(mStartupScript);
|
||||
}
|
||||
|
||||
void World::clear()
|
||||
|
|
|
@ -94,6 +94,8 @@ namespace MWWorld
|
|||
std::string mFacedHandle;
|
||||
float mFacedDistance;
|
||||
|
||||
std::string mStartupScript;
|
||||
|
||||
std::map<MWWorld::Ptr, int> mDoorStates;
|
||||
///< only holds doors that are currently moving. 1 = opening, 2 = closing
|
||||
|
||||
|
@ -151,7 +153,7 @@ namespace MWWorld
|
|||
const std::vector<std::string>& contentFiles,
|
||||
const boost::filesystem::path& resDir, const boost::filesystem::path& cacheDir,
|
||||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
||||
int activationDistanceOverride, const std::string& startCell);
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript);
|
||||
|
||||
virtual ~World();
|
||||
|
||||
|
|
Loading…
Reference in a new issue