hedgewars/uGearsUtils.pas
changeset 10356 7d1044267b83
parent 10354 56bd029245fc
child 10363 fc3aa563ab01
equal deleted inserted replaced
10355:334b5f513703 10356:7d1044267b83
   466             // drown submersible grears if far below map
   466             // drown submersible grears if far below map
   467             else if (Y > cWaterLine + cVisibleWater*4) and
   467             else if (Y > cWaterLine + cVisibleWater*4) and
   468                     ((Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.State and gstSubmersible = 0)) then
   468                     ((Gear <> CurrentHedgehog^.Gear) or (CurAmmoGear = nil) or (CurAmmoGear^.State and gstSubmersible = 0)) then
   469                 DrownGear(Gear);
   469                 DrownGear(Gear);
   470 
   470 
   471             isImpactRight:= isImpactH and (abs(X - leftX) > abs(rightX - X));
   471             isImpactRight:= isImpactH and (abs(X - LongInt(leftX)) > abs(LongInt(rightX) - X));
   472             isLeaving:= (isSubmersible and (dist2Water = -2 * Gear^.Radius) and (Gear = CurAmmoGear) and (CurAmmoGear^.Pos = 0)
   472             isLeaving:= (isSubmersible and (dist2Water = -2 * Gear^.Radius) and (Gear = CurAmmoGear) and (CurAmmoGear^.Pos = 0)
   473             and (((not isImpactH) and CurAmmoGear^.dY.isNegative) or (isImpactH and (isImpactRight = CurAmmoGear^.dX.isNegative))));
   473             and (((not isImpactH) and CurAmmoGear^.dY.isNegative) or (isImpactH and (isImpactRight = CurAmmoGear^.dX.isNegative))));
   474 
   474 
   475             // splash sound
   475             // splash sound
   476 
   476