From 85ef3652769270e44ac5ebf7455ef5ecf62a89fa Mon Sep 17 00:00:00 2001 From: Zurphing <72351816+Zurphing@users.noreply.github.com> Date: Mon, 29 Jul 2024 19:26:40 -0400 Subject: [PATCH] tr02 crash fix w/ try/catch --- OpenKh.Kh2/ModelMultiple.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/OpenKh.Kh2/ModelMultiple.cs b/OpenKh.Kh2/ModelMultiple.cs index 453083d33..f8dfbdaf6 100644 --- a/OpenKh.Kh2/ModelMultiple.cs +++ b/OpenKh.Kh2/ModelMultiple.cs @@ -1,15 +1,28 @@ -using System; +using System; using System.IO; namespace OpenKh.Kh2 { public class ModelMultiple : Model { + private bool _isParsedSuccessfully; + private string _errorMessage; + public ModelMultiple(Stream stream) { - throw new NotImplementedException(); + try + { + //Parse Logic, doesn't work for now but fixes the crash for tr02/etc. + _isParsedSuccessfully = true; + } + catch (Exception ex) + { + _isParsedSuccessfully = false; + _errorMessage = ex.Message; + } } + public override int GroupCount => 0; protected override void InternalWrite(Stream stream)