hedgewars/uCollisions.pas
changeset 15722 498c1482dec2
parent 15674 f5b127ee3196
child 15900 128ace913837
equal deleted inserted replaced
15721:1244c64b8e28 15722:498c1482dec2
   669         begin
   669         begin
   670             info:= cinfos[i];
   670             info:= cinfos[i];
   671             if (Gear <> info.cGear)
   671             if (Gear <> info.cGear)
   672                 and ((centerX > info.X) xor (Dir > 0))
   672                 and ((centerX > info.X) xor (Dir > 0))
   673                 and ((info.cGear^.State and gstNotKickable) = 0)
   673                 and ((info.cGear^.State and gstNotKickable) = 0)
   674                 and ((info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife])
   674                 and ((info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtSentry])
   675                     or (info.cGear^.Kind = gtExplosives) and ((info.cGear^.State and gsttmpflag) <> 0)) // only apply X kick if the barrel is knocked over
   675                     or (info.cGear^.Kind = gtExplosives) and ((info.cGear^.State and gsttmpflag) <> 0)) // only apply X kick if the barrel is knocked over
   676                 and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then
   676                 and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then
   677             begin
   677             begin
   678                 with info.cGear^ do
   678                 with info.cGear^ do
   679                 begin
   679                 begin
   716         begin
   716         begin
   717             info := cinfos[i];
   717             info := cinfos[i];
   718             if (Gear <> info.cGear)
   718             if (Gear <> info.cGear)
   719                 and ((centerY + Gear^.Radius > info.Y) xor (Dir > 0))
   719                 and ((centerY + Gear^.Radius > info.Y) xor (Dir > 0))
   720                 and (info.cGear^.State and gstNotKickable = 0)
   720                 and (info.cGear^.State and gstNotKickable = 0)
   721                 and (info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives])
   721                 and (info.cGear^.Kind in [gtHedgehog, gtMine, gtKnife, gtExplosives, gtSentry])
   722                 and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then
   722                 and (sqr(centerX - info.X) + sqr(centerY - info.Y) <= sqr(info.Radius + Gear^.Radius + 2)) then
   723             begin
   723             begin
   724                 with info.cGear^ do
   724                 with info.cGear^ do
   725                 begin
   725                 begin
   726                     if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then
   726                     if (Kind <> gtExplosives) or ((State and gsttmpflag) <> 0) then