fix an oops in last commit, and fix adding cheats via Cheats cheat form
This commit is contained in:
parent
5c22d7433c
commit
9bbd8a07a6
|
@ -103,7 +103,11 @@ namespace BizHawk.Client.Common
|
|||
|
||||
public void Add(Cheat cheat)
|
||||
{
|
||||
if (!cheat.IsSeparator)
|
||||
if (cheat.IsSeparator)
|
||||
{
|
||||
_cheatList.Add(cheat);
|
||||
}
|
||||
else
|
||||
{
|
||||
cheat.Changed += CheatChanged;
|
||||
if (_cheatList.Any(x => x.Domain == cheat.Domain && x.Address == cheat.Address))
|
||||
|
@ -116,7 +120,6 @@ namespace BizHawk.Client.Common
|
|||
}
|
||||
}
|
||||
|
||||
_cheatList.Add(cheat);
|
||||
Changes = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
get
|
||||
{
|
||||
Watch w = Watch.GenerateWatch(
|
||||
Watch watch = Watch.GenerateWatch(
|
||||
ToolHelpers.DomainByName(DomainDropDown.SelectedItem.ToString()),
|
||||
AddressBox.ToRawInt(),
|
||||
GetCurrentSize(),
|
||||
|
@ -274,7 +274,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
NameBox.Text,
|
||||
BigEndianCheckBox.Checked);
|
||||
|
||||
return new Cheat(w, CompareBox.ToRawInt(), enabled: true);
|
||||
return new Cheat(
|
||||
watch,
|
||||
ValueBox.ToRawInt(),
|
||||
!String.IsNullOrWhiteSpace(CompareBox.Text) ? CompareBox.ToRawInt() : (int?)null
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue