character: Fix handling of one frame spritesheets with bidir

This commit is contained in:
Sebastian Krzyszkowiak 2022-07-17 02:28:44 +02:00
parent 51e0a25734
commit 8fe925f30d
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -639,7 +639,9 @@ SYMBOL_EXPORT void AnimateCharacter(struct Game* game, struct Character* charact
if (character->frame->start) { if (character->frame->start) {
if (character->spritesheet->bidir) { if (character->spritesheet->bidir) {
if (!character->frame->end) {
character->pos++; character->pos++;
}
character->reversing = false; character->reversing = false;
if (!character->reversed) { if (!character->reversed) {
reachedEnd = true; reachedEnd = true;
@ -659,7 +661,9 @@ SYMBOL_EXPORT void AnimateCharacter(struct Game* game, struct Character* charact
QuitGame(game, false); QuitGame(game, false);
return; return;
} }
if (!character->frame->start) {
character->pos--; character->pos--;
}
character->reversing = true; character->reversing = true;
if (character->reversed) { if (character->reversed) {
reachedEnd = true; reachedEnd = true;