diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-26 06:21:39 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-26 06:21:39 +0300 |
| commit | f0a92313d0628eda8e163ab0608ce8fcbedaad95 (patch) | |
| tree | 203c15e66a577e621b88c28428e01a55d9fac37c /crates/fparkan-runtime/src/unit_combat.rs | |
| parent | 8f1ba615bf1e393698eae7624073c1ad9f54c02b (diff) | |
| download | fparkan-f0a92313d0628eda8e163ab0608ce8fcbedaad95.tar.xz fparkan-f0a92313d0628eda8e163ab0608ce8fcbedaad95.zip | |
feat(combat): show detached assemblies after chassis destruction
Diffstat (limited to 'crates/fparkan-runtime/src/unit_combat.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_combat.rs | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/crates/fparkan-runtime/src/unit_combat.rs b/crates/fparkan-runtime/src/unit_combat.rs index f1e86aab..60123dcd 100644 --- a/crates/fparkan-runtime/src/unit_combat.rs +++ b/crates/fparkan-runtime/src/unit_combat.rs @@ -825,14 +825,6 @@ mod tests { .iter() .find(|event| matches!(event, AutoDemoCombatEvent::Destroyed { .. })) { - assert!(destruction_effects.iter().any(|event| { - event.archive == "system.rlb" - && event.name == "explode_rbr_b.exp" - && event - .position - .iter() - .all(|coordinate| coordinate.is_finite()) - })); assert!(identity_metadata(&engine.world, *target).is_err()); let ((_, retired), total) = combat .report @@ -842,7 +834,18 @@ mod tests { object.slot == target.slot && object.generation == target.generation }) .expect("removed target is still reported"); - assert!(retired.original_id.is_some()); + let drafts = &engine.loaded.as_ref().unwrap().object_drafts; + assert!(destruction_effects.iter().any(|event| { + event.archive == "system.rlb" + && event.name == "explode_rbr_b.exp" + && event.object_index.is_some_and(|index| { + drafts[index].original_id.map(|id| id.0) == retired.original_id + }) + && event + .position + .iter() + .all(|coordinate| coordinate.is_finite()) + })); assert_eq!(total.first_ms, now); assert_eq!(total.count, 1); assert!(observed_shots > 0); |
