diff options
author | Aki <please@ignore.pl> | 2023-01-27 17:41:54 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2023-01-27 17:41:54 +0100 |
commit | b681f539860ee0aadd596921cdf4008be95df63b (patch) | |
tree | 85b4f2974510f15a4230fc0ad19e8a216b18ecc2 | |
parent | 75440771ca95a28556586233a0a8399022a5559f (diff) | |
download | kurator-b681f539860ee0aadd596921cdf4008be95df63b.zip kurator-b681f539860ee0aadd596921cdf4008be95df63b.tar.gz kurator-b681f539860ee0aadd596921cdf4008be95df63b.tar.bz2 |
Fixed missing sqrt in effective range calculation
-rw-r--r-- | universe/src/TurretType.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |