Handle saving changes separate from cleaning up

This commit is contained in:
Joscha 2017-04-10 00:04:22 +00:00
parent 23da1ea5d9
commit e3b599eee1
2 changed files with 2 additions and 2 deletions

View file

@ -188,7 +188,7 @@ class ChunkPool():
# old list comprehension which became too long: # old list comprehension which became too long:
#coords = [pos for pos, chunk in self._chunks.items() if not pos in except_for and condition(chunk)] #coords = [pos for pos, chunk in self._chunks.items() if not pos in except_for and condition(chunk)]
self.save_changes() #self.save_changes() # needs to be accounted for by the user
coords = [] coords = []

View file

@ -83,7 +83,7 @@ class Map():
yend = ystart + chunky(self.height)+2 + 2*self.chunkunload yend = ystart + chunky(self.height)+2 + 2*self.chunkunload
in_range = pos.x >= xstart and pos.x < xend and pos.y >= ystart and pos.y < yend in_range = pos.x >= xstart and pos.x < xend and pos.y >= ystart and pos.y < yend
return not in_range return not in_range and not chunk.modified()
def load_visible(self): def load_visible(self):
with self.chunkpool as pool: with self.chunkpool as pool: