diff --git a/changelog.txt b/changelog.txt index 8d4485765..f59ae6a35 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ Kayen: Fixed SE_SpellProcChance - Now works on spell dervived procs cavedude: Added two new NPC special_abilities. ALWAYS_FLEE, which forces the NPC to always flee ignoring FleeIfNotAlone and FLEE_PERCENT which allows you to change the HP an individual NPC will flee at. If no value is set, the rule is used as normal. cavedude: Fixed an issue where rectangular roamboxes could cause an NPC to get stuck on a single coord. cavedude: Added a new roambox column, mindelay allowing you to have more control over the roambox delay. +Uleat: Fix for 'sqrt' failure on vs2010 clients Required SQL: utils/sql/git/required/2014_02_26_roambox_update.sql diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index bdc3bbc68..bd584ea6e 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -3419,13 +3419,11 @@ void Mob::DoBuffTic(uint16 spell_id, int slot, uint32 ticsremaining, uint8 caste { if (spellbonuses.DistanceRemoval){ - int distance = sqrt( - ((int(GetX()) - buffs[slot].caston_x) * (int(GetX()) - buffs[slot].caston_x)) + - ((int(GetY()) - buffs[slot].caston_y) * (int(GetY()) - buffs[slot].caston_y)) + - ((int(GetZ()) - buffs[slot].caston_z) * (int(GetZ()) - buffs[slot].caston_z)) - ); + int distance = ((int(GetX()) - buffs[slot].caston_x) * (int(GetX()) - buffs[slot].caston_x)) + + ((int(GetY()) - buffs[slot].caston_y) * (int(GetY()) - buffs[slot].caston_y)) + + ((int(GetZ()) - buffs[slot].caston_z) * (int(GetZ()) - buffs[slot].caston_z)); - if (distance > spells[spell_id].base[i]){ + if (distance > (spells[spell_id].base[i] * spells[spell_id].base[i])){ if(!TryFadeEffect(slot)) BuffFadeBySlot(slot , true);