From 0ba46844f311aceeeb7a9e0e4a4f8df51b7686d9 Mon Sep 17 00:00:00 2001 From: John Shepherd Date: Wed, 16 Dec 2020 20:07:41 -0800 Subject: [PATCH] fix left out components bug Signed-off-by: John Shepherd --- src/EntityComponentManager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EntityComponentManager.cc b/src/EntityComponentManager.cc index 08c97b298d..9c21cee0aa 100644 --- a/src/EntityComponentManager.cc +++ b/src/EntityComponentManager.cc @@ -945,7 +945,8 @@ void EntityComponentManager::CalculateComponentThreadLoad() const // Set the number of threads to spawn to the min of the calculated thread // count or max threads that the hardware supports this->dataPtr->numComponentThreads = std::min(numThreads, maxThreads); - int componentsPerThread = numComponents / this->dataPtr->numComponentThreads; + int componentsPerThread = std::ceil(static_cast(numComponents) / + this->dataPtr->numComponentThreads); // Push back the starting iterator this->dataPtr->entityComponentIterators.push_back(startIt);