Runloop - early return if g_extern.cheat is NULL

This commit is contained in:
twinaphex 2014-12-15 06:57:38 +01:00
parent 6c338352d2
commit c899d3d7ef

View File

@ -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;
}