From 4b19c6f46ee4ba9aeb067e0384a5c2b1a1b1b9b1 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 18 Jan 2023 18:51:54 +0100 Subject: [PATCH] fixed bug with cutting through laser emitter in special cases in MM engine While the laser beam can be pointed at the middle of the laser emitter element, and also can slightly touch it at its very edges, it should not be possible to cut through it nearer to the middle, but without really hitting the middle of the laser emitter. --- src/game_mm/mm_game.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 48bc9a5b..bb027cd0 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -1473,6 +1473,10 @@ boolean HitElement(int element, int hit_mask) // this is more precise: check if laser would go through the center if ((ELX * TILEX + 14 - LX) * YS != (ELY * TILEY + 14 - LY) * XS) { + // prevent cutting through laser emitter with laser beam + if (IS_LASER(element)) + return TRUE; + // skip the whole element before continuing the scan do { -- 2.34.1