From ad9756fa8cdfe193c452461e0f2bd0f458ba4bfc Mon Sep 17 00:00:00 2001 From: Alejandro Aguilera Date: Wed, 5 Jan 2011 15:09:55 +0100 Subject: [PATCH] Change to a better looking and better maintainable code. (thanks blixt) --- world.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/world.py b/world.py index 4de2a7a..1a9f38e 100644 --- a/world.py +++ b/world.py @@ -220,11 +220,10 @@ class WorldRenderer(object): inChunkZ = spawnZ - (chunkY*16) ## find the first air block - while (blockArray[inChunkX, inChunkZ, spawnY] != 0 and spawnY != 127): + while (blockArray[inChunkX, inChunkZ, spawnY] != 0): spawnY += 1 - - if spawnY == 127 and blockArray[inChunkX, inChunkZ, spawnY] != 0 : - spawnY = 128 # get the right spawnY coordinate for markers.js + if spawnY == 128: + break self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ, msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))