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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user