Disable digging on solid land
authornemo
Thu, 31 Dec 2015 10:17:15 -0500
changeset 11481 c4e1d39acc56
parent 11480 1d478892cf1c
child 11482 e425a6eb9da3
Disable digging on solid land
hedgewars/uAIAmmoTests.pas
hedgewars/uChat.pas
--- a/hedgewars/uAIAmmoTests.pas	Thu Dec 31 16:26:21 2015 +0300
+++ b/hedgewars/uAIAmmoTests.pas	Thu Dec 31 10:17:15 2015 -0500
@@ -177,7 +177,9 @@
             value:= RateExplosion(Me, EX, EY, 101, afTrackFall or afErasesLand)
         else value:= RateExplosion(Me, EX, EY, 101);
         if (value = 0) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then
-            value:= 1024 - Metric(Targ.Point.X, Targ.Point.Y, EX, EY) div 64;
+            if GameFlags and gfSolidLand = 0 then
+                 value := 1024 - Metric(Targ.Point.X, Targ.Point.Y, EX, EY) div 64
+            else value := BadTurn;
         if valueResult <= value then
             begin
             ap.Angle:= DxDy2AttackAnglef(Vx, Vy) + AIrndSign(random((Level - 1) * 9));
@@ -776,7 +778,11 @@
         valueResult:= RateShotgun(Me, vX, vY, rx, ry);
 
         if (valueResult = 0) and (Targ.Kind = gtHedgehog) and (Targ.Score > 0) then
-            valueResult:= 1024 - Metric(Targ.Point.X, Targ.Point.Y, rx, ry) div 64
+            begin
+            if GameFlags and gfSolidLand = 0 then
+                 valueResult:= 1024 - Metric(Targ.Point.X, Targ.Point.Y, rx, ry) div 64
+            else valueResult := BadTurn
+            end
         else
             dec(valueResult, Level * 4000);
         // 27/20 is reuse bonus
--- a/hedgewars/uChat.pas	Thu Dec 31 16:26:21 2015 +0300
+++ b/hedgewars/uChat.pas	Thu Dec 31 10:17:15 2015 -0500
@@ -196,7 +196,7 @@
 // create and blit text
 strSurface:= TTF_RenderUTF8_Blended(Fontz[font].Handle, Str2PChar(str), cl.color);
 //SDL_UpperBlit(strSurface, nil, resSurface, @dstrect);
-if strSurface <> nil then copyTOXY(strSurface, resSurface, Padding, Padding);
+if strSurface <> nil then copyToXY(strSurface, resSurface, Padding, Padding);
 SDL_FreeSurface(strSurface);
 
 cl.Tex:= Surface2Tex(resSurface, false);