From 54b6e83f62fe52b221dcb7eebff245e9d5b39305 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 26 Nov 2026 13:25:10 +0400 Subject: fix(player): drown on first supported step into water Carry the terrain surface flags through the walking collision decision. A mesh floor over water remains safe. The first accepted wet step removes the hero and produces the normal mission failure event. Verified the surface flag in the original Control DLL and walked from the stock Constructor spawn to the lake in the Vulkan window. --- crates/fparkan-runtime/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (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 f7e73665..9a2b8a56 100644 --- a/crates/fparkan-runtime/src/lib.rs +++ b/crates/fparkan-runtime/src/lib.rs @@ -3009,6 +3009,10 @@ pub fn frame_with_player_motion( pose.position = previous.position; } set_transform(&mut engine.world, cockpit.handle, pose)?; + let drowned = !blocked && player_motion::drowns(engine, cockpit, motion); + if drowned { + fparkan_world::request_delete(&mut engine.world, cockpit.handle)?; + } let passenger = boarding::move_passenger(engine, cockpit, pose); match frame(engine, queue_time_ms) { Ok(mut frame) => { @@ -3019,7 +3023,9 @@ pub fn frame_with_player_motion( Ok(frame) } Err(error) => { - set_transform(&mut engine.world, cockpit.handle, previous)?; + if !drowned { + set_transform(&mut engine.world, cockpit.handle, previous)?; + } if let Some((handle, previous)) = passenger { set_transform(&mut engine.world, handle, previous)?; } -- cgit v1.2.3