Core: Fix some cheats API change fallout (fixes #2053)
Vicki Pfau vi@endrift.com
Tue, 23 Feb 2021 22:36:23 -0800
2 files changed,
9 insertions(+),
3 deletions(-)
M
src/core/cheats.c
→
src/core/cheats.c
@@ -775,7 +775,9 @@ struct mCheatDevice* device = (struct mCheatDevice*) component;
size_t i; for (i = 0; i < mCheatSetsSize(&device->cheats); ++i) { struct mCheatSet* cheats = *mCheatSetsGetPointer(&device->cheats, i); - cheats->add(cheats, device); + if (cheats->add) { + cheats->add(cheats, device); + } } }@@ -784,6 +786,8 @@ struct mCheatDevice* device = (struct mCheatDevice*) component;
size_t i; for (i = mCheatSetsSize(&device->cheats); i--;) { struct mCheatSet* cheats = *mCheatSetsGetPointer(&device->cheats, i); - cheats->remove(cheats, device); + if (cheats->remove) { + cheats->remove(cheats, device); + } } }
M
src/platform/qt/CheatsView.cpp
→
src/platform/qt/CheatsView.cpp
@@ -165,6 +165,8 @@ m_model.beginAppendRow(index);
mCheatAddLine(set, string.toUtf8().constData(), codeType); m_model.endAppendRow(); } - set->refresh(set, m_controller->cheatDevice()); + if (set->refresh) { + set->refresh(set, m_controller->cheatDevice()); + } m_ui.codeEntry->clear(); }