Fix many gears not being affected by gfMoreWind on turn end
authorWuzzy <Wuzzy2@mail.ru>
Sat, 06 Jun 2020 15:10:41 +0200
changeset 15596 3409433a236a
parent 15594 fdca2af677a9
child 15597 6e72bd61002e
Fix many gears not being affected by gfMoreWind on turn end
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Fri Jun 05 15:48:41 2020 +0200
+++ b/ChangeLog.txt	Sat Jun 06 15:10:41 2020 +0200
@@ -15,6 +15,7 @@
  * A Classic Fairytale: Mission 1: Fix possibility of getting stuck in “Leap of Faith” section
  * A Space Adventure: The First Stop: Fix broken victory condition when eliminating minions
  * A Space Adventure: Killing the Specialists: Don't award player health if enemy hurts itself
+ * Fix many projectiles not being affected by Heavy Wind after turn end
  * Fix hog getting stuck when opening parachute right after a shoryuken digging through land
  * Fix weapon schemes sometimes not being saved properly
 
--- a/hedgewars/uGearsHandlersMess.pas	Fri Jun 05 15:48:41 2020 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Jun 06 15:10:41 2020 +0200
@@ -535,8 +535,11 @@
 
     if isFalling and (Gear^.State and gstNoGravity = 0) then
         begin
+        // Apply gravity and wind
         Gear^.dY := Gear^.dY + cGravity;
-        if (GameFlags and gfMoreWind <> 0) and (TurnTimeLeft > 0) and
+        if ((GameFlags and gfMoreWind) <> 0) and
+           // Disable gfMoreWind for land objects on turn end to prevent bouncing them forever
+           ((not (Gear^.Kind in [gtMine, gtAirMine, gtSMine, gtKnife, gtExplosives])) or (TurnTimeLeft > 0)) and
            ((xland or land) = 0) and
            ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) > _0_02.QWordValue) then
             Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density