hedgewars/uGearsUtils.pas
changeset 8990 e64a1a851b69
parent 8989 ae97ab6dcc70
child 8991 82e3a6e5d51b
equal deleted inserted replaced
8989:ae97ab6dcc70 8990:e64a1a851b69
   367         skipDecay := _0_87;
   367         skipDecay := _0_87;
   368         X:= hwRound(Gear^.X);
   368         X:= hwRound(Gear^.X);
   369         vdX:= hwFloat2Float(Gear^.dX);
   369         vdX:= hwFloat2Float(Gear^.dX);
   370         vdY:= hwFloat2Float(Gear^.dY);
   370         vdY:= hwFloat2Float(Gear^.dY);
   371         // this could perhaps be a tiny bit higher.
   371         // this could perhaps be a tiny bit higher.
   372         if  (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed)
   372         if  (cWaterLine + 64 + Gear^.Radius > Y) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > skipSpeed) 
   373         and (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then
   373         and (hwAbs(Gear^.dX) > skipAngle * hwAbs(Gear^.dY)) then
   374             begin
   374             begin
   375             Gear^.dY.isNegative := true;
   375             Gear^.dY.isNegative := true;
   376             Gear^.dY := Gear^.dY * skipDecay;
   376             Gear^.dY := Gear^.dY * skipDecay;
   377             Gear^.dX := Gear^.dX * skipDecay;
   377             Gear^.dX := Gear^.dX * skipDecay;
   404                         end
   404                         end
   405                     else
   405                     else
   406                         Gear^.doStep := @doStepDrowningGear;
   406                         Gear^.doStep := @doStepDrowningGear;
   407                         if Gear^.Kind = gtFlake then
   407                         if Gear^.Kind = gtFlake then
   408                             exit // skip splashes 
   408                             exit // skip splashes 
   409                 end;
   409                 end
       
   410             else if (Y > cWaterLine + cVisibleWater) and 
       
   411                     ((Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.AmmoType <> amJetpack)) then
       
   412                 Gear^.doStep:= @doStepDrowningGear;
   410             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   413             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   411             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
   414             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
   412             and (CurAmmoGear^.dY < _0_01))) then
   415             and (CurAmmoGear^.dY < _0_01))) then
   413                 if Gear^.Density * Gear^.dY > _1 then
   416                 if Gear^.Density * Gear^.dY > _1 then
   414                     PlaySound(sndSplash)
   417                     PlaySound(sndSplash)