hedgewars/uGearsHandlersMess.pas
changeset 15623 6c689729b745
parent 15621 969f67193d0b
parent 15598 d275bb6b85b4
child 15630 c9fec197335a
equal deleted inserted replaced
15622:237d691e5069 15623:6c689729b745
   533     if Gear^.AdvBounce > 1 then
   533     if Gear^.AdvBounce > 1 then
   534         dec(Gear^.AdvBounce);
   534         dec(Gear^.AdvBounce);
   535 
   535 
   536     if isFalling and (Gear^.State and gstNoGravity = 0) then
   536     if isFalling and (Gear^.State and gstNoGravity = 0) then
   537         begin
   537         begin
       
   538         // Apply gravity and wind
   538         Gear^.dY := Gear^.dY + cGravity;
   539         Gear^.dY := Gear^.dY + cGravity;
   539         if (GameFlags and gfMoreWind <> 0) and (TurnTimeLeft > 0) and
   540         if ((GameFlags and gfMoreWind) <> 0) and
       
   541            // Disable gfMoreWind for land objects on turn end to prevent bouncing them forever
       
   542            // This solution is rather ugly, in that it will occassionally suddenly wind physics
       
   543            // while a gear is moving, this can be rather confusing.
       
   544            // TODO: Find a way to make gfMoreWind-affected land objects settle more reliably
       
   545            // and quickler without touching wind itselvs
       
   546            ((not (Gear^.Kind in [gtMine, gtAirMine, gtSMine, gtKnife, gtExplosives])) or (TimeNotInTurn < MaxMoreWindTime)) and
   540            ((xland or land) = 0) and
   547            ((xland or land) = 0) and
   541            ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) > _0_02.QWordValue) then
   548            ((Gear^.dX.QWordValue + Gear^.dY.QWordValue) > _0_02.QWordValue) then
   542             Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
   549             Gear^.dX := Gear^.dX + cWindSpeed / Gear^.Density
   543         end;
   550         end;
   544 
   551