fix for random int -> float error

This commit is contained in:
KayenEQ 2014-07-08 08:04:56 -04:00
parent d22d0a8145
commit b27ff80c75

View File

@ -3983,9 +3983,9 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int dam
if (bDefensiveProc){
for (int i = 0; i < MAX_PROCS; i++) {
if (DefensiveProcs[i].spellID != SPELL_UNKNOWN) {
if (IsValidSpell(DefensiveProcs[i].spellID)) {
float chance = ProcChance * (static_cast<float>(DefensiveProcs[i].chance)/100.0f);
if ((MakeRandomInt(0, 1) <= chance)) {
if ((MakeRandomFloat(0, 1) <= chance)) {
ExecWeaponProc(nullptr, DefensiveProcs[i].spellID, on);
CheckNumHitsRemaining(NUMHIT_DefensiveSpellProcs,0,DefensiveProcs[i].base_spellID);
}