+ try:
+ (options, arguments) = getopt.getopt(sys.argv[1:], "ams")
+ except getopt.GetoptError as e:
+ print(e)
+ sys.exit(1)
+
+ subset = "maze"
+ for (switch, val) in options:
+ if switch == '-a':
+ subset = "all"
+ elif switch == '-m':
+ subset = "maze"
+ elif switch == '-s':
+ subset = "surface"
+ else:
+ sys.stderr.write(__doc__)
+ raise SystemExit(1)
+
+ startlocs = {}
+ for obj in db["objects"]:
+ objname = obj[0]
+ location = obj[1].get("locations")
+ if "OBJ" not in objname and location != "LOC_NOWHERE" and ("immovable" not in obj[1] or not obj[1]["immovable"]):
+ if location in startlocs:
+ startlocs[location].append(objname)
+ else:
+ startlocs[location] = [objname]
+
+ startlocs = {}
+ for obj in db["objects"]:
+ objname = obj[0]
+ location = obj[1].get("locations")
+ if "OBJ" not in objname and location != "LOC_NOWHERE" and ("immovable" not in obj[1] or not obj[1]["immovable"]):
+ if location in startlocs:
+ startlocs[location].append(objname)
+ else:
+ startlocs[location] = [objname]
+