# HG changeset patch # User nemo # Date 1341758140 14400 # Node ID d833d1010710cc2604c6cf1a33ebed8f9f31d764 # Parent 06454899d0d26abdee6493af38c2a27e6ce42337 Intended to help on bottom border maps or "red" maps - don't assume erasure if there is indestructible land below the hog diff -r 06454899d0d2 -r d833d1010710 hedgewars/uAIMisc.pas --- a/hedgewars/uAIMisc.pas Sun Jul 08 10:03:31 2012 -0400 +++ b/hedgewars/uAIMisc.pas Sun Jul 08 10:35:40 2012 -0400 @@ -404,7 +404,10 @@ begin dX:= 0.005 * dmg + 0.01; dY:= dX; - fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod); + if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and + (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then + fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod) + else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod) end; if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI if Score > 0 then @@ -503,7 +506,10 @@ dY:= gdY * dmg; if dX < 0 then dX:= dX - 0.01 else dX:= dX + 0.01; - fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod); + if (x and LAND_WIDTH_MASK = 0) and ((y+cHHRadius+2) and LAND_HEIGHT_MASK = 0) and + (Land[y+cHHRadius+2, x] and lfIndestructible <> 0) then + fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, 0) * dmgMod) + else fallDmg:= trunc(TraceFall(x, y, Point.x, Point.y, dX, dY, erasure) * dmgMod); if fallDmg < 0 then // drowning. score healthier hogs higher, since their death is more likely to benefit the AI if Score > 0 then inc(rate, KillScore + Score div 10) // Add a bit of a bonus for bigger hog drownings