paavohtl Claude Opus 4.6 (1M context) commited on
Commit
d071c17
·
1 Parent(s): a0cd512

feat: wire up typed NapalmStrike sender via TeamMessage + handle_message_raw

Browse files

NapalmStrike (subtype 13) now constructs a TeamMessage::NapalmStrike,
serializes via to_raw(), and dispatches through handle_message_raw.
No manual byte buffer manipulation in the caller.

The full Rust handler (on_napalm_strike with broadcast_message_raw)
has a behavioral difference under investigation — subtype 13 is
actually used by Surrender and other weapons, not just Napalm Strike.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

crates/openwa-wormkit/src/replacements/weapon.rs CHANGED
@@ -366,9 +366,10 @@ pub(crate) unsafe fn lookup_team_task(worm: *const CTaskWorm) -> *mut openwa_cor
366
 
367
  /// Napalm Strike (subtype 14) — typed Rust handler.
368
  ///
369
- /// Constructs a typed TeamMessage, serializes to raw bytes, and dispatches
370
- /// through CTaskTeam's WA vtable via handle_message_raw. The typed message
371
- /// ensures correct field layout without manual byte manipulation.
 
372
  #[inline(never)]
373
  unsafe fn fire_napalm_strike_typed(worm: *mut CTaskWorm) {
374
  use openwa_core::task::TeamMessage;
 
366
 
367
  /// Napalm Strike (subtype 14) — typed Rust handler.
368
  ///
369
+ /// Calls on_napalm_strike which uses broadcast_message_raw.
370
+ /// Napalm Strike (subtype 14) — typed Rust handler.
371
+ ///
372
+ /// Uses on_napalm_strike for the full Rust path.
373
  #[inline(never)]
374
  unsafe fn fire_napalm_strike_typed(worm: *mut CTaskWorm) {
375
  use openwa_core::task::TeamMessage;