From ff02a68cc7ffd4d49eafdda3a163cc74cfcd2bc5 Mon Sep 17 00:00:00 2001 From: Benjamin Popp Date: Fri, 5 Jul 2019 13:29:33 -0500 Subject: [PATCH] caching bugfix --- src/HexManiac.Core/Models/PokemonModel.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/HexManiac.Core/Models/PokemonModel.cs b/src/HexManiac.Core/Models/PokemonModel.cs index 97e2e4ac..7f23ca89 100644 --- a/src/HexManiac.Core/Models/PokemonModel.cs +++ b/src/HexManiac.Core/Models/PokemonModel.cs @@ -378,9 +378,11 @@ namespace HavenSoft.HexManiac.Core.Models { if (!(run is ArrayRun array)) return false; if ((address - array.Start) % array.ElementLength != 0) return false; - var index = (address - array.Start) / array.ElementLength; - if (array.ElementNames.Count == 0) return false; - header = array.ElementNames[index]; + using (ModelCacheScope.CreateScope(this)) { + var index = (address - array.Start) / array.ElementLength; + if (array.ElementNames.Count == 0) return false; + header = array.ElementNames[index]; + } return true; }