Fix incorrect offset to check for uncrouching

scene_man
En Yi 2023-07-06 21:53:34 +08:00
parent 8c924956a8
commit 39ff3313e8
1 changed files with 4 additions and 1 deletions

View File

@ -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;