aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiscover- <amort11@hotmail.com>2014-05-12 06:34:52 +0200
committerDiscover- <amort11@hotmail.com>2014-05-12 06:34:52 +0200
commitda50b92cdf86d7ded9f804e83f9b33e52c6ebb94 (patch)
treee1e11405b1c1eff27664a2024c97313aabf5fcb1
parent668ed58847ae25864c9f6c2e4fcd7144400faf83 (diff)
parent11f6eb91c0f1343ccfea11c6dc7e8d346bb04ce1 (diff)
Merge pull request #12050 from Trisjdc/u_liek_fish_questionmark
Core/Spells: Fix fishing on areas with liquid data but no valid height
-rw-r--r--src/server/game/Spells/Spell.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 7c6f2552b44..b36d857881d 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -1251,8 +1251,12 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
float angle = float(rand_norm()) * static_cast<float>(M_PI * 35.0f / 180.0f) - static_cast<float>(M_PI * 17.5f / 180.0f);
m_caster->GetClosePoint(x, y, z, DEFAULT_WORLD_OBJECT_SIZE, dist, angle);
- float ground = z;
- float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
+ float ground = m_caster->GetMap()->GetHeight(m_caster->GetPhaseMask(), x, y, z, true, 50.0f);
+ float liquidLevel = VMAP_INVALID_HEIGHT_VALUE;
+ LiquidData liquidData;
+ if (m_caster->GetMap()->getLiquidStatus(x, y, z, MAP_ALL_LIQUIDS, &liquidData))
+ liquidLevel = liquidData.level;
+
if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
{
SendCastResult(SPELL_FAILED_NOT_HERE);