Skip to content

Commit

Permalink
macOS: only try to enable valid cheats
Browse files Browse the repository at this point in the history
  • Loading branch information
OV2 committed Jul 3, 2018
1 parent b65b071 commit 843c460
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion macosx/mac-cheat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
3 changes: 2 additions & 1 deletion macosx/mac-cheatfinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 843c460

Please sign in to comment.