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

@ -18,7 +18,7 @@ namespace {
void RepeatWalk(Player &player)
{
if (cursPosition.x < 0 || cursPosition.x >= MAXDUNX - 1 || cursPosition.y < 0 || cursPosition.y >= MAXDUNY - 1)
if (!InDungeonBounds(cursPosition))
return;
if (player._pmode != PM_STAND && !(player.IsWalking() && player.AnimInfo.GetFrameToUseForRendering() > 6))