hedgewars/uLandObjects.pas
changeset 15363 0230c4766aa6
parent 15361 4e91a7050add
child 15365 9fca575e3c88
--- a/hedgewars/uLandObjects.pas	Mon Aug 19 18:24:08 2019 +0300
+++ b/hedgewars/uLandObjects.pas	Mon Aug 19 11:41:59 2019 -0400
@@ -89,18 +89,18 @@
     // this an if instead of masking colours to avoid confusing map creators
     if ((AMask and Pixel) = 0) then
         LandWord:= 0
-    else if Pixel = $FFFFFFFF then                  // white
+    else if (Pixel and AMask > 0) and (Pixel and RMask > 0) and (Pixel and GMask > 0) and (Pixel and BMask > 0) then // whiteish
         LandWord:= lfObject
-    else if Pixel = AMask then                      // black
+    else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask = 0) and (Pixel and BMask = 0) then // blackish
         begin
         LandWord:= lfBasic;
         disableLandBack:= false
         end
-    else if Pixel = (AMask or RMask) then           // red
+    else if (Pixel and AMask > 0) and (Pixel and RMask > 0) and (Pixel and GMask = 0) and (Pixel and BMask = 0) then // reddish
         LandWord:= lfIndestructible
-    else if Pixel = (AMask or BMask) then           // blue
+    else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask = 0) and (Pixel and BMask > 0) then // blueish
         LandWord:= lfObject or lfIce
-    else if Pixel = (AMask or GMask) then           // green
+    else if (Pixel and AMask > 0) and (Pixel and RMask = 0) and (Pixel and GMask > 0) and (Pixel and BMask = 0) then // greenish
         LandWord:= lfObject or lfBouncy
 end;