fixed bug with re-scanning laser when rotating teleporter in MM engine
authorHolger Schemel <info@artsoft.org>
Sun, 22 Jan 2023 23:27:36 +0000 (00:27 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 22 Jan 2023 23:31:59 +0000 (00:31 +0100)
The "fix" in commit 1b2237c9 fixed some old problems with handling
teleporter elements, but caused new problems with overheating which
should not happen.

This change seems to fix both cases.

src/game_mm/mm_game.c

index 8583a9a7d7d056e43e13b3e2bcc80ffefe35af3a..20e27068ffa641502bc60d230642c3fe62f10563 100644 (file)
@@ -3060,8 +3060,6 @@ void RotateMirror(int x, int y, int button)
         IS_POLAR(Tile[x][y]) ||
         IS_POLAR_CROSS(Tile[x][y])) && x == ELX && y == ELY)
     {
-      check = 0;
-
       if (IS_BEAMER(Tile[x][y]))
       {
 #if 0
@@ -3069,12 +3067,13 @@ void RotateMirror(int x, int y, int button)
              LX, LY, laser.beamer_edge, laser.beamer[1].num);
 #endif
 
-#if 0
-       laser.num_edges--;
-#endif
+       if (check == 1)
+         laser.num_edges--;
       }
 
       ScanLaser();
+
+      check = 0;
     }
 
     if (check == 2)