diff --git a/maps.py b/maps.py index c30b09c..0cbdbda 100644 --- a/maps.py +++ b/maps.py @@ -211,7 +211,8 @@ class Map(): #self.load_visible() def apply_changes(self, changes): - self.chunkpool.apply_changes(changes) + with self.chunkpool as pool: + pool.apply_changes(changes) ChunkStyle = namedtuple("ChunkStyle", "string color") diff --git a/server.py b/server.py index 41c6fb2..f5c4cdd 100644 --- a/server.py +++ b/server.py @@ -27,8 +27,9 @@ class WotServer(WebSocket): def handle_unload_chunks(self, coords): for coor in coords: - pos = Position(coor) - self.loaded_chunks.remove(pos) + pos = Position(coor[0], coor[1]) + if pos in self.loaded_chunks: + self.loaded_chunks.remove(pos) def handle_save_changes(self, dchanges): changes = []