fix: entities despawn on F5

This commit is contained in:
MihailRis 2025-07-14 18:20:10 +03:00
parent 74a714fe2c
commit 6ab48fda93

View File

@ -167,10 +167,12 @@ void GlobalChunks::decref(Chunk* chunk) {
ekey.pos[0] = chunk->x;
ekey.pos[1] = chunk->z;
save(chunk);
if (onUnload) {
onUnload(*chunk);
}
save(chunk);
chunksMap.erase(ekey.key);
refCounters.erase(found);
}