mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-29 22:20:33 +00:00
Run startup script once at engine start when game is running (bug #4877)
This commit is contained in:
parent
3ce261ddd4
commit
619a111a11
@ -35,6 +35,7 @@
|
||||
Bug #4837: CTD when a mesh with NiLODNode root node with particles is loaded
|
||||
Bug #4860: Actors outside of processing range visible for one frame after spawning
|
||||
Bug #4876: AI ratings handling inconsistencies
|
||||
Bug #4877: Startup script executes only on a new game start
|
||||
Bug #4888: Global variable stray explicit reference calls break script compilation
|
||||
Feature #2229: Improve pathfinding AI
|
||||
Feature #3442: Default values for fallbacks from ini file
|
||||
|
@ -546,7 +546,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
||||
// Create the world
|
||||
mEnvironment.setWorld( new MWWorld::World (mViewer, rootNode, mResourceSystem.get(), mWorkQueue.get(),
|
||||
mFileCollections, mContentFiles, mEncoder, mFallbackMap,
|
||||
mActivationDistanceOverride, mCellName, mStartupScript, mResDir.string(), mCfgMgr.getUserDataPath().string()));
|
||||
mActivationDistanceOverride, mCellName, mResDir.string(), mCfgMgr.getUserDataPath().string()));
|
||||
mEnvironment.getWorld()->setupPlayer();
|
||||
input->setPlayer(&mEnvironment.getWorld()->getPlayer());
|
||||
|
||||
@ -719,6 +719,11 @@ void OMW::Engine::go()
|
||||
mEnvironment.getStateManager()->newGame (!mNewGame);
|
||||
}
|
||||
|
||||
if (!mStartupScript.empty() && mEnvironment.getStateManager()->getState() == MWState::StateManager::State_Running)
|
||||
{
|
||||
mEnvironment.getWindowManager()->executeInConsole(mStartupScript);
|
||||
}
|
||||
|
||||
// Start the main rendering loop
|
||||
osg::Timer frameTimer;
|
||||
double simulationTime = 0.0;
|
||||
|
@ -157,12 +157,12 @@ namespace MWWorld
|
||||
const Files::Collections& fileCollections,
|
||||
const std::vector<std::string>& contentFiles,
|
||||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript,
|
||||
const std::string& resourcePath, const std::string& userDataPath)
|
||||
int activationDistanceOverride, const std::string& startCell,
|
||||
const std::string& resourcePath, const std::string& userDataPath)
|
||||
: mResourceSystem(resourceSystem), mFallback(fallbackMap), mLocalScripts (mStore),
|
||||
mSky (true), mCells (mStore, mEsm),
|
||||
mGodMode(false), mScriptsEnabled(true), mContentFiles (contentFiles), mUserDataPath(userDataPath),
|
||||
mActivationDistanceOverride (activationDistanceOverride), mStartupScript(startupScript),
|
||||
mActivationDistanceOverride (activationDistanceOverride),
|
||||
mStartCell (startCell), mDistanceToFacedObject(-1), mTeleportEnabled(true),
|
||||
mLevitationEnabled(true), mGoToJail(false), mDaysInPrison(0),
|
||||
mPlayerTraveling(false), mPlayerInJail(false), mSpellPreloadTimer(0.f)
|
||||
@ -307,9 +307,6 @@ namespace MWWorld
|
||||
if (!mPhysics->toggleCollisionMode())
|
||||
mPhysics->toggleCollisionMode();
|
||||
|
||||
if (!mStartupScript.empty())
|
||||
MWBase::Environment::get().getWindowManager()->executeInConsole(mStartupScript);
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->updatePlayer();
|
||||
}
|
||||
|
||||
|
@ -117,8 +117,6 @@ namespace MWWorld
|
||||
|
||||
int mActivationDistanceOverride;
|
||||
|
||||
std::string mStartupScript;
|
||||
|
||||
std::map<MWWorld::Ptr, int> mDoorStates;
|
||||
///< only holds doors that are currently moving. 1 = opening, 2 = closing
|
||||
|
||||
@ -198,7 +196,7 @@ namespace MWWorld
|
||||
const Files::Collections& fileCollections,
|
||||
const std::vector<std::string>& contentFiles,
|
||||
ToUTF8::Utf8Encoder* encoder, const std::map<std::string,std::string>& fallbackMap,
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& startupScript, const std::string& resourcePath, const std::string& userDataPath);
|
||||
int activationDistanceOverride, const std::string& startCell, const std::string& resourcePath, const std::string& userDataPath);
|
||||
|
||||
virtual ~World();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user