From 9125919d3eb70b572d6694f2d58ed5678573a21a Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Sat, 4 Dec 2010 19:31:21 -0500 Subject: [PATCH] Give a more useful error if the biome color png files can't be found --- chunk.py | 6 ++++++ textures.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/chunk.py b/chunk.py index 7a2fd3d..8a22dff 100644 --- a/chunk.py +++ b/chunk.py @@ -170,6 +170,12 @@ class ChunkRenderer(object): _, dir1 = os.path.split(moredirs) self.cachedir = os.path.join(cachedir, dir1, dir2) + + if self.world.useBiomeData: + if not textures.grasscolor or not textures.foliagecolor: + raise Exception("Can't find grasscolor.png or foliagecolor.png") + + if not os.path.exists(self.cachedir): try: os.makedirs(self.cachedir) diff --git a/textures.py b/textures.py index e8cb391..fd27107 100644 --- a/textures.py +++ b/textures.py @@ -564,7 +564,8 @@ try: grasscolor = list(Image.open(_find_file("grasscolor.png")).getdata()) foliagecolor = list(Image.open(_find_file("foliagecolor.png")).getdata()) except: - pass + grasscolor = None + foliagecolor = None currentBiomeFile = None currentBiomeData = None