From 059d891d187a0fc5b79916b00ae5163aa1c259a6 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Nov 2026 14:02:42 +0400 Subject: fix(runtime): capture the main teleport from the communicator floor --- crates/fparkan-runtime/src/lib.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'crates/fparkan-runtime/src/lib.rs') diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs index 483ffb71..f0be9bad 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -18039,6 +18039,34 @@ mod tests { after.notices.contains(&MissionNotice::ObjectiveComplete(0)), "{after:?}" ); + for (time, slot, objective, plate) in [ + (4_001, 4, 1, [750.0_f32, 950.7, 45.88]), + (6_001, 5, 2, [950.7, 869.4, 69.98]), + (8_001, 3, 4, [1179.28, 1242.12, 101.60]), + ] { + if slot == 3 { + pose.position = [plate[0], plate[1], 110.28].map(f32::to_bits); + set_transform(&mut engine.world, cockpit.handle, pose).unwrap(); + assert_eq!( + capture_neutral_building(&mut engine, cockpit).unwrap(), + None + ); + } + pose.position = plate.map(f32::to_bits); + set_transform(&mut engine.world, cockpit.handle, pose).unwrap(); + assert_eq!( + capture_neutral_building(&mut engine, cockpit).unwrap(), + Some(OriginalObjectId(slot)), + ); + let event = frame(&mut engine, time).unwrap().mission_event.unwrap(); + assert!(event.stop.is_none(), "{event:?}"); + assert!( + event + .notices + .contains(&MissionNotice::ObjectiveComplete(objective)), + "{event:?}" + ); + } } #[test] -- cgit v1.2.3