From 01ef631ab3fe20cd70cb7e56f9196d57923e9268 Mon Sep 17 00:00:00 2001 From: Sam Sung <51686767+samwhosung@users.noreply.github.com> Date: Sun, 1 Nov 2026 03:39:48 +0700 Subject: [PATCH] Area triggers heartbeat first; far swings stop attack; ignored GMs speak (#2925) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three wire gaps: - An area trigger sent CMSG_AREATRIGGER alone and at any health. `0x5e2110` runs only while health is above 0 (`0x5e215e`). On entry it sends a heartbeat from the live pose (`0x5e221e`), then the trigger (`0x5e225d`), so the server checks the trigger against a fresh position. benilla now does both. - A landed swing on a far victim kept auto-attack on. `0x5ea800` sends CMSG_ATTACKSTOP when the 3D distance is at or beyond 4 × max(both combat reaches + 4/3, 5) (`0x5ea899`, `0x5ea8a8`), as after a knockback or a blink. benilla now does the same. - An ignored GM was silenced, and every ignored whisper drew CMSG_CHAT_IGNORED. `0x49d736` drops an ignored sender only under a non-GM tag, and replies only to such a whisper. benilla now does the same. Tests: the heartbeat-then-trigger order, the reach boundary, and the tag and type matrix. Fixes #2595 Fixes #2598 Fixes #2603 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 5.5 --- crates/benilla-app/src/area_trigger.rs | 57 +++++++- crates/benilla-app/src/combat_log/mod.rs | 3 + crates/benilla-app/src/creature_anim.rs | 9 ++ crates/benilla-app/src/creature_anim/net.rs | 77 +++++++++++ crates/benilla-app/src/player.rs | 1 + crates/benilla-app/src/player/movement_net.rs | 24 ++++ crates/benilla-app/src/target/cursor_mode.rs | 2 +- crates/benilla-app/src/ui_chat/net.rs | 123 ++++++++++++++++-- docs/DEVIATIONS.md | 2 +- 9 files changed, 280 insertions(+), 18 deletions(-) diff --git a/crates/benilla-app/src/area_trigger.rs b/crates/benilla-app/src/area_trigger.rs index 9170023ab..607097cdb 100644 --- a/crates/benilla-app/src/area_trigger.rs +++ b/crates/benilla-app/src/area_trigger.rs @@ -18,7 +18,7 @@ use benilla_assets::coords::bevy_to_wow; use benilla_formats::AreaTriggerCatalog; use bevy::prelude::*; -use crate::net::{ClientCommand, NetCommands}; +use crate::net::{ClientCommand, NetCommands, ObjectStore, SelfPlayer}; use crate::player::Player; use benilla_assets::{AssetSet, LockRecover, WorldAssets}; use benilla_world::schedule::WorldStage; @@ -84,11 +84,26 @@ fn load_area_triggers(mut commands: Commands, assets: Option>) } } +/// Whether the check runs at all: the reference's gate `0x5e215e` wants the player's health +/// above 0 (signed), and no player object skips it too (`0x5e214f`). +fn check_runs(store: Option<&ObjectStore>) -> bool { + store.is_some_and(|s| !s.0.unit_is_dead()) +} + +/// An entry's two sends, in the reference's order: the heartbeat with the live pose +/// (`0x5e221e`, `0x600a10` with 0xee), then CMSG_AREATRIGGER (`0x5e225d`). +fn send_entry(net: &NetCommands, player: &mut Player, now: f32, trigger_id: u32) { + crate::player::send_heartbeat(&net.0, player, now); + let _ = net.0.send(ClientCommand::AreaTrigger { trigger_id }); +} + /// The per-frame check (`0x5e2110`). fn check_area_triggers( triggers: Option>, map: Option>, - player: Res, + mut player: ResMut, + me: Query<&ObjectStore, With>, + time: Res