hedgewars/GSHandlers.inc
changeset 4708 aa1da6339eb3
parent 4691 d07fa8480491
child 4758 73aef6a577ba
equal deleted inserted replaced
4707:1d3b19eabfe7 4708:aa1da6339eb3
   910 end;
   910 end;
   911 
   911 
   912 procedure doStepDEagleShot(Gear: PGear);
   912 procedure doStepDEagleShot(Gear: PGear);
   913 begin
   913 begin
   914     PlaySound(sndGun);
   914     PlaySound(sndGun);
       
   915     // add an initial step to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths
       
   916     Gear^.X := Gear^.X + Gear^.dX;  
       
   917     Gear^.Y := Gear^.Y + Gear^.dY;
   915     Gear^.doStep := @doStepBulletWork
   918     Gear^.doStep := @doStepBulletWork
   916 end;
   919 end;
   917 
   920 
   918 procedure doStepSniperRifleShot(Gear: PGear);
   921 procedure doStepSniperRifleShot(Gear: PGear);
   919 var 
   922 var 
   943         end;
   946         end;
   944         Gear^.State := Gear^.State or gstAnimation;
   947         Gear^.State := Gear^.State or gstAnimation;
   945         Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5;
   948         Gear^.dX := SignAs(AngleSin(HHGear^.Angle), HHGear^.dX) * _0_5;
   946         Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5;
   949         Gear^.dY := -AngleCos(HHGear^.Angle) * _0_5;
   947         PlaySound(sndGun);
   950         PlaySound(sndGun);
       
   951         // add an initial step to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths
       
   952         Gear^.X := Gear^.X + Gear^.dX;  
       
   953         Gear^.Y := Gear^.Y + Gear^.dY;
   948         Gear^.doStep := @doStepBulletWork;
   954         Gear^.doStep := @doStepBulletWork;
   949     end
   955     end
   950     else
   956     else
   951         if (GameTicks mod 32) = 0 then
   957         if (GameTicks mod 32) = 0 then
   952             if (GameTicks mod 4096) < 2048 then
   958             if (GameTicks mod 4096) < 2048 then