mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
- SW: better handling for bogus ladders.
If there is no back sector, use the front sector of the wall as the ladder sector. This at least fixes the badly defined ladder in Wanton Destruction's first map.
This commit is contained in:
parent
d14d539144
commit
645ea1e1ae
1 changed files with 7 additions and 5 deletions
|
@ -3462,7 +3462,11 @@ DoPlayerClimb(PLAYERp pp)
|
|||
|
||||
DoPlayerZrange(pp);
|
||||
|
||||
ASSERT(pp->LadderSector >= 0 && pp->LadderSector <= MAXSECTORS);
|
||||
if (pp->LadderSector < 0 || pp->LadderSector > MAXSECTORS)
|
||||
{
|
||||
Printf("Bad ladder sector!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// moving UP
|
||||
if (climbvel > 0)
|
||||
|
@ -3573,8 +3577,6 @@ DoPlayerClimb(PLAYERp pp)
|
|||
|
||||
if (wal >= 0)
|
||||
{
|
||||
pp->LadderSector = wall[wal].nextsector;
|
||||
|
||||
lsp = FindNearSprite(pp->SpriteP, STAT_CLIMB_MARKER);
|
||||
|
||||
// determine where the player is supposed to be in relation to the ladder
|
||||
|
@ -3583,7 +3585,7 @@ DoPlayerClimb(PLAYERp pp)
|
|||
ny = MOVEy(100, lsp->ang);
|
||||
|
||||
// set ladder sector
|
||||
pp->LadderSector = wall[wal].nextsector;
|
||||
pp->LadderSector = wall[wal].nextsector >= 0? wall[wal].nextsector : wall[wal].sector;
|
||||
|
||||
// set players "view" distance from the ladder - needs to be farther than
|
||||
// the sprite
|
||||
|
@ -3994,7 +3996,7 @@ PlayerOnLadder(PLAYERp pp)
|
|||
}
|
||||
#endif
|
||||
|
||||
pp->LadderSector = wall[wal].nextsector;
|
||||
pp->LadderSector = wall[wal].nextsector >= 0 ? wall[wal].nextsector : wall[wal].sector;
|
||||
//DSPRINTF(ds, "Ladder Sector %d", pp->LadderSector);
|
||||
MONO_PRINT(ds);
|
||||
|
||||
|
|
Loading…
Reference in a new issue