From e8bae98ea3e842b2a2b72c127cd881a76e9b6d03 Mon Sep 17 00:00:00 2001 From: haven1433 Date: Wed, 19 Jul 2023 21:40:05 -0500 Subject: [PATCH] only consider a script pointer as invalid if it points to something other than XSERun / NoInfoRun --- src/HexManiac.Core/Models/Map/MapModel.cs | 2 ++ src/HexManiac.Core/ViewModels/Map/IEventViewModel.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/HexManiac.Core/Models/Map/MapModel.cs b/src/HexManiac.Core/Models/Map/MapModel.cs index 2c37da39..b95bc39b 100644 --- a/src/HexManiac.Core/Models/Map/MapModel.cs +++ b/src/HexManiac.Core/Models/Map/MapModel.cs @@ -89,6 +89,8 @@ namespace HavenSoft.HexManiac.Core.Models.Map { public ModelTable MapScripts { get => Element.GetSubTable("mapscripts"); } + + public override string ToString() => $"({Group}, {Map})"; } public record LayoutPrototype(int PrimaryBlockset, int SecondaryBlockset, int BorderBlock); diff --git a/src/HexManiac.Core/ViewModels/Map/IEventViewModel.cs b/src/HexManiac.Core/ViewModels/Map/IEventViewModel.cs index 2df003b3..0a1cd703 100644 --- a/src/HexManiac.Core/ViewModels/Map/IEventViewModel.cs +++ b/src/HexManiac.Core/ViewModels/Map/IEventViewModel.cs @@ -269,7 +269,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { } var run = element.Model.GetNextRun(address); - if (run.Start < address || run is not XSERun) { + if (run.Start < address || (run is not XSERun && run is not NoInfoRun)) { ScriptAddressError = IsValidScriptFreespace(address) ? "Freespace found at that address." : "No script found at that address."; HasScriptAddressError = true; return;