From 59152a9d7740d49c4abb0d652ee3891f0f72d7e6 Mon Sep 17 00:00:00 2001 From: Paul Coene Date: Sun, 17 Sep 2017 12:11:02 -0400 Subject: [PATCH] Fix some constants. --- zone/command.cpp | 2 +- zone/fearpath.cpp | 2 +- zone/mob.cpp | 8 ++++---- zone/waypoints.cpp | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 829588ca7..15b09b9dc 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -7257,7 +7257,7 @@ void command_bestz(Client *c, const Seperator *sep) { float best_z = zone->zonemap->FindBestZ(me, &hit); - if (best_z != -999999) + if (best_z != BEST_Z_INVALID) { c->Message(0, "Z is %.3f at (%.3f, %.3f).", best_z, me.x, me.y); } diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index c2ce95fbe..6f3580406 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -163,7 +163,7 @@ void Mob::CalculateNewFearpoint() ranx = GetX()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); rany = GetY()+zone->random.Int(0, ran-1)-zone->random.Int(0, ran-1); ranz = FindGroundZ(ranx,rany); - if (ranz == -999999) + if (ranz == BEST_Z_INVALID) continue; float fdist = ranz - GetZ(); if (fdist >= -12 && fdist <= 12 && CheckCoordLosNoZLeaps(GetX(),GetY(),GetZ(),ranx,rany,ranz)) diff --git a/zone/mob.cpp b/zone/mob.cpp index 342626078..0bb043bc5 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3441,7 +3441,7 @@ void Mob::SetTarget(Mob* mob) { float Mob::FindGroundZ(float new_x, float new_y, float z_offset) { - float ret = -999999; + float ret = BEST_Z_INVALID; if (zone->zonemap != nullptr) { glm::vec3 me; @@ -3450,7 +3450,7 @@ float Mob::FindGroundZ(float new_x, float new_y, float z_offset) me.z = m_Position.z + z_offset; glm::vec3 hit; float best_z = zone->zonemap->FindBestZ(me, &hit); - if (best_z != -999999) + if (best_z != BEST_Z_INVALID) { ret = best_z; } @@ -3461,7 +3461,7 @@ float Mob::FindGroundZ(float new_x, float new_y, float z_offset) // Copy of above function that isn't protected to be exported to Perl::Mob float Mob::GetGroundZ(float new_x, float new_y, float z_offset) { - float ret = -999999; + float ret = BEST_Z_INVALID; if (zone->zonemap != 0) { glm::vec3 me; @@ -3470,7 +3470,7 @@ float Mob::GetGroundZ(float new_x, float new_y, float z_offset) me.z = m_Position.z+z_offset; glm::vec3 hit; float best_z = zone->zonemap->FindBestZ(me, &hit); - if (best_z != -999999) + if (best_z != BEST_Z_INVALID) { ret = best_z; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 9ed7c46f9..ca0d24175 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -867,7 +867,7 @@ void Mob::FixZ(int32 z_find_offset /*= 5*/) duration ); - if ((new_z > -2000) && new_z != -999999) { + if ((new_z > -2000) && new_z != BEST_Z_INVALID) { if (RuleB(Map, MobZVisualDebug)) this->SendAppearanceEffect(78, 0, 0, 0, 0);