diff options
author | Aki <please@ignore.pl> | 2022-11-20 13:45:03 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-11-20 13:45:03 +0100 |
commit | fe3bdfd21253c2a9295e70ba6005a53f4fec7b73 (patch) | |
tree | a74d8eb9c5dc852f6b1a5ac3ce511f88c2534bdd | |
parent | ec2f951152cd19ce861d9ae19f0bfac67595834c (diff) | |
download | kurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.zip kurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.tar.gz kurator-fe3bdfd21253c2a9295e70ba6005a53f4fec7b73.tar.bz2 |
Introduced rounding into damage-by-range calculation
-rw-r--r-- | battles/src/BaseBattle.cpp | 2 |
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; } |