mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/Spells: Fix fishing on areas with liquid data but no valid height
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user