From 4a35c39bbc9ffdcbf15953cb699fc8147ccce25d Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 2 Feb 2020 16:43:24 +0100 Subject: [PATCH] added limiting amoeba handling in EM engine to the playfield area This does not make a difference now, but will do when support for wrap-around levels is added (which will result in accessing tiles of the regular playfield via linked playfield buffer columns that will redirect off-playfield access to the opposite side of the playfield). --- src/game_em/logic.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game_em/logic.c b/src/game_em/logic.c index 89de4ee5..d126415b 100644 --- a/src/game_em/logic.c +++ b/src/game_em/logic.c @@ -6337,7 +6337,9 @@ void logic_3(void) x = lev.left - 1 + (random >> 10) % CAVE_WIDTH; y = lev.top - 1 + (random >> 20) % CAVE_HEIGHT; - Lamoeba(x, y); + if (x >= lev.left && x < lev.right && + y >= lev.top && y < lev.bottom) + Lamoeba(x, y); random = random * 129 + 1; } -- 2.34.1