Log blatant melee range violations
Some checks failed
build / Linux asan (push) Has been cancelled
build / Linux release (push) Has been cancelled
build / FreeBSD build (push) Has been cancelled

This commit is contained in:
server
2026-04-16 11:20:09 +02:00
parent e8bcfe06f0
commit 763d7a99b7

View File

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