use validSectorIndex checks where appropriate.

Let’s hope that this sloppiness doesn’t have negative effects with broken maps.

# Conflicts:
#	source/games/sw/src/sprite.cpp

# Conflicts:
#	source/games/duke/src/prediction.cpp
#	source/games/duke/src/render.cpp
This commit is contained in:
Christoph Oelckers 2021-11-09 09:06:54 +01:00
parent ae8e642785
commit 999ec3c95a
36 changed files with 86 additions and 91 deletions

View file

@ -3285,9 +3285,9 @@ void DoPlayerClimb(PLAYERp pp)
DoPlayerZrange(pp);
if (pp->LadderSector < 0 || pp->LadderSector > MAXSECTORS)
if (!validSectorIndex(pp->LadderSector))
{
Printf("Bad ladder sector!\n");
Printf("Bad ladder sector %d!\n", pp->LadderSector);
return;
}