diff --git a/macosx/mac-cheat.cpp b/macosx/mac-cheat.cpp index 88165504..6e56c3b8 100755 --- a/macosx/mac-cheat.cpp +++ b/macosx/mac-cheat.cpp @@ -296,7 +296,7 @@ static void DetachCheatItems (void) char code[10]; snprintf(code, 10, "%x=%x", citem[i].address, citem[i].value); int index = S9xAddCheatGroup(citem[i].description, code); - if(citem[i].enabled) + if(citem[i].enabled && index >= 0) S9xEnableCheatGroup(index); } } diff --git a/macosx/mac-cheatfinder.cpp b/macosx/mac-cheatfinder.cpp index e0155ddc..45493549 100755 --- a/macosx/mac-cheatfinder.cpp +++ b/macosx/mac-cheatfinder.cpp @@ -1470,7 +1470,8 @@ static void CheatFinderAddEntry (SInt64 value, char *description) char code[10]; snprintf(code, 10, "%x=%x", addr + i + 0x7E0000, (UInt8) ((v & (0x000000FF << (i * 8))) >> (i * 8))); int index = S9xAddCheatGroup(description, code); - S9xEnableCheatGroup(index); + if(index >= 0) + S9xEnableCheatGroup(index); } }