Fix test breakage.
[open-adventure.git] / make_dungeon.py
index 9b729cc2505193b54a81e576ed47bb2c2cd3c253..b37856368947d219bcb5a79ef66deeaf38fdbdcf 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python
 
 # This is the open-adventure dungeon generator. It consumes a YAML description of
 # the dungeon and outputs a dungeon.h and dungeon.c pair of C code files.
@@ -384,8 +384,8 @@ def get_objects(obj):
             if labels:
                 global statedefines
                 statedefines += "/* States for %s */\n" % item[0]
-                for (i, label) in enumerate(labels):
-                    statedefines += "#define %s\t%d\n" % (label, i)
+                for (j, label) in enumerate(labels):
+                    statedefines += "#define %s\t%d\n" % (label, j)
                 statedefines += "\n"
         sounds_str = ""
         if attr.get("sounds") == None:
@@ -626,7 +626,7 @@ def buildtravel(locs, objs):
             try:
                 return locnames.index(action[1])
             except ValueError:
-                sys.stderr.write("dungeon: unknown location %s in goto clause of %s\n" % (cond[1], name))
+                sys.stderr.write("dungeon: unknown location %s in goto clause of %s\n" % (action[1], name))
         elif action[0] == "special":
             return 300 + action[1]
         elif action[0] == "speak":