diff --git a/zone/water_map_v2.cpp b/zone/water_map_v2.cpp index b08c9ca89..7c9f3bce3 100644 --- a/zone/water_map_v2.cpp +++ b/zone/water_map_v2.cpp @@ -6,11 +6,11 @@ WaterMapV2::WaterMapV2() { WaterMapV2::~WaterMapV2() { } -WaterRegionType WaterMapV2::ReturnRegionType(float y, float x, float z) const { +WaterRegionType WaterMapV2::ReturnRegionType(const xyz_location& location) const { size_t sz = regions.size(); for(size_t i = 0; i < sz; ++i) { auto const ®ion = regions[i]; - if (region.second.ContainsPoint(glm::vec3(x, y, z))) { + if (region.second.ContainsPoint(glm::vec3(location.m_X, location.m_Y, location.m_Z))) { return region.first; } } @@ -18,19 +18,21 @@ WaterRegionType WaterMapV2::ReturnRegionType(float y, float x, float z) const { } bool WaterMapV2::InWater(const xyz_location& location) const { - return ReturnRegionType(location.m_Y, location.m_X, location.m_Z) == RegionTypeWater; + return ReturnRegionType(location) == RegionTypeWater; } bool WaterMapV2::InVWater(float y, float x, float z) const { - return ReturnRegionType(y, x, z) == RegionTypeVWater; + auto location = xyz_location(x, y, z); + return ReturnRegionType(location) == RegionTypeVWater; } bool WaterMapV2::InLava(float y, float x, float z) const { - return ReturnRegionType(y, x, z) == RegionTypeLava; + auto location = xyz_location(x, y, z); + return ReturnRegionType(location) == RegionTypeLava; } bool WaterMapV2::InLiquid(float y, float x, float z) const { - auto location = xyz_location(y, x, z); + auto location = xyz_location(x, y, z); return InWater(location) || InLava(y, x, z); } diff --git a/zone/water_map_v2.h b/zone/water_map_v2.h index eef514af5..fea136957 100644 --- a/zone/water_map_v2.h +++ b/zone/water_map_v2.h @@ -12,7 +12,7 @@ public: WaterMapV2(); ~WaterMapV2(); - virtual WaterRegionType ReturnRegionType(float y, float x, float z) const; + virtual WaterRegionType ReturnRegionType(const xyz_location& location) const; virtual bool InWater(const xyz_location& location) const; virtual bool InVWater(float y, float x, float z) const; virtual bool InLava(float y, float x, float z) const;