mirror of
https://github.com/luksamuk/engine-psx.git
synced 2025-04-28 13:28:02 +03:00
Fix a bug where Knuckles could clamber at negative Y position
This commit is contained in:
parent
4488cb53b2
commit
d9f3ce15fb
1 changed files with 10 additions and 3 deletions
13
src/player.c
13
src/player.c
|
@ -356,9 +356,16 @@ _player_update_collision_lr(Player *player)
|
|||
player->ev_climbdrop = linecast(&leveldata, &map128, &map16,
|
||||
anchorx, drop_anchory,
|
||||
dir, radius, CDIR_FLOOR);
|
||||
player->ev_clamber = linecast(&leveldata, &map128, &map16,
|
||||
anchorx, clamber_anchory,
|
||||
dir, radius, CDIR_FLOOR);
|
||||
|
||||
// If the clamber Y anchor is negative, always return the collision
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue