BestZ will now adjust for model size when used to adjust movement z

This commit is contained in:
KimLS
2014-09-08 16:45:20 -07:00
parent 579294fbf0
commit 7f7f99cbe3
2 changed files with 6 additions and 4 deletions
+6
View File
@@ -568,6 +568,8 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
Map::Vertex dest(x_pos, y_pos, z_pos);
float newz = zone->zonemap->FindBestZ(dest, nullptr);
float sz = GetSize();
newz += sz >= 0.0f ? sz / 2.0f : 0.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
@@ -697,6 +699,8 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b
Map::Vertex dest(x_pos, y_pos, z_pos);
float newz = zone->zonemap->FindBestZ(dest, nullptr);
float sz = GetSize();
newz += sz >= 0.0f ? sz / 2.0f : 0.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);
@@ -822,6 +826,8 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec
Map::Vertex dest(x_pos, y_pos, z_pos);
float newz = zone->zonemap->FindBestZ(dest, nullptr);
float sz = GetSize();
newz += sz >= 0.0f ? sz / 2.0f : 0.0f;
mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos);