1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Refactoring: only use RNGs explicitly to avoid bug prone code in future

Now server-side code should always use CRandomGenerator::getDefault which is serialized in GH.
CGameState::getRandomGenerator should be only used from GS code and CPackForClient-based applyGs.
This commit is contained in:
Arseniy Shestakov
2016-09-09 20:30:36 +03:00
parent 70abae9b51
commit c8faca8f39
28 changed files with 225 additions and 219 deletions

View File

@@ -66,7 +66,7 @@ void IObjectInterface::onHeroVisit(const CGHeroInstance * h) const
void IObjectInterface::onHeroLeave(const CGHeroInstance * h) const
{}
void IObjectInterface::newTurn () const
void IObjectInterface::newTurn(CRandomGenerator & rand) const
{}
IObjectInterface::~IObjectInterface()
@@ -75,7 +75,7 @@ IObjectInterface::~IObjectInterface()
IObjectInterface::IObjectInterface()
{}
void IObjectInterface::initObj()
void IObjectInterface::initObj(CRandomGenerator & rand)
{}
void IObjectInterface::setProperty( ui8 what, ui32 val )
@@ -207,7 +207,7 @@ void CGObjectInstance::setType(si32 ID, si32 subID)
cb->gameState()->map->addBlockVisTiles(this);
}
void CGObjectInstance::initObj()
void CGObjectInstance::initObj(CRandomGenerator & rand)
{
switch(ID)
{