hedgewars/uGearsUtils.pas
changeset 8989 ae97ab6dcc70
parent 8987 47cf32305d99
child 8990 e64a1a851b69
equal deleted inserted replaced
8988:58b28c4a25c5 8989:ae97ab6dcc70
   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             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   410             if ((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   411             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   411             or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
   412             and (CurAmmoGear^.dY < _0_01))) then
   412             and (CurAmmoGear^.dY < _0_01))) then
   413                 if Gear^.Density * Gear^.dY > _1 then
   413                 if Gear^.Density * Gear^.dY > _1 then
   414                     PlaySound(sndSplash)
   414                     PlaySound(sndSplash)
   415                 else if Gear^.Density * Gear^.dY > _0_5 then 
   415                 else if Gear^.Density * Gear^.dY > _0_5 then 
   416                     PlaySound(sndSkip)
   416                     PlaySound(sndSkip)
   418                     PlaySound(sndDroplet2);
   418                     PlaySound(sndDroplet2);
   419             end;
   419             end;
   420 
   420 
   421         if ((cReducedQuality and rqPlainSplash) = 0)
   421         if ((cReducedQuality and rqPlainSplash) = 0)
   422         and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   422         and (((not isSubmersible) and (Y < cWaterLine + 64 + Gear^.Radius))
   423         or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and ((CurAmmoGear^.Pos = 0)
   423         or (isSubmersible and (Y < cWaterLine + 2 + Gear^.Radius) and (Gear = CurAmmoGear) and ((CurAmmoGear^.Pos = 0)
   424         and (CurAmmoGear^.dY < _0_01)))) then
   424         and (CurAmmoGear^.dY < _0_01)))) then
   425             begin
   425             begin
   426             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
   426             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
   427             if splash <> nil then 
   427             if splash <> nil then 
   428                 with splash^ do
   428                 with splash^ do
   459                                 end
   459                                 end
   460                             end
   460                             end
   461                         end
   461                         end
   462                 end
   462                 end
   463             end;
   463             end;
   464         if isSubmersible and (CurAmmoGear^.Pos = 0) then
   464         if isSubmersible and (Gear = CurAmmoGear) and (CurAmmoGear^.Pos = 0) then
   465             CurAmmoGear^.Pos := 1000
   465             CurAmmoGear^.Pos := 1000
   466         end
   466         end
   467     else
   467     else
   468         CheckGearDrowning := false;
   468         CheckGearDrowning := false;
   469 end;
   469 end;