summaryrefslogtreecommitdiff
path: root/battles/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-11-20 13:45:03 +0100
committerAki <please@ignore.pl>2022-11-20 13:45:03 +0100
commitfe3bdfd21253c2a9295e70ba6005a53f4fec7b73 (patch)
treea74d8eb9c5dc852f6b1a5ac3ce511f88c2534bdd /battles/src
parentec2f951152cd19ce861d9ae19f0bfac67595834c (diff)
downloadkurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.zip
kurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.tar.gz
kurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.tar.bz2
Introduced rounding into damage-by-range calculation
Diffstat (limited to 'battles/src')
-rw-r--r--battles/src/BaseBattle.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/battles/src/BaseBattle.cpp b/battles/src/BaseBattle.cpp
index 604a607..eb75464 100644
--- a/battles/src/BaseBattle.cpp
+++ b/battles/src/BaseBattle.cpp
@@ -113,7 +113,7 @@ effective_damage(const universe::TurretType& def, const double distance)
{
const auto overflow = distance - def.optimal_range;
const auto falloff = std::max(0.0, overflow / def.optimal_range / def.falloff_modifier);
- return def.base_damage * std::pow(def.falloff_intensity, std::pow(falloff, 2));
+ return def.base_damage * std::round(std::pow(def.falloff_intensity, std::pow(falloff, 2)) * 1000) / 1000;
}