From 721f22277458cb419ca6499e71d3e204f3806a9e Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sun, 17 Jul 2022 04:42:35 +0200 Subject: [PATCH] character: Handle negative offsets in IsOnCharacter --- src/character.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/character.c b/src/character.c index f691ebc..56ad242 100644 --- a/src/character.c +++ b/src/character.c @@ -890,7 +890,7 @@ SYMBOL_EXPORT bool IsOnCharacter(struct Game* game, struct Character* character, return false; } - float x1 = 0.0, y1 = 0.0; + float x1 = MIN(0.0, character->spritesheet->offsetX) + MIN(0.0, character->frame->x), y1 = MIN(0.0, character->spritesheet->offsetY) + MIN(0.0, character->frame->y); float x2 = character->spritesheet->width, y2 = character->spritesheet->height; ALLEGRO_TRANSFORM transform = GetCharacterTransform(game, character);