aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 13:02:42 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 13:02:42 +0300
commit059d891d187a0fc5b79916b00ae5163aa1c259a6 (patch)
treef1b1b8b4ff4f0d8848e9b83fc9212db9f6d35b1d /crates/fparkan-runtime/src/lib.rs
parent1b7a5a9c149270e9046a86590e7d0d62116eec5f (diff)
downloadfparkan-059d891d187a0fc5b79916b00ae5163aa1c259a6.tar.xz
fparkan-059d891d187a0fc5b79916b00ae5163aa1c259a6.zip
fix(runtime): capture the main teleport from the communicator floor
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs28
1 files changed, 28 insertions, 0 deletions
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]