Start new game with specified seed in options

pull/3226/head
ζeh Matt 3 years ago
parent 151770ccf1
commit 0611a8c3a7
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0

@ -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…
Cancel
Save