diff --git a/src/character.c b/src/character.c index b121a37..67ea6dd 100644 --- a/src/character.c +++ b/src/character.c @@ -635,7 +635,7 @@ SYMBOL_EXPORT void AnimateCharacter(struct Game* game, struct Character* charact int pos = character->pos; - while (character->delta >= character->frame->duration) { + while (character->frame && character->delta >= character->frame->duration) { bool reachedEnd = false; character->delta -= character->frame->duration; diff --git a/src/internal.c b/src/internal.c index 9706de8..fa4551a 100644 --- a/src/internal.c +++ b/src/internal.c @@ -57,7 +57,7 @@ SYMBOL_INTERNAL void DrawGamestates(struct Game* game) { } tmp = tmp->next; } - if (game->loading.shown && game->_priv.loading.gamestate->api->predraw) { + if (game->loading.shown && game->_priv.loading.gamestate && game->_priv.loading.gamestate->api->predraw) { game->_priv.current_gamestate = game->_priv.loading.gamestate; game->_priv.loading.gamestate->api->predraw(game, game->_priv.loading.gamestate->data); }