From 64e67cc827d36f0a6af079ebc8185484d94e2f7e Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 30 Oct 2011 18:06:28 -0400 Subject: [PATCH] fixed crash when SpawnY wasn't in [0, 128) --- overviewer_core/world.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 745106a..decede4 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -266,7 +266,13 @@ class World(object): ## The chunk that holds the spawn location chunkX = spawnX/16 chunkY = spawnZ/16 - + + ## clamp spawnY to a sane value, in-chunk value + if spawnY < 0: + spawnY = 0 + if spawnY > 127: + spawnY = 127 + try: ## The filename of this chunk chunkFile = self.get_region_path(chunkX, chunkY)