hedgewars/GSHandlers.inc
changeset 4805 01332828b568
parent 4803 eddea6bca770
child 4808 7c3e5b52344a
equal deleted inserted replaced
4804:af59f3dfc53a 4805:01332828b568
   598 
   598 
   599         move:= false;
   599         move:= false;
   600     // move back to cloud layer
   600     // move back to cloud layer
   601         if yy > cWaterLine then move:= true
   601         if yy > cWaterLine then move:= true
   602         else if ((yy and LAND_HEIGHT_MASK) <> 0) or ((xx and LAND_WIDTH_MASK) <> 0) then move:=true
   602         else if ((yy and LAND_HEIGHT_MASK) <> 0) or ((xx and LAND_WIDTH_MASK) <> 0) then move:=true
   603         // Hog/Object encountered
       
   604         else if ((Land[yy, xx] and $FF) <> 0) then move:=true
       
   605         // Solid pixel encountered
   603         // Solid pixel encountered
   606         else if (Land[yy, xx] > 255) then
   604         else if (Land[yy, xx] <> 0) then
   607             begin
   605             begin
   608             // If there's room below keep falling
   606             // If there's room below keep falling
   609             if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (Land[yy-1, xx] = 0) then
   607             if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (Land[yy-1, xx] = 0) then
   610                 begin
   608                 begin
   611                 X:= X - cWindSpeed * 1600 - dX;
   609                 X:= X - cWindSpeed * 1600 - dX;
   629             else if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (((xx+(2*hwSign(cWindSpeed))) and LAND_WIDTH_MASK) = 0) and (Land[yy-1, (xx+(2*hwSign(cWindSpeed)))] = 0) then
   627             else if (((yy-1) and LAND_HEIGHT_MASK) = 0) and (((xx+(2*hwSign(cWindSpeed))) and LAND_WIDTH_MASK) = 0) and (Land[yy-1, (xx+(2*hwSign(cWindSpeed)))] = 0) then
   630                 begin
   628                 begin
   631                 X:= X + _0_8 * 2 * hwSign(cWindSpeed);
   629                 X:= X + _0_8 * 2 * hwSign(cWindSpeed);
   632                 Y:= Y - dY - cGravity * vobFallSpeed * 8;
   630                 Y:= Y - dY - cGravity * vobFallSpeed * 8;
   633                 end
   631                 end
       
   632             // if there's an hog/object below do nothing
       
   633             else if ((((yy+1) and LAND_HEIGHT_MASK) = 0) and ((Land[yy+1, xx] and $FF) <> 0))
       
   634                 then move:=true
   634             else
   635             else
   635                 begin
   636                 begin
   636                 // we've collided with land. draw some stuff and get back into the clouds
   637                 // we've collided with land. draw some stuff and get back into the clouds
   637                 move:= true;
   638                 move:= true;
   638                 if (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtRope) then
   639                 if (CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtRope) then