hedgewars/uGearsList.pas
changeset 7726 1137406bce12
parent 7721 2b1ad418ba39
child 7730 2013733f9ca9
equal deleted inserted replaced
7725:4ad05a478c6c 7726:1137406bce12
   102 gear^.SoundChannel:= -1;
   102 gear^.SoundChannel:= -1;
   103 gear^.ImpactSound:= sndNone;
   103 gear^.ImpactSound:= sndNone;
   104 gear^.Density:= _1;
   104 gear^.Density:= _1;
   105 // Define ammo association, if any.
   105 // Define ammo association, if any.
   106 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
   106 gear^.AmmoType:= GearKindAmmoTypeMap[Kind];
   107 gear^.CollisionMask:= $FFFF;
   107 
   108 
   108 if CurrentHedgehog <> nil then 
   109 if CurrentHedgehog <> nil then gear^.Hedgehog:= CurrentHedgehog;
   109     begin
       
   110     gear^.Hedgehog:= CurrentHedgehog;
       
   111     if (CurrentHedgehog^.Gear <> nil) and (hwRound(CurrentHedgehog^.Gear^.X) = X) and (hwRound(CurrentHedgehog^.Gear^.Y) = Y) then
       
   112         gear^.CollisionMask:= $FF7F;
       
   113     end
       
   114 else gear^.CollisionMask:= $FFFF;
   110 
   115 
   111 if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
   116 if (Ammoz[Gear^.AmmoType].Ammo.Propz and ammoprop_NeedTarget <> 0) then
   112     gear^.Z:= cHHZ+1
   117     gear^.Z:= cHHZ+1
   113 else gear^.Z:= cUsualZ;
   118 else gear^.Z:= cUsualZ;
   114 
   119