mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-16 05:11:29 +00:00
fix for random int -> float error
This commit is contained in:
parent
d22d0a8145
commit
b27ff80c75
@ -3983,9 +3983,9 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand, int dam
|
|||||||
|
|
||||||
if (bDefensiveProc){
|
if (bDefensiveProc){
|
||||||
for (int i = 0; i < MAX_PROCS; i++) {
|
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);
|
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);
|
ExecWeaponProc(nullptr, DefensiveProcs[i].spellID, on);
|
||||||
CheckNumHitsRemaining(NUMHIT_DefensiveSpellProcs,0,DefensiveProcs[i].base_spellID);
|
CheckNumHitsRemaining(NUMHIT_DefensiveSpellProcs,0,DefensiveProcs[i].base_spellID);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user