Ask water map if we're in a zoneline to prevent false positives

I don't think this should open up any chance to exploit
Trying to use a ZL to go somewhere else is still detected etc

This should really cut down on false positives and we really can't
see real cheater from all the noise this creates
This commit is contained in:
Michael Cook (mackal) 2016-08-05 01:07:12 -04:00
parent 68df09a570
commit 6a7ea65dd0
6 changed files with 14 additions and 1 deletions

View File

@ -34,6 +34,7 @@ public:
virtual bool InLava(const glm::vec3& location) const = 0;
virtual bool InLiquid(const glm::vec3& location) const = 0;
virtual bool InPvP(const glm::vec3& location) const = 0;
virtual bool InZoneLine(const glm::vec3& location) const = 0;
protected:
virtual bool Load(FILE *fp) { return false; }

View File

@ -34,6 +34,10 @@ bool WaterMapV1::InPvP(const glm::vec3& location) const {
return ReturnRegionType(location) == RegionTypePVP;
}
bool WaterMapV1::InZoneLine(const glm::vec3& location) const {
return ReturnRegionType(location) == RegionTypeZoneLine;
}
bool WaterMapV1::Load(FILE *fp) {
uint32 bsp_tree_size;
if (fread(&bsp_tree_size, sizeof(bsp_tree_size), 1, fp) != 1) {

View File

@ -25,6 +25,7 @@ public:
virtual bool InLava(const glm::vec3& location) const;
virtual bool InLiquid(const glm::vec3& location) const;
virtual bool InPvP(const glm::vec3& location) const;
virtual bool InZoneLine(const glm::vec3& location) const;
protected:
virtual bool Load(FILE *fp);

View File

@ -37,6 +37,10 @@ bool WaterMapV2::InPvP(const glm::vec3& location) const {
return ReturnRegionType(location) == RegionTypePVP;
}
bool WaterMapV2::InZoneLine(const glm::vec3& location) const {
return ReturnRegionType(location) == RegionTypeZoneLine;
}
bool WaterMapV2::Load(FILE *fp) {
uint32 region_count;
if (fread(&region_count, sizeof(region_count), 1, fp) != 1) {

View File

@ -18,6 +18,7 @@ public:
virtual bool InLava(const glm::vec3& location) const;
virtual bool InLiquid(const glm::vec3& location) const;
virtual bool InPvP(const glm::vec3& location) const;
virtual bool InZoneLine(const glm::vec3& location) const;
protected:
virtual bool Load(FILE *fp);

View File

@ -1594,7 +1594,9 @@ ZonePoint* Zone::GetClosestZonePoint(const glm::vec3& location, uint32 to, Clien
iterator.Advance();
}
if(closest_dist > 400.0f && closest_dist < max_distance2)
// if we have a water map and it says we're in a zoneline, lets assume it's just a really big zone line
// this shouldn't open up any exploits since those situations are detected later on
if ((zone->HasWaterMap() && !zone->watermap->InZoneLine(glm::vec3(client->GetPosition()))) || (!zone->HasWaterMap() && closest_dist > 400.0f && closest_dist < max_distance2))
{
if(client)
client->CheatDetected(MQZoneUnknownDest, location.x, location.y, location.z); // Someone is trying to use /zone