summaryrefslogtreecommitdiff
path: root/universe/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-01-27 17:41:54 +0100
committerAki <please@ignore.pl>2023-01-27 17:41:54 +0100
commitb681f539860ee0aadd596921cdf4008be95df63b (patch)
tree85b4f2974510f15a4230fc0ad19e8a216b18ecc2 /universe/src
parent75440771ca95a28556586233a0a8399022a5559f (diff)
downloadkurator-b681f539860ee0aadd596921cdf4008be95df63b.zip
kurator-b681f539860ee0aadd596921cdf4008be95df63b.tar.gz
kurator-b681f539860ee0aadd596921cdf4008be95df63b.tar.bz2
Fixed missing sqrt in effective range calculation
Diffstat (limited to 'universe/src')
-rw-r--r--universe/src/TurretType.cpp6
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;
}