1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-14 02:33:51 +02:00

Fix crash on loading saves made in 1.4/1.5

This commit is contained in:
Ivan Savenko 2024-07-19 13:57:06 +00:00
parent dc27e8eccb
commit e0c6b6e3d0
2 changed files with 2 additions and 2 deletions

View File

@ -523,6 +523,7 @@ CGameHandler::CGameHandler(CVCMIServer * lobby)
, turnOrder(std::make_unique<TurnOrderProcessor>(this))
, queries(std::make_unique<QueriesProcessor>())
, playerMessages(std::make_unique<PlayerMessageProcessor>(this))
, randomNumberGenerator(std::make_unique<CRandomGenerator>())
, complainNoCreatures("No creatures to split")
, complainNotEnoughCreatures("Cannot split that stack, not enough creatures!")
, complainInvalidSlot("Invalid slot accessed!")
@ -552,7 +553,6 @@ void CGameHandler::reinitScripting()
void CGameHandler::init(StartInfo *si, Load::ProgressAccumulator & progressTracking)
{
randomNumberGenerator = std::make_unique<CRandomGenerator>();
int requestedSeed = settings["server"]["seed"].Integer();
if (requestedSeed != 0)
randomNumberGenerator->setSeed(requestedSeed);

View File

@ -238,7 +238,7 @@ public:
template <typename Handler> void serialize(Handler &h)
{
h & QID;
h & randomNumberGenerator;
h & *randomNumberGenerator;
h & *battles;
h & *heroPool;
h & *playerMessages;