aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/mission_events.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-26 12:39:26 +0300
committerValentin Popov <valentin@popov.link>2026-11-26 12:39:26 +0300
commit2bf70f8b1eca48ba40215a4e58aaf6b133d84b18 (patch)
tree61deae894a5e3c7aa78f65f3abc25a4a34091ac2 /crates/fparkan-runtime/src/mission_events.rs
parent54b6e83f62fe52b221dcb7eebff245e9d5b39305 (diff)
downloadfparkan-2bf70f8b1eca48ba40215a4e58aaf6b133d84b18.tar.xz
fparkan-2bf70f8b1eca48ba40215a4e58aaf6b133d84b18.zip
fix(player): capture buildings at the communicator floor
On the stock Constructor map, walk through the factory basement to the communicator and press Enter. The first objective completes and the same path returns to ground level. The green ceiling no longer hides the floor in the contact query.
Diffstat (limited to 'crates/fparkan-runtime/src/mission_events.rs')
-rw-r--r--crates/fparkan-runtime/src/mission_events.rs14
1 files changed, 4 insertions, 10 deletions
diff --git a/crates/fparkan-runtime/src/mission_events.rs b/crates/fparkan-runtime/src/mission_events.rs
index a198bfdd..ec976224 100644
--- a/crates/fparkan-runtime/src/mission_events.rs
+++ b/crates/fparkan-runtime/src/mission_events.rs
@@ -624,7 +624,6 @@ pub(super) fn communicator_triangles(
pose: super::TransformState,
) -> Option<Vec<[[f32; 3]; 3]>> {
let is_generator = class == 0x8000_0002;
- let floor_only = is_generator || class == MAIN_TELEPORT_CLASS;
let material = if is_generator {
&b"B_MTP_07G"[..]
} else {
@@ -679,15 +678,10 @@ pub(super) fn communicator_triangles(
transform.try_transform_scaled_point(pose.transform_point(local), scale)
});
let (a, b, c) = (a?, b?, c?);
- if floor_only {
- // These models use the platform material on both the floor and the surface above it.
- let winding =
- (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
- if winding <= 0.0 {
- return None;
- }
- }
- Some([a, b, c])
+ // The floor and ceiling of the communicator share the same material.
+ let normal_z =
+ (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
+ (normal_z > 0.0).then_some([a, b, c])
})
})
.collect(),