From 8c40a4854434da8225b4b3b7a1f5e02d60aa117f Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Fri, 28 Jan 2011 18:59:41 +0100 Subject: [PATCH] [11076] Override radius for TARGET_DYNAMIC_OBJECT_* (47-50) When effect radius index is 0, spell max range is useless and we need to handle these as 0.0 radius. This will fix summoning spells where object is summoned too far away from the expected. Signed-off-by: NoFantasy --- src/game/Spell.cpp | 8 ++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 51002a4f8e1..0a7f4327766 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2433,6 +2433,14 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList& { if (!(m_targets.m_targetMask & TARGET_FLAG_DEST_LOCATION)) { + // General override, we don't want to use max spell range here. + // Note: 0.0 radius is also for index 36. It is possible that 36 must be defined as + // "at the base of", in difference to 0 which appear to be "directly in front of". + // TODO: some summoned will make caster be half inside summoned object. Need to fix + // that in the below code (nearpoint vs closepoint, etc). + if (m_spellInfo->EffectRadiusIndex[effIndex] == 0) + radius = 0.0f; + if (m_spellInfo->Id == 50019) // Hawk Hunting, problematic 50K radius radius = 10.0f; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b2f357b4feb..b0d7e4e7f37 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 "11075" + #define REVISION_NR "11076" #endif // __REVISION_NR_H__