Make int conversion explicit

This commit is contained in:
Gunter Labes 2025-02-13 22:11:30 +01:00
parent b68dc4eb2b
commit 3ba6ced83c
No known key found for this signature in database
GPG Key ID: C0C7B971CC910216

View File

@ -80,7 +80,7 @@ constexpr T modulo(T num, int mod, T min = 0)
constexpr int round_damage(double base_damage, int bonus, int divisor) {
if (base_damage==0) return 0;
const int rounding = divisor / 2 - (bonus <= divisor || divisor==1 ? 0 : 1);
return std::max<int>(1, (base_damage * bonus + rounding) / divisor);
return std::max<int>(1, static_cast<int>(base_damage * bonus + rounding) / divisor);
}
template<typename Cmp>