forked from pyrex/chameleonic
Use bit math to keep player from leaving the map
This commit is contained in:
parent
ba14cc18f2
commit
08fa3cd46e
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user