From 763d7a99b75a8d5ff394e1602d736a487c4726ec Mon Sep 17 00:00:00 2001 From: server Date: Thu, 16 Apr 2026 11:20:09 +0200 Subject: [PATCH] Log blatant melee range violations --- src/game/battle.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/battle.cpp b/src/game/battle.cpp index 3451378..c67dda1 100644 --- a/src/game/battle.cpp +++ b/src/game/battle.cpp @@ -142,6 +142,19 @@ int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim) if (distance > max) { + if (ch->IsPC() && distance > max + 200) + { + char szDetail[128]; + snprintf(szDetail, + sizeof(szDetail), + "distance=%d max=%d victim=%u type=%u", + distance, + max, + victim->GetVID(), + victim->IsPC() ? 1 : 0); + ch->RecordAntiCheatViolation("MELEE_RANGE", distance > max + 500 ? 18 : 8, szDetail, distance > max + 500); + } + if (test_server) sys_log(0, "VICTIM_FAR: %s distance: %d max: %d", ch->GetName(), distance, max); @@ -867,4 +880,3 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time) SET_ATTACKED_TIME(ch, victim, current_time); return false; } -