Jump to content

[10539] Fix in SetTargetMap


Guest BugFix

Recommended Posts

* What bug does the patch fix? What features does the patch add?

If caster of Spells like Rain of Bones(37098) is above the target, z-coordinates are taken from caster but x and y from target. So we get a strage effect.

* For which repository revision was the patch created?

0.12 rev 8569

* Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

Dont know

* Who has been writing this patch? Please include either forum user names or email addresses.

me

The fix changes Z coords of TargetMap for TARGET_RANDOM_NEARBY_DEST.

diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index bd4ca17..0b37d25 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -1311,7 +1348,7 @@ void Spell::SetTargetMap(SpellEffectIndex effIndex, uint32 targetMode, UnitList&
            float angle = 2.0f * M_PI_F * rand_norm_f();
            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();
+            float dest_z = m_targets.m_destZ;
            m_caster->UpdateGroundPositionZ(dest_x, dest_y, dest_z);
            m_targets.setDestination(dest_x, dest_y, dest_z);

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use