From 6a2796dc179ce6b1e3ccec3d0d56c89a58ef34e4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 24 May 2023 21:33:40 +0100 Subject: [PATCH] Everything damage --- assets/common/voxel/carriage/structure.vox | 4 ++-- common/src/states/utils.rs | 2 +- common/systems/src/phys.rs | 8 ++++---- server/src/events/entity_manipulation.rs | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/common/voxel/carriage/structure.vox b/assets/common/voxel/carriage/structure.vox index 789196c384..2ab2284187 100644 --- a/assets/common/voxel/carriage/structure.vox +++ b/assets/common/voxel/carriage/structure.vox @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0423d5cc73724125279ca1adb3335c8a84bbcfe3da42f2bd3a285a13a50e4364 -size 2276 +oid sha256:d5094f74957ae008cbbfe98c945c7b0bf3e65745ec51b2dd5401803990e466cd +size 2448 diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index b6b18d2c05..86befb7ba9 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -146,7 +146,7 @@ impl Body { quadruped_low::Species::Deadwood => 140.0, quadruped_low::Species::Mossdrake => 100.0, }, - Body::Ship(ship::Body::Carriage) => 250.0, + Body::Ship(ship::Body::Carriage) => 350.0, Body::Ship(_) => 0.0, Body::Arthropod(arthropod) => match arthropod.species { arthropod::Species::Tarantula => 135.0, diff --git a/common/systems/src/phys.rs b/common/systems/src/phys.rs index 83142d2e92..0b07405591 100644 --- a/common/systems/src/phys.rs +++ b/common/systems/src/phys.rs @@ -1593,14 +1593,14 @@ fn box_voxel_collision + ReadVol>( /* if resolve_dir.z > 0.0 && vel.0.z <= 0.0 { */ if resolve_dir.z > 0.0 { on_ground = Some(block); - - if !was_on_ground { - land_on_ground(entity, *vel); - } } else if resolve_dir.z < 0.0 && vel.0.z >= 0.0 { on_ceiling = true; } + if resolve_dir.magnitude_squared() > 0.0 { + land_on_ground(entity, *vel); + } + // When the resolution direction is non-vertical, we must be colliding // with a wall // diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 5a87fab846..d4f9f6894b 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -602,7 +602,7 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3) // water. This was added as a *temporary* fix a bug that causes you to take // fall damage while swimming downwards. FIXME: Fix the actual bug and // remove the following relevant part of the if statement. - if vel.z <= -30.0 + if vel.magnitude() >= 30.0 && ecs .read_storage::() .get(entity) @@ -611,9 +611,9 @@ pub fn handle_land_on_ground(server: &Server, entity: EcsEntity, vel: Vec3) let char_states = ecs.read_storage::(); let reduced_vel_z = if let Some(CharacterState::DiveMelee(c)) = char_states.get(entity) { - (vel.z + c.static_data.vertical_speed).min(0.0) + (vel.magnitude() + c.static_data.vertical_speed).min(0.0) } else { - vel.z + vel.magnitude() }; let mass = ecs