Fix a bug where Knuckles could clamber at negative Y position

This commit is contained in:
Lucas S. Vieira 2025-04-15 22:40:50 -03:00
parent 4488cb53b2
commit d9f3ce15fb

View file

@ -356,9 +356,16 @@ _player_update_collision_lr(Player *player)
player->ev_climbdrop = linecast(&leveldata, &map128, &map16, player->ev_climbdrop = linecast(&leveldata, &map128, &map16,
anchorx, drop_anchory, anchorx, drop_anchory,
dir, radius, CDIR_FLOOR); dir, radius, CDIR_FLOOR);
player->ev_clamber = linecast(&leveldata, &map128, &map16,
anchorx, clamber_anchory, // If the clamber Y anchor is negative, always return the collision
dir, radius, CDIR_FLOOR); // as true. This prevents the player from climbing over ledges that
// are offscreen
if(clamber_anchory <= 0) player->ev_clamber.collided = 1;
else {
player->ev_clamber = linecast(&leveldata, &map128, &map16,
anchorx, clamber_anchory,
dir, radius, CDIR_FLOOR);
}
return; return;
} }