use std::abs in Map::FindClosestZ

This commit is contained in:
Michael Cook (mackal) 2016-08-13 15:58:02 -04:00
parent 3efc925264
commit f06a9b3dce

View File

@ -163,7 +163,7 @@ float Map::FindClosestZ(glm::vec3 &start, glm::vec3 *result) const {
to.z = -BEST_Z_INVALID;
hit = imp->rm->raycast((const RmReal*)&from, (const RmReal*)&to, (RmReal*)result, nullptr, &hit_distance);
if (hit) {
if (abs(from.z - result->z) < abs(ClosestZ - from.z))
if (std::abs(from.z - result->z) < std::abs(ClosestZ - from.z))
return result->z;
}