Fix - ground mobs will swim in water instead of going to bottom surface

This commit is contained in:
Emagi 2022-11-16 11:22:21 -05:00
parent 465b23b1bc
commit 31e13d5c58

View file

@ -2770,7 +2770,7 @@ void Spawn::MoveToLocation(Spawn* spawn, float distance, bool immediate, bool ma
if (!IsPlayer() && distance > 0.0f)
{
if ((IsFlyingCreature() || IsWaterCreature()) && CheckLoS(spawn))
if ((IsFlyingCreature() || IsWaterCreature() || InWater()) && CheckLoS(spawn))
{
if (immediate)
ClearRunningLocations();
@ -3430,7 +3430,7 @@ void Spawn::CalculateRunningLocation(bool stop){
{
if (GetDistance(GetTarget()) > rule_manager.GetGlobalRule(R_Combat, MaxCombatRange)->GetFloat())
{
if ((IsFlyingCreature() || IsWaterCreature()) && CheckLoS(GetTarget()))
if ((IsFlyingCreature() || IsWaterCreature() || InWater()) && CheckLoS(GetTarget()))
AddRunningLocation(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetSpeed(), 0, false);
else
GetZone()->movementMgr->NavigateTo((Entity*)this, GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ());