瀏覽代碼

Lesson 20.5

Godzil 3 年之前
父節點
當前提交
de6d748a6a
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      source/ECS.cpp

+ 4 - 1
source/ECS.cpp

@@ -149,7 +149,10 @@ void Registry::update()
 
         for(auto pool: this->componentPools)
         {
-            pool->removeEntityFromPool(entity.getId());
+            if (pool != nullptr)
+            {
+                pool->removeEntityFromPool(entity.getId());
+            }
         }
 
         this->freeIds.push_back(entity.getId());