Don't freeze first selection in HexEditor when freezing was canceled

- fixes #3833

The entire "primary highlight" + n "secondary highlights" system seems overengineered, but I chose to just fix this in the simplest way possible.
This commit is contained in:
Morilli 2024-06-16 19:54:54 +02:00
parent b904041edd
commit 85886bc2cd
1 changed files with 4 additions and 4 deletions

View File

@ -854,6 +854,7 @@ namespace BizHawk.Client.EmuHawk
return;
}
var cheats = new List<Cheat>();
if (_highlightedAddress >= 0)
{
var watch = Watch.GenerateWatch(
@ -863,14 +864,13 @@ namespace BizHawk.Client.EmuHawk
Common.WatchDisplayType.Hex,
BigEndian);
MainForm.CheatList.Add(new Cheat(
cheats.Add(new Cheat(
watch,
watch.Value));
}
if (_secondaryHighlightedAddresses.Any())
{
var cheats = new List<Cheat>();
foreach (var address in _secondaryHighlightedAddresses)
{
var watch = Watch.GenerateWatch(
@ -884,10 +884,10 @@ namespace BizHawk.Client.EmuHawk
watch,
watch.Value));
}
MainForm.CheatList.AddRange(cheats);
}
MainForm.CheatList.AddRange(cheats);
MemoryViewerBox.Refresh();
}