mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-21 09:39:56 +00:00
Start new game with specified seed in options
This commit is contained in:
parent
151770ccf1
commit
0611a8c3a7
@ -112,6 +112,9 @@ namespace MWBase
|
||||
|
||||
virtual ~World() {}
|
||||
|
||||
virtual void setRandomSeed(uint32_t seed) = 0;
|
||||
///< \param seed The seed used when starting a new game.
|
||||
|
||||
virtual void startNewGame (bool bypass) = 0;
|
||||
///< \param bypass Bypass regular game start.
|
||||
|
||||
|
@ -283,6 +283,9 @@ namespace MWWorld
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->updatePlayer();
|
||||
mCurrentDate->setup(mGlobalVariables);
|
||||
|
||||
// Initial seed.
|
||||
mPrng.seed(mRandomSeed);
|
||||
}
|
||||
|
||||
void World::clear()
|
||||
@ -557,7 +560,12 @@ namespace MWWorld
|
||||
mProjectileManager->clear();
|
||||
}
|
||||
|
||||
const ESM::Cell *World::getExterior (const std::string& cellName) const
|
||||
void World::setRandomSeed(uint32_t seed)
|
||||
{
|
||||
mRandomSeed = seed;
|
||||
}
|
||||
|
||||
const ESM::Cell* World::getExterior(const std::string& cellName) const
|
||||
{
|
||||
// first try named cells
|
||||
const ESM::Cell *cell = mStore.get<ESM::Cell>().searchExtByName (cellName);
|
||||
|
@ -130,6 +130,8 @@ namespace MWWorld
|
||||
std::map<MWWorld::Ptr, MWWorld::DoorState> mDoorStates;
|
||||
///< only holds doors that are currently moving. 1 = opening, 2 = closing
|
||||
|
||||
uint32_t mRandomSeed{};
|
||||
|
||||
// not implemented
|
||||
World (const World&);
|
||||
World& operator= (const World&);
|
||||
@ -194,6 +196,8 @@ namespace MWWorld
|
||||
|
||||
virtual ~World();
|
||||
|
||||
void setRandomSeed(uint32_t seed) override;
|
||||
|
||||
void startNewGame (bool bypass) override;
|
||||
///< \param bypass Bypass regular game start.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user