Remove global definition of badCheatHandle

This commit is contained in:
wheremyfoodat
2024-01-27 20:38:17 +02:00
parent 31eea40ea5
commit 01b6380242
4 changed files with 19 additions and 23 deletions

View File

@@ -239,7 +239,6 @@ void MainWindow::showAboutMenu() {
}
void MainWindow::openLuaEditor() { luaEditor->show(); }
void MainWindow::openCheatsEditor() { cheatsEditor->show(); }
void MainWindow::dispatchMessage(const EmulatorMessage& message) {
@@ -259,7 +258,7 @@ void MainWindow::dispatchMessage(const EmulatorMessage& message) {
u32 handle = message.cheat.c->handle;
const std::vector<uint8_t>& cheat = message.cheat.c->cheat;
const std::function<void(u32)>& callback = message.cheat.c->callback;
bool isEditing = handle != badCheatHandle;
bool isEditing = handle != Cheats::badCheatHandle;
if (isEditing) {
emu->getCheats().removeCheat(handle);
u32 handle = emu->getCheats().addCheat(cheat.data(), cheat.size());