hedgewars/uGearsUtils.pas
changeset 11550 881231c1ba46
parent 11479 846a3b3a3d1c
child 11551 aefc770feb65
equal deleted inserted replaced
11549:893722a2a1f9 11550:881231c1ba46
  1168     Ammo^.Health:= 0;
  1168     Ammo^.Health:= 0;
  1169 while i > 0 do
  1169 while i > 0 do
  1170     begin
  1170     begin
  1171     dec(i);
  1171     dec(i);
  1172     Gear:= t^.ar[i];
  1172     Gear:= t^.ar[i];
       
  1173     if (Ammo^.Data <> nil) and (Ammo^.Kind in [gtShotgunShot, gtDEagleShot, gtSniperRifleShot, gtSineGunShot]) and (PGear(Ammo^.Data) = Gear) then
       
  1174         continue;
  1173     if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and
  1175     if ((Ammo^.Kind = gtFlame) or (Ammo^.Kind = gtBlowTorch)) and
  1174        (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then
  1176        (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.Effects[heFrozen] > 255) then
  1175         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1177         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1176     tmpDmg:= ModifyDamage(Damage, Gear);
  1178     tmpDmg:= ModifyDamage(Damage, Gear);
  1177     if (Gear^.State and gstNoDamage) = 0 then
  1179     if (Gear^.State and gstNoDamage) = 0 then
  1508 WorldWrap:= false;
  1510 WorldWrap:= false;
  1509 if WorldEdge = weNone then exit(false);
  1511 if WorldEdge = weNone then exit(false);
  1510 if (hwRound(Gear^.X) < LongInt(leftX)) or
  1512 if (hwRound(Gear^.X) < LongInt(leftX)) or
  1511    (hwRound(Gear^.X) > LongInt(rightX)) then
  1513    (hwRound(Gear^.X) > LongInt(rightX)) then
  1512     begin
  1514     begin
       
  1515     // bullets can now hurt the hog that fired them
       
  1516     if (WorldEdge <> weSea) and (Gear^.Kind in [gtShotgunShot, gtDEagleShot, gtSniperRifleShot, gtSineGunShot]) then
       
  1517         Gear^.Data:= nil;
  1513     if WorldEdge = weWrap then
  1518     if WorldEdge = weWrap then
  1514         begin
  1519         begin
  1515         if (hwRound(Gear^.X) < LongInt(leftX)) then
  1520         if (hwRound(Gear^.X) < LongInt(leftX)) then
  1516              Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX)
  1521              Gear^.X:= Gear^.X + int2hwfloat(rightX - leftX)
  1517         else Gear^.X:= Gear^.X - int2hwfloat(rightX - leftX);
  1522         else Gear^.X:= Gear^.X - int2hwfloat(rightX - leftX);