From ededdb488b5e424bbc9002792dbeebf5ca76233b Mon Sep 17 00:00:00 2001 From: En Yi Date: Mon, 13 May 2024 21:51:52 +0800 Subject: [PATCH] Fix off-by-one error in one-way tile check --- scenes/game_systems.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index b4a0d48..ecce47e 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -118,8 +118,8 @@ static bool check_collision_and_move( { // One way collision is a bit special if ( - p_ct->prev_position.y + p_bbox->size.y - 1 < other_pos->y - && ent->position.y + p_bbox->size.y - 1 >= other_pos->y + p_ct->prev_position.y + p_bbox->size.y < other_pos->y + && ent->position.y + p_bbox->size.y >= other_pos->y ) { offset.y = other_pos->y - (ent->position.y + p_bbox->size.y);