gamestates: mark gamestate as started before launching Gamestate_Start

This change allows to stop the current gamestate from Gamestate_Start.
This commit is contained in:
Sebastian Krzyszkowiak 2016-09-04 01:26:41 +02:00
parent 3b6f79de29
commit 26843776a2

View file

@ -344,10 +344,10 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game *game) {
PrintConsole(game, "Starting gamestate \"%s\"...", tmp->name);
al_stop_timer(game->_priv.timer);
game->_priv.current_gamestate = tmp;
(*tmp->api->Gamestate_Start)(game, tmp->data);
al_resume_timer(game->_priv.timer);
tmp->started = true;
tmp->pending_start = false;
(*tmp->api->Gamestate_Start)(game, tmp->data);
al_resume_timer(game->_priv.timer);
}
if ((tmp->started) || (tmp->pending_start) || (tmp->pending_load)) gameActive = true;