fix despeckle
authorsheepluva
Mon, 01 Dec 2014 19:24:40 +0100
changeset 10600 e28d86fc393e
parent 10599 918d6da025a6
child 10601 3f4964eeaf01
fix despeckle
hedgewars/uLandGraphics.pas
--- a/hedgewars/uLandGraphics.pas	Mon Dec 01 17:55:09 2014 +0100
+++ b/hedgewars/uLandGraphics.pas	Mon Dec 01 19:24:40 2014 +0100
@@ -849,7 +849,7 @@
         yy:= Y div 2;
     end;
 
-    pixelsweep:= (Land[Y, X] <= lfAllObjMask) and (LandPixels[yy, xx] <> 0);
+    pixelsweep:= (Land[Y, X] <= lfAllObjMask) and ((LandPixels[yy, xx] and AMASK) <> 0);
     if (((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
     begin
         c:= 0;
@@ -868,10 +868,10 @@
                                 ny:= Y div 2 + i;
                                 nx:= X div 2 + j;
                                 if ((ny and (LAND_HEIGHT_MASK div 2)) = 0) and ((nx and (LAND_WIDTH_MASK div 2)) = 0) then
-                                    if LandPixels[ny, nx] <> 0 then
+                                    if (LandPixels[ny, nx] and AMASK) <> 0 then
                                         inc(c);
                             end
-                            else if LandPixels[ny, nx] <> 0 then
+                            else if (LandPixels[ny, nx] and AMASK)  <> 0 then
                                     inc(c);
                         end
                     else if Land[ny, nx] > 255 then