From 35f1345406786e642b87ddd49c884b391176a85f Mon Sep 17 00:00:00 2001 From: aglab2 Date: Tue, 10 Jul 2018 09:57:41 +0300 Subject: [PATCH] Added try-catch to support more ROMs with malformed 22 cmds --- src/Scripts/LevelScripts.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Scripts/LevelScripts.cs b/src/Scripts/LevelScripts.cs index 92f1e9a..2db0a7f 100644 --- a/src/Scripts/LevelScripts.cs +++ b/src/Scripts/LevelScripts.cs @@ -470,8 +470,12 @@ private static void CMD_22(ref Level lvl, ref string desc, byte[] cmd) lvl.AddObjectCombos(modelID, newModel.GeoDataSegAddress); if (rom.getSegment(seg) != null) { - GeoScripts.resetNodes(); - GeoScripts.parse(ref newModel, ref lvl, seg, off); + try + { + GeoScripts.resetNodes(); + GeoScripts.parse(ref newModel, ref lvl, seg, off); + } + catch (Exception) { } } if (lvl.ModelIDs.ContainsKey(modelID)) lvl.ModelIDs.Remove(modelID);