mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-29 00:41:38 +02:00
Added serializer-based class able to make deep copies of objects — CMemorySerializer.
CGameState::init will work on the deep copy of StartInfo. Some casts to reduce warnings.
This commit is contained in:
@ -763,8 +763,8 @@ void CGameState::init(StartInfo * si)
|
||||
{
|
||||
logGlobal->infoStream() << "\tUsing random seed: "<< si->seedToBeUsed;
|
||||
ran.seed((boost::int32_t)si->seedToBeUsed);
|
||||
scenarioOps = new StartInfo(*si);
|
||||
initialOpts = new StartInfo(*si);
|
||||
scenarioOps = CMemorySerializer::deepCopy(*si).release();
|
||||
initialOpts = CMemorySerializer::deepCopy(*si).release();
|
||||
si = nullptr;
|
||||
|
||||
switch(scenarioOps->mode)
|
||||
|
Reference in New Issue
Block a user