From: Holger Schemel Date: Fri, 19 May 2023 13:45:19 +0000 (+0200) Subject: moved variables to higher position in scope X-Git-Tag: 4.3.6.0~3 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=46063530cb6f8fd298fa3e59f2387e5298f13f6b;p=rocksndiamonds.git moved variables to higher position in scope --- diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 58ae03db..d66dbc84 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -1692,6 +1692,9 @@ static boolean HitElement(int element, int hit_mask) // check if laser scan has crossed element boundaries (not just mini tiles) boolean cross_x = (getLevelFromLaserX(LX) != getLevelFromLaserX(LX + 2)); boolean cross_y = (getLevelFromLaserY(LY) != getLevelFromLaserY(LY + 2)); + int element_angle = get_element_angle(element); + int mirrored_angle = get_mirrored_angle(laser.current_angle, element_angle); + int opposite_angle = get_opposite_angle(laser.current_angle); // check if wall (horizontal or vertical) side of slope was hit if (hit_mask == HIT_MASK_LEFT || @@ -1722,10 +1725,6 @@ static boolean HitElement(int element, int hit_mask) } } - int mirrored_angle = get_mirrored_angle(laser.current_angle, - get_element_angle(element)); - int opposite_angle = get_opposite_angle(laser.current_angle); - // check if laser is reflected by slope by 180° if (mirrored_angle == opposite_angle) {