From fe3bdfd21253c2a9295e70ba6005a53f4fec7b73 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 20 Nov 2022 13:45:03 +0100 Subject: Introduced rounding into damage-by-range calculation --- battles/src/BaseBattle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.1