Changed the check in game_change_state() to full bounds checking
This commit is contained in:
+2
-2
@@ -1270,12 +1270,12 @@ void game_change_state(enum GameState new_game_state)
|
||||
timer = TM_ZERO; // Reset the timer
|
||||
|
||||
state_info[game_state].substate = 0;
|
||||
if (game_state != GAME_STATE_UNDEFINED)
|
||||
if (game_state >= 0 && game_state < GAME_STATE_MAX)
|
||||
{
|
||||
state_info[game_state].on_exit();
|
||||
}
|
||||
|
||||
if (new_game_state != GAME_STATE_UNDEFINED)
|
||||
if (new_game_state >= 0 && new_game_state < GAME_STATE_MAX)
|
||||
{
|
||||
state_info[new_game_state].on_init();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user