mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
ReturnRegionType converted to xyz_location
This commit is contained in:
parent
6cd614a05e
commit
ef18458480
@ -6,11 +6,11 @@ WaterMapV2::WaterMapV2() {
|
|||||||
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();
|
size_t sz = regions.size();
|
||||||
for(size_t i = 0; i < sz; ++i) {
|
for(size_t i = 0; i < sz; ++i) {
|
||||||
auto const ®ion = regions[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;
|
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 {
|
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 {
|
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 {
|
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 {
|
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);
|
return InWater(location) || InLava(y, x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@ public:
|
|||||||
WaterMapV2();
|
WaterMapV2();
|
||||||
~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 InWater(const xyz_location& location) const;
|
||||||
virtual bool InVWater(float y, float x, float z) const;
|
virtual bool InVWater(float y, float x, float z) const;
|
||||||
virtual bool InLava(float y, float x, float z) const;
|
virtual bool InLava(float y, float x, float z) const;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user