Cheats: Retain enabled state when updating existing cheat.
Fix inverted logic in Qt cheat window.
This commit is contained in:
parent
8f41776532
commit
738e53989e
@ -518,10 +518,14 @@ int S9xModifyCheatGroup(uint32 num, const std::string &name, const std::string &
|
||||
if (num >= Cheat.group.size())
|
||||
return -1;
|
||||
|
||||
bool enabled = Cheat.group[num].enabled;
|
||||
S9xDisableCheatGroup(num);
|
||||
|
||||
Cheat.group[num] = S9xCreateCheatGroup(name, cheat);
|
||||
|
||||
if (enabled)
|
||||
S9xEnableCheatGroup(num);
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ void CheatsDialog::addCode()
|
||||
if (description.empty())
|
||||
description = tr("No description").toStdString();
|
||||
|
||||
if (app->addCheat(description, code))
|
||||
if (!app->addCheat(description, code))
|
||||
{
|
||||
QMessageBox::information(this, tr("Invalid Cheat"), tr("The cheat you entered was not valid."));
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user