Browse Source

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

Emagi 1 year ago
parent
commit
31e13d5c58
1 changed files with 2 additions and 2 deletions
  1. 2 2
      EQ2/source/WorldServer/Spawn.cpp

+ 2 - 2
EQ2/source/WorldServer/Spawn.cpp

@@ -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());