diff --git a/client/src/lib.rs b/client/src/lib.rs index 5ad6194e42..e67e5c52ec 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -27,8 +27,9 @@ use common::{ invite::{InviteKind, InviteResponse}, skills::Skill, slot::Slot, - ChatMode, ControlAction, ControlEvent, Controller, ControllerInputs, GroupManip, InputKind, - InventoryAction, InventoryEvent, InventoryUpdateEvent, UtteranceKind, + ChatMode, ControlAction, ControlEvent, Controller, ControllerInputs, Fluid, GroupManip, + InputKind, InventoryAction, InventoryEvent, InventoryUpdateEvent, PhysicsState, + UtteranceKind, Vel, }, event::{EventBus, LocalEvent}, grid::Grid, @@ -1985,6 +1986,20 @@ impl Client { }, ServerGeneral::WindUpdate(vel) => { println!("Windupdate {}", vel); + let player_entity = self.entity(); + self.state + .ecs_mut() + .write_storage::() + .get_mut(player_entity) + .map(|physics_state| { + physics_state.in_fluid = physics_state + .in_fluid + .filter(|fluid| matches!(fluid, Fluid::Water { .. })) + .or(Some(Fluid::Air { + elevation: 0.0, + vel: Vel(vel), + })); + }); }, _ => unreachable!("Not a in_game message"), } diff --git a/server/src/sys/windsim.rs b/server/src/sys/windsim.rs index 497c0510fe..852b3aa037 100644 --- a/server/src/sys/windsim.rs +++ b/server/src/sys/windsim.rs @@ -23,13 +23,13 @@ impl<'a> System<'a> for Sys { let wind_sources: Vec<(Pos, Vel)> = vec![( Pos(Vec3 { x: 9999.0, - y: 9999.0, + y: 9599.0, z: 200.0, }), Vel(Vec3 { x: 100.0, y: 100.0, - z: 100.0, + z: 500.0, }), )]; windsim.tick(wind_sources, &dt);