1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-15 13:55:11 -05:00

minetestmapper can be run from any directory

If it doesn't find colors.txt locally, it looks for the one in the
directory of the script itself.
This commit is contained in:
Giuseppe Bilotta 2011-08-03 08:37:56 +02:00
parent 59c58f230e
commit dd9909a574

View File

@ -152,7 +152,10 @@ if path[-1:] != "/" and path[-1:] != "\\":
# Load color information for the blocks.
colors = {}
f = file("colors.txt")
try:
f = file("colors.txt")
except IOError:
f = file(os.path.join(os.path.dirname(__file__), "colors.txt"))
for line in f:
values = string.split(line)
colors[int(values[0], 16)] = (