summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhercules/tmx_converter.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/hercules/tmx_converter.py b/hercules/tmx_converter.py
index 8a34a06..96a37d9 100755
--- a/hercules/tmx_converter.py
+++ b/hercules/tmx_converter.py
@@ -32,6 +32,7 @@ import sys
import os
import posixpath
import xml.sax
+import traceback
dump_all = False # wall of text
check_mobs = False # mob_db.txt
@@ -625,11 +626,16 @@ def main(argv):
main.this_map_npc_dir = posixpath.join(npc_dir, base)
os.path.isdir(main.this_map_npc_dir) or os.mkdir(main.this_map_npc_dir)
print('Converting %s' % (tmx))
- with open(posixpath.join(main.this_map_npc_dir, NPC_MOBS), 'w') as mobs:
+ try:
+ with open(posixpath.join(main.this_map_npc_dir, NPC_MOBS), 'w') as mobs:
with open(posixpath.join(main.this_map_npc_dir, NPC_CONFIG), 'w') as confs:
with open(posixpath.join(main.this_map_npc_dir, NPC_WARPS), 'w') as warps:
with open(posixpath.join(main.this_map_npc_dir, NPC_IMPORTS), 'w') as imports:
xml.sax.parse(tmx, ContentHandler(main.this_map_npc_dir, mobs, confs, warps, imports))
+ except:
+ traceback.print_exc()
+ print("ERROR: MAP \"%s\" WAS NOT CONVERTED. ERROR FOUND!" % tmx)
+ fatalError=True
if os.path.isfile(posixpath.join(main.this_map_npc_dir, NPC_IMPORTS)):
npc_master.append('@include "%s"\n' % posixpath.join(SERVER_NPCS, base, NPC_IMPORTS))
if heigherror: