Another cheat bugfix
This commit is contained in:
parent
e6fa2336da
commit
d0bbf383d6
@ -109,7 +109,7 @@ void GB_remove_cheat(GB_gameboy_t *gb, const GB_cheat_t *cheat)
|
|||||||
GB_cheat_hash_t **hash = &gb->cheat_hash[hash_addr(cheat->address)];
|
GB_cheat_hash_t **hash = &gb->cheat_hash[hash_addr(cheat->address)];
|
||||||
for (unsigned i = 0; i < (*hash)->size; i++) {
|
for (unsigned i = 0; i < (*hash)->size; i++) {
|
||||||
if ((*hash)->cheats[i] == cheat) {
|
if ((*hash)->cheats[i] == cheat) {
|
||||||
(*hash)->cheats[i] = (*hash)->cheats[(*hash)->size--];
|
(*hash)->cheats[i] = (*hash)->cheats[--(*hash)->size];
|
||||||
if ((*hash)->size == 0) {
|
if ((*hash)->size == 0) {
|
||||||
free(*hash);
|
free(*hash);
|
||||||
*hash = NULL;
|
*hash = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user