From: Holger Schemel Date: Wed, 18 Jan 2023 17:51:54 +0000 (+0100) Subject: fixed bug with cutting through laser emitter in special cases in MM engine X-Git-Tag: 4.3.5.0~36 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=4b19c6f46ee4ba9aeb067e0384a5c2b1a1b1b9b1;p=rocksndiamonds.git 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. --- 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 {