From: Holger Schemel Date: Mon, 3 Apr 2023 09:09:04 +0000 (+0200) Subject: fixed moving tile cursor off the visible playfield area in MM engine X-Git-Tag: 4.3.5.4~1 X-Git-Url: https://git.artsoft.org/rocksndiamonds.git/?a=commitdiff_plain;h=1b1972065887ca03077a3f0fc1af51f9bdaed9a2;p=rocksndiamonds.git fixed moving tile cursor off the visible playfield area in MM engine --- diff --git a/src/events.c b/src/events.c index 2810e84f..e03f58f9 100644 --- a/src/events.c +++ b/src/events.c @@ -2556,10 +2556,10 @@ static void HandleTileCursor(int dx, int dy, int button) int new_xpos = tile_cursor.xpos + dx; int new_ypos = tile_cursor.ypos + dy; - if (!IN_LEV_FIELD(new_xpos, old_ypos)) + if (!IN_LEV_FIELD(new_xpos, old_ypos) || !IN_SCR_FIELD(new_xpos, old_ypos)) new_xpos = old_xpos; - if (!IN_LEV_FIELD(old_xpos, new_ypos)) + if (!IN_LEV_FIELD(old_xpos, new_ypos) || !IN_SCR_FIELD(old_xpos, new_ypos)) new_ypos = old_ypos; SetTileCursorTargetXY(new_xpos, new_ypos);