mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-17 21:55:49 +00:00
Make int conversion explicit
This commit is contained in:
parent
b68dc4eb2b
commit
3ba6ced83c
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user