From 39ff3313e8bb29ff1a8309b1a82184c5b9dd799e Mon Sep 17 00:00:00 2001 From: En Yi Date: Thu, 6 Jul 2023 21:53:34 +0800 Subject: [PATCH] Fix incorrect offset to check for uncrouching --- scenes/game_systems.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scenes/game_systems.c b/scenes/game_systems.c index a0d594f..9b1a346 100644 --- a/scenes/game_systems.c +++ b/scenes/game_systems.c @@ -700,7 +700,10 @@ void player_movement_input_system(Scene_t* scene) } } - uint8_t collide_type = check_collision_offset(p_player, p_ctransform->position, p_bbox->size, &tilemap, (Vector2){0, -TILE_SIZE}); + uint8_t collide_type = check_collision_offset( + p_player, p_ctransform->position, p_bbox->size, + &tilemap, (Vector2){0, p_bbox->size.y - PLAYER_HEIGHT} + ); if (collide_type == 1) { p_pstate->is_crouch |= 0b10;