Fix off-by-one error in one-way tile check

scene_man
En Yi 2024-05-13 21:51:52 +08:00
parent 8765500606
commit ededdb488b
1 changed files with 2 additions and 2 deletions

View File

@ -118,8 +118,8 @@ static bool check_collision_and_move(
{ {
// One way collision is a bit special // One way collision is a bit special
if ( if (
p_ct->prev_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 - 1 >= 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); offset.y = other_pos->y - (ent->position.y + p_bbox->size.y);