From b681f539860ee0aadd596921cdf4008be95df63b Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 27 Jan 2023 17:41:54 +0100 Subject: Fixed missing sqrt in effective range calculation --- universe/src/TurretType.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'universe/src') diff --git a/universe/src/TurretType.cpp b/universe/src/TurretType.cpp index a215b32..b6e006d 100644 --- a/universe/src/TurretType.cpp +++ b/universe/src/TurretType.cpp @@ -22,9 +22,9 @@ TurretType::effective_damage(const double distance) const double TurretType::effective_range() const { - const double target = std::log2(0.01) / std::log2(falloff_intensity); - const double one_percent_falloff = target * falloff_modifier * optimal_range; - return one_percent_falloff + optimal_range; + const double target_falloff = std::sqrt(std::log2(0.01) / std::log2(falloff_intensity)); + const double one_percent_overflow = target_falloff * falloff_modifier * optimal_range; + return one_percent_overflow + optimal_range; } -- cgit v1.1