Core/Spells: Fixed fishing broken in a recent commit
This commit is contained in:
1 parent
cd24f8521c
commit
f8d9a8d2e9
2 files changed
+21
-18
No files matched your search
@@ -1414,7 +1414,26 @@ void Spell::SelectImplicitCasterDestTargets(SpellEffIndex effIndex, SpellImplici
|
||||
float x, y, z, angle;
|
||||
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, dis, angle);
|
||||
m_targets.SetDst(x, y, z, m_caster->GetOrientation());
|
||||
|
||||
float ground = z;
|
||||
float liquidLevel = m_caster->GetMap()->GetWaterOrGroundLevel(x, y, z, &ground);
|
||||
if (liquidLevel <= ground) // When there is no liquid Map::GetWaterOrGroundLevel returns ground level
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_NOT_HERE);
|
||||
SendChannelUpdate(0);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ground + 0.75 > liquidLevel)
|
||||
{
|
||||
SendCastResult(SPELL_FAILED_TOO_SHALLOW);
|
||||
SendChannelUpdate(0);
|
||||
finish(false);
|
||||
return;
|
||||
}
|
||||
|
||||
m_targets.SetDst(x, y, liquidLevel, m_caster->GetOrientation());
|
||||
return;
|
||||
}
|
||||
default:
|
||||
|
||||
Reference in new issue
Block a user