hedgewars/uLandGraphics.pas
changeset 11595 8d1cfedfaf1f
parent 11594 c453620cc6d6
child 13410 4c813650fe17
--- a/hedgewars/uLandGraphics.pas	Thu Mar 03 16:36:05 2016 -0500
+++ b/hedgewars/uLandGraphics.pas	Fri Mar 04 10:37:42 2016 +0100
@@ -213,13 +213,13 @@
         for i:= fromPix to toPix do
             begin
             if Land[y, i] and lfNotHHObjMask shr lfNotHHObjShift < lfNotHHObjSize then
-                Land[y, i]:= (Land[y, i] and not lfNotHHObjMask) or ((Land[y, i] and lfNotHHObjMask shr lfNotHHObjShift + 1) shl lfNotHHObjShift);
+                Land[y, i]:= (Land[y, i] and (not lfNotHHObjMask)) or ((Land[y, i] and lfNotHHObjMask shr lfNotHHObjShift + 1) shl lfNotHHObjShift);
             end;
     removeNotHHObj:
         for i:= fromPix to toPix do
             begin
             if Land[y, i] and lfNotHHObjMask <> 0 then
-                Land[y, i]:= (Land[y, i] and not lfNotHHObjMask) or ((Land[y, i] and lfNotHHObjMask shr lfNotHHObjShift - 1) shl lfNotHHObjShift);
+                Land[y, i]:= (Land[y, i] and (not lfNotHHObjMask)) or ((Land[y, i] and lfNotHHObjMask shr lfNotHHObjShift - 1) shl lfNotHHObjShift);
             end;
     addHH:
         for i:= fromPix to toPix do
@@ -791,7 +791,7 @@
                     gX:= (cpX + x) div 2;
                     gY:= (cpY + y) div 2;
                     end;
-                if not behind or (Land[cpY + y, cpX + x] and lfLandMask = 0) then
+                if (not behind) or (Land[cpY + y, cpX + x] and lfLandMask = 0) then
                     begin
                     if (LandFlags and lfBasic <> 0) or 
                        ((LandPixels[gY, gX] and AMask shr AShift > 128) and  // This test assumes lfBasic and lfObject differ only graphically
@@ -799,7 +799,7 @@
                          Land[cpY + y, cpX + x]:= lfBasic or LandFlags
                     else Land[cpY + y, cpX + x]:= lfObject or LandFlags
                     end;
-                if not behind or (LandPixels[gY, gX] = 0) then
+                if (not behind) or (LandPixels[gY, gX] = 0) then
                     begin
                     if tint = $FFFFFFFF then
                         LandPixels[gY, gX]:= PLongword(@(p^[x * 4]))^