1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Update lib/ResourceSet.h

Use suggestion.

Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
This commit is contained in:
Xilmi
2024-09-05 16:20:15 +02:00
committed by GitHub
parent b32c9615ed
commit 07afb2d649

View File

@@ -159,8 +159,7 @@ public:
} }
else { else {
// Calculate the number of times we need to accumulate income to fulfill the need // Calculate the number of times we need to accumulate income to fulfill the need
float divisionResult = static_cast<float>(container.at(i)) / static_cast<float>(income[i]); int ceiledResult = vstd::divideAndCeil(container.at(i), income[i]);
int ceiledResult = static_cast<int>(std::ceil(divisionResult));
ret = std::max(ret, ceiledResult); ret = std::max(ret, ceiledResult);
} }
} }