hedgewars/GSHandlers.inc
changeset 358 236bbd12d4d9
parent 357 165a040e4cfa
child 370 c75410fe3133
equal deleted inserted replaced
357:165a040e4cfa 358:236bbd12d4d9
   424 doStepPickHammerWork(Gear);
   424 doStepPickHammerWork(Gear);
   425 Gear^.doStep:= @doStepPickHammerWork
   425 Gear^.doStep:= @doStepPickHammerWork
   426 end;
   426 end;
   427 
   427 
   428 ////////////////////////////////////////////////////////////////////////////////
   428 ////////////////////////////////////////////////////////////////////////////////
   429 var BTPrevAngle, BTSteps: Longword;
   429 var BTPrevAngle, BTSteps: integer;
   430 
   430 
   431 procedure doStepBlowTorchWork(Gear: PGear);
   431 procedure doStepBlowTorchWork(Gear: PGear);
   432 var HHGear: PGear;
   432 var HHGear: PGear;
   433     b: boolean;
   433     b: boolean;
   434 begin
   434 begin
   438 
   438 
   439 HedgehogChAngle(HHGear);
   439 HedgehogChAngle(HHGear);
   440 
   440 
   441 b:= false;
   441 b:= false;
   442 
   442 
   443 if (HHGear^.Angle <> BTPrevAngle) then
   443 if abs(integer(HHGear^.Angle) - BTPrevAngle) > 7  then
   444    begin
   444    begin
   445    Gear^.dX:= hwSign(HHGear^.dX) * AngleSin(HHGear^.Angle) * _0_5;
   445    Gear^.dX:= hwSign(HHGear^.dX) * AngleSin(HHGear^.Angle) * _0_5;
   446    Gear^.dY:= AngleCos(HHGear^.Angle) * ( - _0_5);
   446    Gear^.dY:= AngleCos(HHGear^.Angle) * ( - _0_5);
   447    BTPrevAngle:= HHGear^.Angle;
   447    BTPrevAngle:= HHGear^.Angle;
   448 //   b:= true
   448    b:= true
   449    end;
   449    end;
   450 
   450 
   451 if Gear^.Timer mod cHHStepTicks = 0 then
   451 if Gear^.Timer mod cHHStepTicks = 0 then
   452    begin
   452    begin
   453    b:= true;
   453    b:= true;
   486 end;
   486 end;
   487 
   487 
   488 procedure doStepBlowTorch(Gear: PGear);
   488 procedure doStepBlowTorch(Gear: PGear);
   489 var HHGear: PGear;
   489 var HHGear: PGear;
   490 begin
   490 begin
   491 BTPrevAngle:= High(Longword);
   491 BTPrevAngle:= High(integer);
   492 BTSteps:= 0;
   492 BTSteps:= 0;
   493 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
   493 HHGear:= PHedgehog(Gear^.Hedgehog)^.Gear;
   494 HHGear^.Message:= 0;
   494 HHGear^.Message:= 0;
   495 Gear^.doStep:= @doStepBlowTorchWork
   495 Gear^.doStep:= @doStepBlowTorchWork
   496 end;
   496 end;