hedgewars/uGearsHandlersMess.pas
changeset 9385 dca86192d773
parent 9362 c9fdf8a3baf0
child 9470 9ed07a96349d
equal deleted inserted replaced
9383:92e3fb58e1e1 9385:dca86192d773
  1430     AllInactive := false;
  1430     AllInactive := false;
  1431     dec(Gear^.Timer);
  1431     dec(Gear^.Timer);
  1432     if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then
  1432     if ((GameFlags and gfInfAttack) <> 0) and (TurnTimeLeft > 0) then
  1433         dec(TurnTimeLeft);
  1433         dec(TurnTimeLeft);
  1434 
  1434 
       
  1435     if Gear^.Hedgehog^.Gear = nil then
       
  1436         begin
       
  1437         DeleteGear(Gear);
       
  1438         AfterAttack;
       
  1439         exit
       
  1440         end;
       
  1441 
  1435     HHGear := Gear^.Hedgehog^.Gear;
  1442     HHGear := Gear^.Hedgehog^.Gear;
  1436 
  1443 
  1437     HedgehogChAngle(HHGear);
  1444     HedgehogChAngle(HHGear);
  1438 
  1445 
  1439     b := false;
  1446     b := false;
  1491             HHGear^.State := HHGear^.State and (not gstNoDamage)
  1498             HHGear^.State := HHGear^.State and (not gstNoDamage)
  1492             end;
  1499             end;
  1493         end;
  1500         end;
  1494 
  1501 
  1495     if b then
  1502     if b then
  1496     begin
  1503         begin
  1497         DrawTunnel(HHGear^.X + Gear^.dX * cHHRadius,
  1504         DrawTunnel(HHGear^.X + Gear^.dX * cHHRadius,
  1498         HHGear^.Y + Gear^.dY * cHHRadius - _1 -
  1505         HHGear^.Y + Gear^.dY * cHHRadius - _1 -
  1499         ((hwAbs(Gear^.dX) / (hwAbs(Gear^.dX) + hwAbs(Gear^.dY))) * _0_5 * 7),
  1506         ((hwAbs(Gear^.dX) / (hwAbs(Gear^.dX) + hwAbs(Gear^.dY))) * _0_5 * 7),
  1500         Gear^.dX, Gear^.dY,
  1507         Gear^.dX, Gear^.dY,
  1501         cHHStepTicks, cHHRadius * 2 + 7);
  1508         cHHStepTicks, cHHRadius * 2 + 7);
  1502     end;
  1509         end;
  1503 
  1510 
  1504     if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
  1511     if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
  1505     or ((HHGear^.Message and gmAttack) <> 0) then
  1512     or ((HHGear^.Message and gmAttack) <> 0) then
  1506         begin
  1513         begin
  1507         HHGear^.Message := 0;
  1514         HHGear^.Message := 0;