diff --git a/cheats.c b/cheats.c index 9760169727..ffd8e35bb7 100644 --- a/cheats.c +++ b/cheats.c @@ -171,14 +171,14 @@ void cheat_manager_free(cheat_manager_t *handle) free(handle); } -void cheat_manager_update(cheat_manager_t *handle) +void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx) { msg_queue_clear(g_extern.msg_queue); char msg[256]; snprintf(msg, sizeof(msg), "Cheat: #%u [%s]: %s", - handle->ptr, handle->cheats[handle->ptr].state ? "ON" : "OFF", - (handle->cheats[handle->ptr].desc) ? - (handle->cheats[handle->ptr].desc) : (handle->cheats[handle->ptr].code) + handle_idx, handle->cheats[handle_idx].state ? "ON" : "OFF", + (handle->cheats[handle_idx].desc) ? + (handle->cheats[handle_idx].desc) : (handle->cheats[handle_idx].code) ); msg_queue_push(g_extern.msg_queue, msg, 1, 180); RARCH_LOG("%s\n", msg); @@ -192,7 +192,7 @@ void cheat_manager_toggle(cheat_manager_t *handle) handle->cheats[handle->ptr].state ^= true; cheat_manager_apply_cheats(handle); - cheat_manager_update(handle); + cheat_manager_update(handle, handle->ptr); } void cheat_manager_index_next(cheat_manager_t *handle) @@ -200,7 +200,7 @@ void cheat_manager_index_next(cheat_manager_t *handle) if (!handle) return; handle->ptr = (handle->ptr + 1) % handle->size; - cheat_manager_update(handle); + cheat_manager_update(handle, handle->ptr); } void cheat_manager_index_prev(cheat_manager_t *handle) @@ -213,5 +213,5 @@ void cheat_manager_index_prev(cheat_manager_t *handle) else handle->ptr--; - cheat_manager_update(handle); + cheat_manager_update(handle, handle->ptr); } diff --git a/cheats.h b/cheats.h index a03df9594b..4fbc76128a 100644 --- a/cheats.h +++ b/cheats.h @@ -55,7 +55,7 @@ void cheat_manager_toggle(cheat_manager_t *handle); void cheat_manager_apply_cheats(cheat_manager_t *handle); -void cheat_manager_update(cheat_manager_t *handle); +void cheat_manager_update(cheat_manager_t *handle, unsigned handle_idx); #ifdef __cplusplus } diff --git a/menu/menu_entries_cbs.c b/menu/menu_entries_cbs.c index 38d0323815..2e64e85c68 100644 --- a/menu/menu_entries_cbs.c +++ b/menu/menu_entries_cbs.c @@ -939,7 +939,7 @@ static int action_toggle_cheat(unsigned type, const char *label, case MENU_ACTION_LEFT: case MENU_ACTION_RIGHT: cheat->cheats[idx].state = !cheat->cheats[idx].state; - cheat_manager_update(cheat); + cheat_manager_update(cheat, idx); break; }