From eec86d34895dc21f3588d20c914c4c42deaa5663 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 22 Mar 2015 18:35:24 -1000 Subject: [PATCH] Fix a stupid bug in removing clients It was removing all clients except the one... --- src/mcedit2/rendering/chunkloader.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mcedit2/rendering/chunkloader.py b/src/mcedit2/rendering/chunkloader.py index d48dd58..438c768 100644 --- a/src/mcedit2/rendering/chunkloader.py +++ b/src/mcedit2/rendering/chunkloader.py @@ -32,7 +32,10 @@ class IChunkLoaderClient(object): def requestChunk(self): """ Return the coordinates of the chunk requested by the client. Each - call may return a different set of coordinates. Return None to request no chunks. + call to the client should return a different set of coordinates. + + Return None to request no chunks. + :rtype: (cx, cz) :return: Chunk coordinates """ @@ -61,7 +64,9 @@ class IChunkLoaderClient(object): def chunkNotLoaded(self, (cx, cz), exc): """ Notifies the client that a chunk failed to load with an exception. + :param (cx, cz): chunk position + :param exc: The exception that was thrown, usually IOError or LevelFormatError """ @@ -120,7 +125,7 @@ class ChunkLoader(QtCore.QObject): :type client: IChunkLoaderClient """ try: - self.clients[:] = [c for c in self.clients if c() == client] + self.clients[:] = [c for c in self.clients if c() is not client] log.info("Removed: client %s", client) except ValueError: pass