Fix airplane line being drawn in front of many HUD elements
authorWuzzy <Wuzzy2@mail.ru>
Sun, 13 Jan 2019 22:22:40 +0100
changeset 14590 0149d5ed5dc5
parent 14589 e26fa5ea2bf6
child 14591 0da43a3d5500
Fix airplane line being drawn in front of many HUD elements
ChangeLog.txt
hedgewars/uWorld.pas
--- a/ChangeLog.txt	Sun Jan 13 18:07:04 2019 +0100
+++ b/ChangeLog.txt	Sun Jan 13 22:22:40 2019 +0100
@@ -44,6 +44,7 @@
  * Hide most HUD elements in cinematic mode
  * Don't show "F1", "F2", etc. in ammo menu if these aren't the actual slot keys
  * Fix wind bar animation not looping properly
+ * Fix airplane line being drawn above many HUD elements
  * Suppress “<team> is gone.” message at end of game
 
 Frontend:
--- a/hedgewars/uWorld.pas	Sun Jan 13 18:07:04 2019 +0100
+++ b/hedgewars/uWorld.pas	Sun Jan 13 22:22:40 2019 +0100
@@ -1362,6 +1362,12 @@
     else
         DrawWaves(-1, 50, cWaveHeight div 2, cWaveHeight div 2, 0);
 
+// line at airplane height for certain airstrike types (when spawning height is important)
+with CurrentHedgehog^ do
+    if (isCursorVisible) and ((CurAmmoType = amNapalm) or (CurAmmoType = amMineStrike) or (((GameFlags and gfMoreWind) <> 0) and ((CurAmmoType = amDrillStrike) or (CurAmmoType = amAirAttack)))) then
+        DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
+
+// gear HUD extras (fuel indicator, secondary ammo, etc.)
 if replicateToLeft then
     begin
     ShiftWorld(-1);
@@ -1815,8 +1821,6 @@
     with CurrentHedgehog^ do
         if (Gear <> nil) and ((Gear^.State and gstChooseTarget) <> 0) then
             begin
-        if (CurAmmoType = amNapalm) or (CurAmmoType = amMineStrike) or (((GameFlags and gfMoreWind) <> 0) and ((CurAmmoType = amDrillStrike) or (CurAmmoType = amAirAttack))) then
-            DrawLine(-3000, topY-300, 7000, topY-300, 3.0, (Team^.Clan^.Color shr 16), (Team^.Clan^.Color shr 8) and $FF, Team^.Clan^.Color and $FF, $FF);
         i:= GetCurAmmoEntry(CurrentHedgehog^)^.Pos;
         with Ammoz[CurAmmoType] do
             if PosCount > 1 then