hedgewars/uGearsHedgehog.pas
changeset 9795 487e5675061f
parent 9776 67130612aabd
child 9809 1e32628eb167
equal deleted inserted replaced
9794:05b9eedff805 9795:487e5675061f
   875             begin
   875             begin
   876             doStepFallingGear(Gear);
   876             doStepFallingGear(Gear);
   877             Gear^.dX:= Gear^.dX * _0_8
   877             Gear^.dX:= Gear^.dX * _0_8
   878             end;
   878             end;
   879         if (land and lfBouncy = 0) or (Gear^.State and gstCollision <> 0) then
   879         if (land and lfBouncy = 0) or (Gear^.State and gstCollision <> 0) then
   880             Gear^.dY:= _0
   880             Gear^.dY:= _0;
       
   881         Gear^.State:= Gear^.State and not gstCollision 
   881         end;
   882         end;
   882     Gear^.State:= Gear^.State or gstMoving;
   883     Gear^.State:= Gear^.State or gstMoving;
   883     if (CurrentHedgehog^.Gear = Gear) and (CurrentHedgehog^.Gear^.State and gstHHDriven <> 0) and
   884     if (CurrentHedgehog^.Gear = Gear) and (CurrentHedgehog^.Gear^.State and gstHHDriven <> 0) and
   884        (not CurrentTeam^.ExtDriven) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then
   885        (not CurrentTeam^.ExtDriven) and (hwSqr(Gear^.dX) + hwSqr(Gear^.dY) > _0_003) then
   885         begin
   886         begin
   929                 Gear^.dX.isNegative:= not Gear^.dX.isNegative // landing after high jump
   930                 Gear^.dX.isNegative:= not Gear^.dX.isNegative // landing after high jump
   930                 end;
   931                 end;
   931             Gear^.State:= Gear^.State and (not (gstHHJumping or gstHHHJump));
   932             Gear^.State:= Gear^.State and (not (gstHHJumping or gstHHHJump));
   932             if (land and lfBouncy = 0) or (Gear^.dX.QWordValue < _0_02.QWordValue) then
   933             if (land and lfBouncy = 0) or (Gear^.dX.QWordValue < _0_02.QWordValue) then
   933                 Gear^.dY:= _0
   934                 Gear^.dY:= _0
   934             end
   935             end;
       
   936         Gear^.State:= Gear^.State and not gstCollision 
   935         end
   937         end
   936     else
   938     else
   937         Gear^.dY:= Gear^.dY + cGravity;
   939         Gear^.dY:= Gear^.dY + cGravity;
   938 
   940 
   939     if ((Gear^.State and gstMoving) <> 0) then
   941     if ((Gear^.State and gstMoving) <> 0) then
  1053         if (land <> 0) and ((land and lfBouncy = 0) or (Gear^.State and gstCollision <> 0)) then
  1055         if (land <> 0) and ((land and lfBouncy = 0) or (Gear^.State and gstCollision <> 0)) then
  1054             begin
  1056             begin
  1055             CheckHHDamage(Gear);
  1057             CheckHHDamage(Gear);
  1056             Gear^.dY:= _0;
  1058             Gear^.dY:= _0;
  1057             Gear^.Y:= Gear^.Y + _1
  1059             Gear^.Y:= Gear^.Y + _1
  1058             end
  1060             end;
       
  1061         Gear^.State:= Gear^.State and not gstCollision 
  1059         end;
  1062         end;
  1060 
  1063 
  1061     CheckGearDrowning(Gear);
  1064     CheckGearDrowning(Gear);
  1062     // could become nil if ai's hog fails to respawn in ai survival
  1065     // could become nil if ai's hog fails to respawn in ai survival
  1063     if Gear = nil then exit;
  1066     if Gear = nil then exit;