hedgewars/HHHandlers.inc
changeset 5322 1bcc12a30d5d
parent 5319 51d8e4747876
child 5343 ff7ecf483759
equal deleted inserted replaced
5319:51d8e4747876 5322:1bcc12a30d5d
   171     newGear:  PGear;
   171     newGear:  PGear;
   172     CurWeapon: PAmmo;
   172     CurWeapon: PAmmo;
   173     altUse: boolean;
   173     altUse: boolean;
   174     elastic: hwFloat;
   174     elastic: hwFloat;
   175 begin
   175 begin
       
   176 newGear:= nil;
   176 bShowFinger:= false;
   177 bShowFinger:= false;
   177 CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
   178 CurWeapon:= GetAmmoEntry(Gear^.Hedgehog^);
   178 with Gear^,
   179 with Gear^,
   179      Gear^.Hedgehog^ do
   180      Gear^.Hedgehog^ do
   180      begin
   181      begin
   374                   end;
   375                   end;
   375 
   376 
   376         // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement
   377         // Clear FollowGear if using on a rope/parachute/saucer etc so focus stays with the hog's movement
   377         if altUse then FollowGear:= nil;
   378         if altUse then FollowGear:= nil;
   378 
   379 
   379         if ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) and (newGear <> nil) then
   380         if (newGear <> nil) and ((Ammoz[newGear^.AmmoType].Ammo.Propz and ammoprop_SetBounce) <> 0) then
   380             begin
   381             begin
   381             elastic:=  int2hwfloat(CurWeapon^.Bounciness) / _1000;
   382             elastic:=  int2hwfloat(CurWeapon^.Bounciness) / _1000;
   382 
   383 
   383             if elastic < _1 then newGear^.Elasticity:= newGear^.Elasticity * elastic
   384             if elastic < _1 then newGear^.Elasticity:= newGear^.Elasticity * elastic
   384             else if elastic > _1 then newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic);
   385             else if elastic > _1 then newGear^.Elasticity:= _1 - ((_1-newGear^.Elasticity) / elastic);