Tweak airplane spawn point to avoid appear out of nowhere
authorWuzzy <Wuzzy2@mail.ru>
Mon, 29 Jun 2020 13:40:13 +0200
changeset 15652 3d8c2ab2b98b
parent 15651 f75f8729cc5a
child 15653 d738b2b1249e
Tweak airplane spawn point to avoid appear out of nowhere
hedgewars/uConsts.pas
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uConsts.pas	Mon Jun 29 13:17:10 2020 +0200
+++ b/hedgewars/uConsts.pas	Mon Jun 29 13:40:13 2020 +0200
@@ -234,9 +234,10 @@
     cDefaultZoomLevel = 2.0; // 100% zoom
 
     // Maximum camera positions, values are "pixels outside the mainland"
-    cCamLimitX = 2048; // X (left/right) camera limit, no border. Note: Influences sndFlyAway
+    cCamLimitX = 1920; // X (left/right) camera limit, no border. Note: Influences sndFlyAway
+                       // Note: Also make sure it's far enough from airplane spawn
     cCamLimitY = 2048; // Top Y camera limit, no border
-    cCamLimitBorderX = 2048; // X (left/right) camera limit, with border
+    cCamLimitBorderX = 1920; // X (left/right) camera limit, with border
     cCamLimitBorderY = 2048; // Top Y camera limit, with border
 
     // game flags
--- a/hedgewars/uGearsHandlersMess.pas	Mon Jun 29 13:17:10 2020 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Jun 29 13:40:13 2020 +0200
@@ -3188,7 +3188,7 @@
 
     // Get rid of gear and cleanup
     if ((WorldEdge = weWrap) and (Gear^.FlightTime >= 4000)) or
-        ((WorldEdge <> weWrap) and (((hwRound(Gear^.X) - Gear^.Radius > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) + Gear^.Radius < -2048) or ((Gear^.Message and gmDestroy) > 0)))) then
+        ((WorldEdge <> weWrap) and (((hwRound(Gear^.X) - Gear^.Radius > (LAND_WIDTH+2048)) or (hwRound(Gear^.X) + Gear^.Radius < -2048) or ((Gear^.Message and gmDestroy) > 0)))) then
         begin
         // fail-safe: instanly stop sound if it wasn't disabled before
         if (Gear^.SoundChannel <> -1) then
@@ -3256,7 +3256,7 @@
         if (WorldEdge = weWrap) then
             Gear^.X := int2hwFloat(CalcWorldWrap(Gear^.Target.X - max(384, LAND_WIDTH shr 2), 0))
         else
-            Gear^.X := int2hwFloat(max(LAND_WIDTH,4096) + 2048);
+            Gear^.X := int2hwFloat(LAND_WIDTH + 2048);
         end;
 
     Gear^.Y := int2hwFloat(topY - 300);
@@ -7338,4 +7338,4 @@
     end
 end;
 
-end.
\ No newline at end of file
+end.