More robust tests

This commit is contained in:
David Markowitz
2023-06-09 23:05:44 -07:00
parent 1c23f3c030
commit 2a2799793d
2 changed files with 22 additions and 5 deletions

View File

@@ -175,8 +175,11 @@ void Entity::ApplyComponentWhitelist(std::vector<eReplicaComponentType>& compone
if (whitelistIndex < 0 || whitelistIndex >= m_ComponentWhitelists.size()) return;
for (const auto& componentToKeep : m_ComponentWhitelists.at(whitelistIndex)) {
const auto componentIter = std::find(components.begin(), components.end(), componentToKeep);
if (componentIter != components.end()) components.erase(componentIter);
while (true) {
const auto componentIter = std::find(components.begin(), components.end(), componentToKeep);
if (componentIter == components.end()) break;
components.erase(componentIter);
}
}
}