diff --git a/CHANGELOG.md b/CHANGELOG.md index 0492fd47d5..85bbf6e562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Nerfed some skill values - Tweaked critical chance of legendary weapons - Agents using fireball projectiles aim at the feet instead of the eyes +- Explosions can now have a nonzero minimum falloff ### Removed diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 8c07702ae0..8b98efce3e 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -567,9 +567,8 @@ pub fn handle_explosion(server: &Server, pos: Vec3, explosion: Explosion, o 0.0 } else { // Falloff inversely proportional to radius - let fall_off = ((horiz_dist.max(vert_distance).max(0.0) / radius).min(1.0) - 1.0).abs(); - // Clamp min_falloff so that it doesn't produce absurd values or NaNs - let min_falloff = min_falloff.clamp(0.0, 0.99); + let fall_off = ((distance / radius).min(1.0) - 1.0).abs(); + let min_falloff = min_falloff.clamp(0.0, 1.0); min_falloff + fall_off * (1.0 - min_falloff) } } diff --git a/server/src/sys/agent.rs b/server/src/sys/agent.rs index 1e1940a84c..a7768d7187 100644 --- a/server/src/sys/agent.rs +++ b/server/src/sys/agent.rs @@ -1862,6 +1862,7 @@ impl<'a> AgentData<'a> { damage: _, radius: _, energy_regen: _, + min_falloff: _, } => 0.0, _ => tgt_eye_offset, };