continue;
#if 0
- Debug("game:mm:DrawLaser", "DL_LASER_ENABLED: i==%d: %d, %d",
+ Debug("game:mm:DrawLaser", "DL_LASER_ENABLED: i == %d: %d, %d",
i, laser.beamer_edge[i], tmp_start_edge);
#endif
hit_mask == HIT_MASK_TOP ||
hit_mask == HIT_MASK_BOTTOM)
{
- return HitReflectingWalls(element, hit_mask);
+ boolean hit_slope_corner_in_laser_direction =
+ ((hit_mask == HIT_MASK_LEFT && (element == EL_DF_SLOPE_01 ||
+ element == EL_DF_SLOPE_02)) ||
+ (hit_mask == HIT_MASK_RIGHT && (element == EL_DF_SLOPE_00 ||
+ element == EL_DF_SLOPE_03)) ||
+ (hit_mask == HIT_MASK_TOP && (element == EL_DF_SLOPE_02 ||
+ element == EL_DF_SLOPE_03)) ||
+ (hit_mask == HIT_MASK_BOTTOM && (element == EL_DF_SLOPE_00 ||
+ element == EL_DF_SLOPE_01)));
+
+ boolean hit_slope_corner_in_laser_direction_double_checked =
+ (cross_x && cross_y &&
+ laser.current_angle == mirrored_angle &&
+ hit_slope_corner_in_laser_direction);
+
+ // check special case of laser hitting the corner of a slope and another
+ // element (either wall or another slope), following the diagonal side
+ // of the slope which has the same angle as the direction of the laser
+ if (!hit_slope_corner_in_laser_direction_double_checked)
+ return HitReflectingWalls(element, hit_mask);
}
// check if an edge was hit while crossing element borders
int direction = MovDir[x][y];
int dx = (direction == MV_LEFT ? -1 : direction == MV_RIGHT ? +1 : 0);
int dy = (direction == MV_UP ? -1 : direction == MV_DOWN ? +1 : 0);
- int horiz_move = (dx!=0);
+ int horiz_move = (dx != 0);
int newx = x + dx, newy = y + dy;
int step = (horiz_move ? dx : dy) * TILEX / 8;