Browse Source

fix: entities got added twice to the chunk after loading

Kolja Strohm 14 hours ago
parent
commit
ddaf00d3df
1 changed files with 1 additions and 2 deletions
  1. 1 2
      FactoryCraft/Chunk.cpp

+ 1 - 2
FactoryCraft/Chunk.cpp

@@ -1083,8 +1083,7 @@ void Chunk::load(Framework::StreamReader* zReader)
         int type;
         zReader->lese((char*)&type, 4);
         Entity* entity = Game::INSTANCE->zEntityType(type)->loadEntity(zReader);
-        entitiesInChunk.add(entity);
-        lastSavedEntityIds.add(entity->getId());
+        addGeneratedEntity(entity);
     }
 }