mirror of
https://github.com/haven1433/HexManiacAdvance.git
synced 2026-10-01 20:56:36 -05:00
guard code for FindMacro
This commit is contained in:
@@ -64,12 +64,6 @@ namespace HavenSoft.HexManiac.Core.Models {
|
||||
public static class PCSString {
|
||||
private const string TextReferenceFileName = "resources/pcsReference.txt";
|
||||
|
||||
public static IReadOnlyList<string> PCS;
|
||||
public static IReadOnlySet<string> ValidInProgressEscapes;
|
||||
public static IReadOnlyList<byte> Newlines;
|
||||
public static IReadOnlyDictionary<byte, byte> ControlCodeLengths;
|
||||
public static IReadOnlyDictionary<string, IReadOnlyDictionary<string, byte[]>> TextMacros;
|
||||
public static IReadOnlyDictionary<string, IReadOnlyList<IReadOnlyDictionary<string, byte[]>>> TextMacrosIndex;
|
||||
|
||||
public static readonly byte DynamicEscape = 0xF7;
|
||||
public static readonly byte FunctionEscape = 0xFC;
|
||||
@@ -581,6 +575,7 @@ namespace HavenSoft.HexManiac.Core.Models {
|
||||
}
|
||||
|
||||
private static string FindMacro(IReadOnlyList<IReadOnlyDictionary<string, byte[]>> macrosIndex, IReadOnlyList<byte> data, int index) {
|
||||
if (!index.InRange(0, data.Count)) return null;
|
||||
var macros = macrosIndex[data[index]];
|
||||
if (macros == null) return null;
|
||||
foreach (var kvp in macros) {
|
||||
|
||||
Reference in New Issue
Block a user