mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
Minor robustness improvements to map importing.
Allow map parse errors to be reported propertly (the raise was for debugging) and give up gracefully when the wad file can't be found.
This commit is contained in:
parent
995547ae6f
commit
7204f8d90d
1 changed files with 7 additions and 3 deletions
|
@ -190,7 +190,6 @@ def import_map(operator, context, filepath):
|
|||
try:
|
||||
entities = parse_map (filepath)
|
||||
except MapError as err:
|
||||
raise
|
||||
operator.report({'ERROR'}, repr(err))
|
||||
return {'CANCELLED'}
|
||||
wads=[]
|
||||
|
@ -204,8 +203,13 @@ def import_map(operator, context, filepath):
|
|||
try:
|
||||
wads[i] = WadFile.load(os.path.join(wadpath, wads[i]))
|
||||
except IOError:
|
||||
wads[i] = WadFile.load(os.path.join(wadpath,
|
||||
os.path.basename(wads[i])))
|
||||
try:
|
||||
wads[i] = WadFile.load(os.path.join(wadpath,
|
||||
os.path.basename(wads[i])))
|
||||
except IOError:
|
||||
#give up
|
||||
operator.report({'INFO'}, "Cant't find %s" % wads[i])
|
||||
wads[i] = None
|
||||
for ent in entities:
|
||||
process_entity(ent, wads)
|
||||
bpy.context.user_preferences.edit.use_global_undo = True
|
||||
|
|
Loading…
Reference in a new issue