fix (module) Reduce false positives Anti-Swim

This commit is contained in:
MDIC
2022-05-08 19:59:38 -04:00
parent a4d970e19f
commit ed0f522d60
2 changed files with 14 additions and 3 deletions

View File

@@ -424,7 +424,7 @@ void AnticheatMgr::StartHackDetection(Player* player, MovementInfo movementInfo,
}
if (player->GetLiquidData().Status == LIQUID_MAP_UNDER_WATER)
{
AntiSwimHackDetection(player, movementInfo);
AntiSwimHackDetection(player, movementInfo, opcode);
}
m_Players[key].SetLastMovementInfo(movementInfo);
m_Players[key].SetLastOpcode(opcode);
@@ -473,7 +473,7 @@ void AnticheatMgr::ClimbHackDetection(Player* player, MovementInfo movementInfo,
}
// basic detection
void AnticheatMgr::AntiSwimHackDetection(Player* player, MovementInfo movementInfo)
void AnticheatMgr::AntiSwimHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode)
{
if (!sConfigMgr->GetOption<bool>("Anticheat.AntiSwimHack", true))
return;
@@ -487,6 +487,17 @@ void AnticheatMgr::AntiSwimHackDetection(Player* player, MovementInfo movementIn
}
}
if (player->GetLiquidData().Status == (LIQUID_MAP_ABOVE_WATER | LIQUID_MAP_WATER_WALK | LIQUID_MAP_IN_WATER))
{
return;
}
if (opcode == MSG_MOVE_JUMP)
return;
if (movementInfo.HasMovementFlag(MOVEMENTFLAG_FALLING || MOVEMENTFLAG_SWIMMING))
return;
if (player->GetLiquidData().Status == LIQUID_MAP_UNDER_WATER && !movementInfo.HasMovementFlag(MOVEMENTFLAG_SWIMMING))
{
if (sConfigMgr->GetOption<bool>("Anticheat.WriteLog", true))

View File

@@ -78,7 +78,7 @@ class AnticheatMgr
void JumpHackDetection(Player* player, MovementInfo movementInfo,uint32 opcode);
void TeleportPlaneHackDetection(Player* player, MovementInfo);
void ClimbHackDetection(Player* player,MovementInfo movementInfo, uint32 opcode);
void AntiSwimHackDetection(Player* player, MovementInfo movementInfo);
void AntiSwimHackDetection(Player* player, MovementInfo movementInfo, uint32 opcode);
void TeleportHackDetection(Player* player, MovementInfo movementInfo);
void IgnoreControlHackDetection(Player* player, MovementInfo movementInfo);
void ZAxisHackDetection(Player* player, MovementInfo movementInfo);