fix bounds checks (#3237)

This commit is contained in:
qndel 2021-10-24 17:20:04 +02:00 committed by GitHub
commit 0ccdf940f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 22 deletions

View file

@ -3369,7 +3369,7 @@ void ClrPlrPath(Player &player)
*/
bool PosOkPlayer(const Player &player, Point position)
{
if (position.x < 0 || position.x >= MAXDUNX || position.y < 0 || position.y >= MAXDUNY)
if (!InDungeonBounds(position))
return false;
if (dPiece[position.x][position.y] == 0)
return false;