Use bit math to keep player from leaving the map

This commit is contained in:
Pyrex 2022-12-30 23:38:08 -08:00
parent ba14cc18f2
commit 08fa3cd46e

View File

@ -554,6 +554,7 @@ function level:can_move(
if (is_player and self:win_at(mx1,my1)) return true if (is_player and self:win_at(mx1,my1)) return true
if (is_player and self:get_open_pit(mx1,my1)) return wrongbleep:adequately_warned() if (is_player and self:get_open_pit(mx1,my1)) return wrongbleep:adequately_warned()
if ((mx1 | my1) & 0xFFF0!=0) return false
if (self:mcoll(mx1,my1) or player.x==mx1 and player.y==my1) return if (self:mcoll(mx1,my1) or player.x==mx1 and player.y==my1) return
if player.rope then if player.rope then