1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Integrating changes from PR #4251 - allow defining seed for server

This commit is contained in:
Ivan Savenko
2024-07-16 15:12:02 +00:00
parent c91f8cd511
commit 65eeceb7d7
2 changed files with 10 additions and 2 deletions

View File

@@ -24,6 +24,7 @@
#include "../lib/ArtifactUtils.h"
#include "../lib/CArtHandler.h"
#include "../lib/CBuildingHandler.h"
#include "../lib/CConfigHandler.h"
#include "../lib/CCreatureHandler.h"
#include "../lib/CCreatureSet.h"
#include "../lib/CGeneralTextHandler.h"
@@ -552,6 +553,9 @@ 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);
logGlobal->info("Using random seed: %d", randomNumberGenerator->nextInt());
CMapService mapService;