From e3b599eee15b178ff1d6ee73ece8c32340fe2f44 Mon Sep 17 00:00:00 2001 From: Joscha Date: Mon, 10 Apr 2017 00:04:22 +0000 Subject: [PATCH] Handle saving changes separate from cleaning up --- chunks.py | 2 +- maps.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/chunks.py b/chunks.py index d64163e..2c44d39 100644 --- a/chunks.py +++ b/chunks.py @@ -188,7 +188,7 @@ class ChunkPool(): # 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)] - self.save_changes() + #self.save_changes() # needs to be accounted for by the user coords = [] diff --git a/maps.py b/maps.py index 62ca5f0..038eb33 100644 --- a/maps.py +++ b/maps.py @@ -83,7 +83,7 @@ class Map(): 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 - return not in_range + return not in_range and not chunk.modified() def load_visible(self): with self.chunkpool as pool: