diff --git a/src/HexManiac.Core/Core/SystemExtensions.cs b/src/HexManiac.Core/Core/SystemExtensions.cs index 32cb70c1..83ec3bcd 100644 --- a/src/HexManiac.Core/Core/SystemExtensions.cs +++ b/src/HexManiac.Core/Core/SystemExtensions.cs @@ -183,6 +183,7 @@ namespace HavenSoft.HexManiac.Core { } public static bool MatchesPartial(this string full, string partial, bool onlyCheckLettersAndDigits = false) { + if (full == null) return false; return MatchLength(full, partial, onlyCheckLettersAndDigits) == partial.Length; } diff --git a/src/HexManiac.Tests/CodeToolTests.cs b/src/HexManiac.Tests/CodeToolTests.cs index 84ee2e8d..e84207dc 100644 --- a/src/HexManiac.Tests/CodeToolTests.cs +++ b/src/HexManiac.Tests/CodeToolTests.cs @@ -5,6 +5,7 @@ using HavenSoft.HexManiac.Core.Models.Runs; using HavenSoft.HexManiac.Core.ViewModels.Tools; using HavenSoft.HexManiac.Core.ViewModels.Visitors; using System; +using System.Collections.Generic; using System.Linq; using Xunit; @@ -574,6 +575,20 @@ You said no! Assert.Equal(2, Tool.Contents.Count); } + [Fact] + public void AnimationScript_PlaySeWithPan_CanDecode() { + var animationpan = new List(192.Range(i => null)); + animationpan[63] = "sound_pan_target"; + ViewPort.Model.SetList(nameof(animationpan), animationpan); + + ViewPort.Edit("19 00 00 00 "); + Tool.Mode = CodeMode.AnimationScript; + ViewPort.Goto.Execute(0); + var help = Tool.AnimationScriptParser.GetHelp(ViewPort.Model, new HelpContext("playsewithpan mus_dummy 0", 25)); + + Assert.NotNull(help); + } + // TODO test that we get an error (not an exception) if we do auto on an unformatted pointer } }