1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-16 02:47:36 +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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,8 +159,7 @@ public:
}
else {
// 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 = static_cast<int>(std::ceil(divisionResult));
int ceiledResult = vstd::divideAndCeil(container.at(i), income[i]);
ret = std::max(ret, ceiledResult);
}
}