Fix a stupid bug in removing clients
It was removing all clients except the one...
This commit is contained in:
parent
b224392395
commit
eec86d3489
@ -32,7 +32,10 @@ class IChunkLoaderClient(object):
|
|||||||
def requestChunk(self):
|
def requestChunk(self):
|
||||||
"""
|
"""
|
||||||
Return the coordinates of the chunk requested by the client. Each
|
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)
|
:rtype: (cx, cz)
|
||||||
:return: Chunk coordinates
|
:return: Chunk coordinates
|
||||||
"""
|
"""
|
||||||
@ -61,7 +64,9 @@ class IChunkLoaderClient(object):
|
|||||||
def chunkNotLoaded(self, (cx, cz), exc):
|
def chunkNotLoaded(self, (cx, cz), exc):
|
||||||
"""
|
"""
|
||||||
Notifies the client that a chunk failed to load with an exception.
|
Notifies the client that a chunk failed to load with an exception.
|
||||||
|
|
||||||
:param (cx, cz): chunk position
|
: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
|
:type client: IChunkLoaderClient
|
||||||
"""
|
"""
|
||||||
try:
|
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)
|
log.info("Removed: client %s", client)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user