hedgewars/uGears.pas
changeset 5588 cf643996c1ee
parent 5586 3bb02b92df7d
child 5590 efd92458c75c
equal deleted inserted replaced
5586:3bb02b92df7d 5588:cf643996c1ee
  1354                     r:= Gear^.Radius + t^.Radius;
  1354                     r:= Gear^.Radius + t^.Radius;
  1355                     dx:= Gear^.X-t^.X;
  1355                     dx:= Gear^.X-t^.X;
  1356                     dx.isNegative:= false;
  1356                     dx.isNegative:= false;
  1357                     dy:= Gear^.Y-t^.Y;
  1357                     dy:= Gear^.Y-t^.Y;
  1358                     dy.isNegative:= false;
  1358                     dy.isNegative:= false;
  1359                     if r - hwRound(dx+dy) < 25 then
  1359                     if hwRound(dx+dy) < 25+r then
  1360                         begin
  1360                         begin
  1361                         dist:= hwRound(Distance(dx, dy));
  1361                         dist:= hwRound(Distance(dx, dy));
  1362                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1362                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1363                         end;
  1363                         end;
  1364                     if dmg > 0 then
  1364                     if dmg > 0 then
  1380                     r:= Gear^.Radius + t^.Radius;
  1380                     r:= Gear^.Radius + t^.Radius;
  1381                     dx:= Gear^.X-t^.X;
  1381                     dx:= Gear^.X-t^.X;
  1382                     dx.isNegative:= false;
  1382                     dx.isNegative:= false;
  1383                     dy:= Gear^.Y-t^.Y;
  1383                     dy:= Gear^.Y-t^.Y;
  1384                     dy.isNegative:= false;
  1384                     dy.isNegative:= false;
  1385                     if r - hwRound(dx+dy) < 25 then
  1385                     if hwRound(dx+dy) < 25+r then
  1386                         begin
  1386                         begin
  1387                         dist:= hwRound(Distance(dx, dy));
  1387                         dist:= hwRound(Distance(dx, dy));
  1388                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1388                         dmg:= ModifyDamage(min(r - dist, 25), t);
  1389                         end;
  1389                         end;
  1390                     if dmg > 0 then
  1390                     if dmg > 0 then