From bd87bcf8afb755e2a215ad939508a7277a3f851d Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 18 Jun 2023 13:45:53 +0200 Subject: [PATCH] bbminy in _collision_circle_aabb is now calculated correctly using y --- src/corelib/world.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/world.c b/src/corelib/world.c index fa92ea7..85fbed4 100644 --- a/src/corelib/world.c +++ b/src/corelib/world.c @@ -110,7 +110,7 @@ static inline short _collision_circle_aabb(const object_t* circle, const object_t* aabb) { // generate a point on the edge of the rectangle that is closest to the circle const float bbminx = aabb->collider.aabb.x + aabb->sprite.x, bbmaxx = bbminx + aabb->collider.aabb.w, - bbminy = aabb->collider.aabb.y + aabb->sprite.x, bbmaxy = bbminy + aabb->collider.aabb.h; + bbminy = aabb->collider.aabb.y + aabb->sprite.y, bbmaxy = bbminy + aabb->collider.aabb.h; const float cx = circle->sprite.x + circle->collider.circle.x, cy = circle->sprite.y + circle->collider.circle.y; const float x = fclampf(cx, bbminx, bbmaxx),