2
0
Эх сурвалжийг харах

Merge branch 'develop' of https://github.com/xilmi/vcmi into develop

Xilmi 1 жил өмнө
parent
commit
51b9d16291
1 өөрчлөгдсөн 1 нэмэгдсэн , 2 устгасан
  1. 1 2
      lib/ResourceSet.h

+ 1 - 2
lib/ResourceSet.h

@@ -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);
 				}
 			}