hedgewars/uGearsHandlersMess.pas
changeset 11057 adb5ef54da54
parent 11046 47a8c19ecb60
child 11070 f9a03078dd4f
equal deleted inserted replaced
11056:62cc7f67105f 11057:adb5ef54da54
  2767 
  2767 
  2768     LandFlags:= 0;
  2768     LandFlags:= 0;
  2769     if Gear^.AmmoType = amRubber then LandFlags:= lfBouncy
  2769     if Gear^.AmmoType = amRubber then LandFlags:= lfBouncy
  2770     else if cIce then LandFlags:= lfIce;
  2770     else if cIce then LandFlags:= lfIce;
  2771 
  2771 
  2772     distFail:= ((Distance(tx - x, ty - y) > _256) and ((WorldEdge <> weWrap) or
  2772     distFail:= (cBuildMaxDist > 0) and ((hwRound(Distance(tx - x, ty - y)) > cBuildMaxDist) and ((WorldEdge <> weWrap) or
  2773             (
  2773             (
  2774             (Distance(tx - int2hwFloat(rightX+(rx-leftX)), ty - y) > _256) and
  2774             (hwRound(Distance(tx - int2hwFloat(rightX+(rx-leftX)), ty - y)) > cBuildMaxDist) and
  2775             (Distance(tx - int2hwFloat(leftX-(rightX-rx)), ty - y) > _256)
  2775             (hwRound(Distance(tx - int2hwFloat(leftX-(rightX-rx)), ty - y)) > cBuildMaxDist)
  2776             )));
  2776             )));
  2777     if distFail
  2777     if distFail
  2778     or (not TryPlaceOnLand(Gear^.Target.X - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Width div 2, Gear^.Target.Y - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Height div 2, Ammoz[Gear^.AmmoType].PosSprite, Gear^.State, true, LandFlags)) then
  2778     or (not TryPlaceOnLand(Gear^.Target.X - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Width div 2, Gear^.Target.Y - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Height div 2, Ammoz[Gear^.AmmoType].PosSprite, Gear^.State, true, LandFlags)) then
  2779         begin
  2779         begin
  2780         PlaySound(sndDenied);
  2780         PlaySound(sndDenied);