hedgewars/uGearsHandlersRope.pas
changeset 12821 f3e07e53460d
parent 12819 3fc7569c1203
child 13069 ba7ac61c7668
equal deleted inserted replaced
12820:4c1c468725ff 12821:f3e07e53460d
    64     if ((HHGear^.State and gstHHDriven) = 0)
    64     if ((HHGear^.State and gstHHDriven) = 0)
    65     or (CheckGearDrowning(HHGear))
    65     or (CheckGearDrowning(HHGear))
    66     or (TestCollisionYwithGear(HHGear, 1) <> 0) then
    66     or (TestCollisionYwithGear(HHGear, 1) <> 0) then
    67         begin
    67         begin
    68         DeleteGear(Gear);
    68         DeleteGear(Gear);
       
    69         if (TestCollisionYwithGear(HHGear, 1) <> 0) and (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
       
    70             HHGear^.Hedgehog^.CurAmmoType:= amRope;
    69         isCursorVisible := false;
    71         isCursorVisible := false;
    70         ApplyAmmoChanges(HHGear^.Hedgehog^);
    72         ApplyAmmoChanges(HHGear^.Hedgehog^);
    71         exit
    73         exit
    72         end;
    74         end;
    73 
    75 
   448         begin
   450         begin
   449         HHGear^.State := HHGear^.State and (not (gstAttacking or gstHHJumping or gstHHHJump));
   451         HHGear^.State := HHGear^.State and (not (gstAttacking or gstHHJumping or gstHHHJump));
   450         HHGear^.Message := HHGear^.Message and (not gmAttack);
   452         HHGear^.Message := HHGear^.Message and (not gmAttack);
   451         DeleteGear(Gear);
   453         DeleteGear(Gear);
   452         if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   454         if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   453             SetWeapon(amRope);
   455             HHGear^.Hedgehog^.CurAmmoType:= amRope;
       
   456         isCursorVisible := false;
       
   457         ApplyAmmoChanges(HHGear^.Hedgehog^);
   454         exit()
   458         exit()
   455         end;
   459         end;
   456 
   460 
   457     DeleteCI(HHGear);
   461     DeleteCI(HHGear);
   458 
   462 
   542                 State := State and (not gstAttacking);
   546                 State := State and (not gstAttacking);
   543                 Message := Message and (not gmAttack)
   547                 Message := Message and (not gmAttack)
   544                 end;
   548                 end;
   545         DeleteGear(Gear);
   549         DeleteGear(Gear);
   546         if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   550         if (GetAmmoEntry(HHGear^.Hedgehog^, amRope)^.Count >= 1) and ((Ammoz[HHGear^.Hedgehog^.CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   547             SetWeapon(amRope);
   551             HHGear^.Hedgehog^.CurAmmoType:= amRope;
       
   552         isCursorVisible := false;
       
   553         ApplyAmmoChanges(HHGear^.Hedgehog^);
   548         exit;
   554         exit;
   549         end;
   555         end;
   550     if CheckGearDrowning(HHGear) then DeleteGear(Gear)
   556     if CheckGearDrowning(HHGear) then DeleteGear(Gear)
   551 end;
   557 end;
   552 
   558