diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index bf349b787..6e22aae29 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1349,9 +1349,8 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) case TARGET_RANDOM_CIRCUMFERENCE_POINT: { float angle = 2.0 * M_PI * rand_norm(); - float dest_x = m_caster->GetPositionX() + cos(angle) * radius; - float dest_y = m_caster->GetPositionY() + sin(angle) * radius; - float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT); + float dest_x, dest_y, dest_z; + m_caster->GetClosePoint(dest_x, dest_y, dest_z, 0.0f, radius, angle); m_targets.setDestination(dest_x, dest_y, dest_z); TagUnitMap.push_back(m_caster); @@ -1361,9 +1360,8 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) { radius *= sqrt(rand_norm()); // Get a random point in circle. Use sqrt(rand) to correct distribution when converting polar to Cartesian coordinates. float angle = 2.0 * M_PI * rand_norm(); - float dest_x = m_targets.m_destX + cos(angle) * radius; - float dest_y = m_targets.m_destY + sin(angle) * radius; - float dest_z = m_caster->GetMap()->GetHeight(dest_x, dest_y, MAX_HEIGHT); + float dest_x, dest_y, dest_z; + m_caster->GetClosePoint(dest_x, dest_y, dest_z, 0.0f, radius, angle); m_targets.setDestination(dest_x, dest_y, dest_z); if (radius > 0.0f) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 17c2cc5b6..df06779aa 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8567" + #define REVISION_NR "8568" #endif // __REVISION_NR_H__