mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 22:43:47 -10:00
lan: one Attack arm in the guest inbox (main's clippy fails)
The anticheat's Attack arm and #5123's arm that keeps moves queued behind an attack both landed in process_inbox; the second was unreachable, so clippy -D warnings failed on main and #5123's behaviour was lost. The anticheat arm now also holds the queued move when it forwards the attack. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d6e8bd67aa
commit
825a6bbcf9
1 file changed
+8
-10
@@ -2703,9 +2703,15 @@ impl Hub {
|
||||
g.max_unacknowledged = 10;
|
||||
}
|
||||
S::Pong(p) => self.anticheat_pong(i, p.id),
|
||||
// handleAttack is the game's too: a move queued behind an attack 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) => {
|
||||
@@ -2803,16 +2809,8 @@ 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, like handleAttack above: a move queued
|
||||
// behind it waits for the next tick.
|
||||
S::Interact(p) => {
|
||||
events.push(HostEvent::Packet(conn, Box::new(S::Interact(p))));
|
||||
if self.move_queued(i) {
|
||||
|
||||
Reference in new issue
Block a user