Compare commits

...
Author SHA1 Message Date
Ludovic MarieandClaude Opus 5.5 5672f41859 LAN hub: one S::Attack arm (main's clippy fails on an unreachable pattern)
#5123 added a second S::Attack arm (break behind a queued move) after the
anticheat's, so it never ran and clippy -D warnings fails on main. The
anticheat's arm now also breaks when a move is queued behind the attack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 18:20:10 +01:00
+9 -10
View File
@@ -2703,10 +2703,16 @@ impl Hub {
g.max_unacknowledged = 10;
}
S::Pong(p) => self.anticheat_pong(i, p.id),
// handleAttack is the game's: a move queued behind it would move the
// player (or land them on the ground, losing a falling attack's
// critical hit) before the game checks their reach and state.
S::Attack(p) => {
if !self.anticheat_attack(i, p.id, events) {
events.push(HostEvent::Packet(conn, Box::new(S::Attack(p))));
}
if self.move_queued(i) {
break;
}
}
S::Punch(p) => {
self.anticheat_swing(i);
@@ -2803,16 +2809,9 @@ impl Hub {
break;
}
}
// handleAttack and handleInteract are the game's too: a move queued
// behind them would move the player (or land them on the ground,
// losing a falling attack's critical hit) before the game checks
// their reach and state.
S::Attack(p) => {
events.push(HostEvent::Packet(conn, Box::new(S::Attack(p))));
if self.move_queued(i) {
break;
}
}
// handleInteract is the game's too: a move queued behind it would
// move the player before the game checks their reach and state
// (S::Attack does the same above, after the anticheat).
S::Interact(p) => {
events.push(HostEvent::Packet(conn, Box::new(S::Interact(p))));
if self.move_queued(i) {