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; } -