Skip to content

Commit

Permalink
[11076] Override radius for TARGET_DYNAMIC_OBJECT_* (47-50)
Browse files Browse the repository at this point in the history
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 <nofantasy@nf.no>
  • Loading branch information
NoFantasy committed Jan 28, 2011
1 parent 21ac171 commit 8c40a48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/game/Spell.cpp
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion 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__

0 comments on commit 8c40a48

Please sign in to comment.