mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 21:32:45 +00:00
Runloop - early return if g_extern.cheat is NULL
This commit is contained in:
parent
6c338352d2
commit
c899d3d7ef
16
runloop.c
16
runloop.c
@ -434,12 +434,6 @@ static int do_state_checks(
|
||||
|
||||
check_shader_dir_func(trigger_input);
|
||||
|
||||
if (BIT64_GET(trigger_input, RARCH_CHEAT_INDEX_PLUS))
|
||||
cheat_manager_index_next(g_extern.cheat);
|
||||
else if (BIT64_GET(trigger_input, RARCH_CHEAT_INDEX_MINUS))
|
||||
cheat_manager_index_prev(g_extern.cheat);
|
||||
else if (BIT64_GET(trigger_input, RARCH_CHEAT_TOGGLE))
|
||||
cheat_manager_toggle(g_extern.cheat);
|
||||
|
||||
if (BIT64_GET(trigger_input, RARCH_DISK_EJECT_TOGGLE))
|
||||
rarch_main_command(RARCH_CMD_DISK_EJECT_TOGGLE);
|
||||
@ -451,6 +445,16 @@ static int do_state_checks(
|
||||
if (BIT64_GET(trigger_input, RARCH_RESET))
|
||||
rarch_main_command(RARCH_CMD_RESET);
|
||||
|
||||
if (!g_extern.cheat)
|
||||
return 0;
|
||||
|
||||
if (BIT64_GET(trigger_input, RARCH_CHEAT_INDEX_PLUS))
|
||||
cheat_manager_index_next(g_extern.cheat);
|
||||
else if (BIT64_GET(trigger_input, RARCH_CHEAT_INDEX_MINUS))
|
||||
cheat_manager_index_prev(g_extern.cheat);
|
||||
else if (BIT64_GET(trigger_input, RARCH_CHEAT_TOGGLE))
|
||||
cheat_manager_toggle(g_extern.cheat);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user