X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_mm%2Fmm_game.c;h=8cc08bc47527ed8dd825ac912233a32b631f4d93;hb=c2507c62924b560ab4c0ad7330cd78fc562f16ce;hp=4b864e6937ace2acfb7f8fffe0d073fffca2ae42;hpb=4ed8ff5e4233a4d180895ac32d162f1bf568c6cd;p=rocksndiamonds.git diff --git a/src/game_mm/mm_game.c b/src/game_mm/mm_game.c index 4b864e69..8cc08bc4 100644 --- a/src/game_mm/mm_game.c +++ b/src/game_mm/mm_game.c @@ -570,6 +570,8 @@ static void InitField(int x, int y, boolean init_game) game_mm.laser_green = native_mm_level.df_laser_green; game_mm.laser_blue = native_mm_level.df_laser_blue; } + + game_mm.has_mcduffin = (IS_MCDUFFIN(element)); } break; @@ -662,6 +664,7 @@ void InitGameEngine_MM(void) game_mm.laser_red = FALSE; game_mm.laser_green = FALSE; game_mm.laser_blue = TRUE; + game_mm.has_mcduffin = TRUE; game_mm.level_solved = FALSE; game_mm.game_over = FALSE; @@ -913,6 +916,26 @@ static int ScanPixel(void) } #endif + // check if laser scan has crossed element boundaries (not just mini tiles) + boolean cross_x = (LX / TILEX != (LX + 2) / TILEX); + boolean cross_y = (LY / TILEY != (LY + 2) / TILEY); + + if (cross_x && cross_y) + { + int elx1 = (LX - XS) / TILEX; + int ely1 = (LY + YS) / TILEY; + int elx2 = (LX + XS) / TILEX; + int ely2 = (LY - YS) / TILEY; + + // add element corners left and right from the laser beam to damage list + + if (IN_LEV_FIELD(elx1, ely1) && Tile[elx1][ely1] != EL_EMPTY) + AddDamagedField(elx1, ely1); + + if (IN_LEV_FIELD(elx2, ely2) && Tile[elx2][ely2] != EL_EMPTY) + AddDamagedField(elx2, ely2); + } + for (i = 0; i < 4; i++) { int px = LX + (i % 2) * 2; @@ -2006,10 +2029,16 @@ static boolean HitPolarizer(int element, int hit_mask) } else if (IS_GRID_STEEL(element)) { + // may be required if graphics for steel grid redefined + AddDamagedField(ELX, ELY); + return HitReflectingWalls(element, hit_mask); } else // IS_GRID_WOOD { + // may be required if graphics for wooden grid redefined + AddDamagedField(ELX, ELY); + return HitAbsorbingWalls(element, hit_mask); }