fixed bug with wrong laser position for slope element check in MM engine
[rocksndiamonds.git] / src / game_mm / mm_game.c
index 51ebf314c08f2f31aaa21ba2d72bd8f592b6d881..58ae03db5ef0d351f7eb7a4546a7ff93946ae541 100644 (file)
@@ -1956,8 +1956,8 @@ static boolean HitElement(int element, int hit_mask)
       {
        int elx, ely;
 
-       elx = getLevelFromLaserX(LX);
-       ely = getLevelFromLaserY(LY);
+       elx = getLevelFromLaserX(LX + XS);
+       ely = getLevelFromLaserY(LY + YS);
 
        if (IN_LEV_FIELD(elx, ely))
        {
@@ -1970,8 +1970,8 @@ static boolean HitElement(int element, int hit_mask)
 
        int nr = element - EL_DF_SLOPE_START;
        int dx = (nr == 0 ? (XS > 0 ? TILEX - 1 : -1) :
-                 nr == 1 ? (XS > 0 ? TILEX     :  1) :
-                 nr == 2 ? (XS > 0 ? TILEX     :  1) :
+                 nr == 1 ? (XS > 0 ? TILEX     :  0) :
+                 nr == 2 ? (XS > 0 ? TILEX     :  0) :
                  nr == 3 ? (XS > 0 ? TILEX - 1 : -1) : 0);
        int dy = (nr == 0 ? (YS > 0 ? TILEY - 1 : -1) :
                  nr == 1 ? (YS > 0 ? TILEY - 1 : -1) :