Make better move point for follow and reach combat

This commit is contained in:
Yunfan Li
2024-08-03 11:52:02 +08:00
parent 78cdc11ba5
commit b0c0002206
3 changed files with 57 additions and 39 deletions

View File

@@ -48,8 +48,7 @@ WorldLocation ArrowFormation::GetLocationInternal()
float y = master->GetPositionY() - masterUnit->GetY() + botUnit->GetY();
float z = master->GetPositionZ();
float ground = master->GetMapHeight(x, y, z + 30.0f);
if (ground <= INVALID_HEIGHT)
if (!master->GetMap()->CheckCollisionAndGetValidCoords(master, master->GetPositionX(), master->GetPositionY(), master->GetPositionZ(), x, y, z))
return Formation::NullLocation;
// master->UpdateGroundPositionZ(x, y, z);
return WorldLocation(master->GetMapId(), x, y, z);