mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
Chunks reload fix
This commit is contained in:
parent
c518580577
commit
50aa5fdc70
5 changed files with 8 additions and 7 deletions
|
|
@ -338,10 +338,11 @@ bool Chunks::putChunk(shared_ptr<Chunk> chunk) {
|
|||
return true;
|
||||
}
|
||||
|
||||
void Chunks::clear(){
|
||||
void Chunks::saveAndClear(){
|
||||
for (size_t i = 0; i < volume; i++){
|
||||
Chunk* chunk = chunks[i].get();
|
||||
if (chunk) {
|
||||
worldFiles->put(chunk);
|
||||
events->trigger(EVT_CHUNK_HIDDEN, chunk);
|
||||
}
|
||||
chunks[i] = nullptr;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public:
|
|||
void translate(int x, int z);
|
||||
void resize(int newW, int newD);
|
||||
|
||||
void clear();
|
||||
void saveAndClear();
|
||||
};
|
||||
|
||||
#endif /* VOXELS_CHUNKS_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue