From: Holger Schemel Date: Fri, 19 May 2023 10:37:12 +0000 (+0200) Subject: moved code for handling wall side of slope for MM engine X-Git-Tag: 4.3.6.0~8 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=5537830044f511561297b9803d869e88b0eb0b1d;p=rocksndiamonds.git moved code for handling wall side of slope for MM engine --- diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 24507681..46f914de 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -1328,22 +1328,6 @@ static void ScanLaser(void) break; } } - else if (IS_DF_SLOPE(element)) - { - if (hit_mask == HIT_MASK_LEFT || - hit_mask == HIT_MASK_RIGHT || - hit_mask == HIT_MASK_TOP || - hit_mask == HIT_MASK_BOTTOM) - { - if (HitReflectingWalls(element, hit_mask)) - break; - } - else - { - if (HitElement(element, hit_mask)) - break; - } - } else { if (HitElement(element, hit_mask)) @@ -1704,6 +1688,15 @@ static boolean HitElement(int element, int hit_mask) boolean cross_x = (getLevelFromLaserX(LX) != getLevelFromLaserX(LX + 2)); boolean cross_y = (getLevelFromLaserY(LY) != getLevelFromLaserY(LY + 2)); + // check if wall (horizontal or vertical) side of slope was hit + if (hit_mask == HIT_MASK_LEFT || + hit_mask == HIT_MASK_RIGHT || + hit_mask == HIT_MASK_TOP || + hit_mask == HIT_MASK_BOTTOM) + { + return HitReflectingWalls(element, hit_mask); + } + // check if an edge was hit while crossing element borders if (cross_x && cross_y && get_number_of_bits(hit_mask) == 1) {