Delete instances with no players

This commit is contained in:
Gent
2020-10-15 15:46:07 -04:00
parent 6473951b9a
commit da725d21e6
3 changed files with 19 additions and 4 deletions

View File

@@ -85,7 +85,8 @@ void ChunkManager::destroyChunk(std::tuple<int, int, uint64_t> chunkPos) {
Chunk* chunk = chunks[chunkPos];
// unspawn all of the mobs/npcs
for (uint32_t id : chunk->NPCs) {
std::set npcIDs(chunk->NPCs);
for (uint32_t id : npcIDs) {
NPCManager::destroyNPC(id);
}