From 8fe925f30de5f9e1398dd38a6e254e03d1a07452 Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 17 Jul 2022 02:28:44 +0200 Subject: [PATCH] character: Fix handling of one frame spritesheets with bidir --- src/character.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/character.c b/src/character.c index 042cc97..ce248f6 100644 --- a/src/character.c +++ b/src/character.c @@ -639,7 +639,9 @@ SYMBOL_EXPORT void AnimateCharacter(struct Game* game, struct Character* charact if (character->frame->start) { if (character->spritesheet->bidir) { - character->pos++; + if (!character->frame->end) { + character->pos++; + } character->reversing = false; if (!character->reversed) { reachedEnd = true; @@ -659,7 +661,9 @@ SYMBOL_EXPORT void AnimateCharacter(struct Game* game, struct Character* charact QuitGame(game, false); return; } - character->pos--; + if (!character->frame->start) { + character->pos--; + } character->reversing = true; if (character->reversed) { reachedEnd = true;