From f591211538803d59cf5d255d77b2469e295e655d Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 9 Oct 2009 13:06:08 +0400 Subject: [PATCH] [8606] Restore seelction point around dest coordinates for TARGET_RANDOM_NEARBY_DEST Thanks to qsa for pointing to problem. --- src/game/Spell.cpp | 6 ++++-- src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8a68ea7ff..435f7d205 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1371,8 +1371,10 @@ 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, dest_y, dest_z; - m_caster->GetClosePoint(dest_x, dest_y, dest_z, 0.0f, radius, angle); + 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->GetPositionZ(); + m_caster->UpdateGroundPositionZ(dest_x, dest_y, dest_z); 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 44f845580..58e972144 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 "8605" + #define REVISION_NR "8606" #endif // __REVISION_NR_H__