mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Tweak
This commit is contained in:
parent
53fbf88316
commit
dcb0e8a0c1
@ -5307,9 +5307,8 @@ void CGameHandler::handleAfterAttackCasting( const BattleAttack & bat )
|
||||
vstd::amin(chanceToKill, 1); //cap at 100%
|
||||
|
||||
std::binomial_distribution<> distribution(attacker->count, chanceToKill);
|
||||
std::mt19937 rng(std::time(nullptr));
|
||||
|
||||
int staredCreatures = distribution(rng);
|
||||
int staredCreatures = distribution(getRandomGenerator().getStdGenerator());
|
||||
|
||||
double cap = 1 / std::max(chanceToKill, (double)(0.01));//don't divide by 0
|
||||
int maxToKill = (attacker->count + cap - 1) / cap; //not much more than chance * count
|
||||
|
Loading…
Reference in New Issue
Block a user