From d0bbf383d6c8c251d379e4082645f1d38f7e94cf Mon Sep 17 00:00:00 2001 From: Lior Halphon Date: Sat, 10 Apr 2021 16:10:23 +0300 Subject: [PATCH] Another cheat bugfix --- Core/cheats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/cheats.c b/Core/cheats.c index 8defc6c..c7c43fe 100644 --- a/Core/cheats.c +++ b/Core/cheats.c @@ -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)]; for (unsigned i = 0; i < (*hash)->size; i++) { if ((*hash)->cheats[i] == cheat) { - (*hash)->cheats[i] = (*hash)->cheats[(*hash)->size--]; + (*hash)->cheats[i] = (*hash)->cheats[--(*hash)->size]; if ((*hash)->size == 0) { free(*hash); *hash = NULL;