1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

- several changes to get reusable code

- possibly fixed #725
- bug in random seed initializing?
This commit is contained in:
Ivan Savenko
2011-04-30 18:16:58 +00:00
parent ec76876bda
commit e494171de3
9 changed files with 131 additions and 52 deletions

View File

@@ -4270,7 +4270,7 @@ void CGameHandler::handleAfterAttackCasting( const BattleAttack & bat )
{
boost::poisson_distribution<int, double> p((int)mean);
boost::mt19937 rng;
boost::variate_generator<boost::mt19937&, boost::poisson_distribution<int, double>> dice (rng, p);
boost::variate_generator<boost::mt19937&, boost::poisson_distribution<int, double> > dice (rng, p);
staredCreatures += dice();
}
if (((int)(mean * 100)) < rand() % 100) //fractional chance for one last kill