hedgewars/HHHandlers.inc
changeset 2434 5faa05d99241
parent 2428 6800f8aa0184
child 2457 ecf0c7e7995b
equal deleted inserted replaced
2433:332287d62c81 2434:5faa05d99241
    41 			begin
    41 			begin
    42 			CurAmmo:= 0;
    42 			CurAmmo:= 0;
    43 			inc(i);
    43 			inc(i);
    44 			TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
    44 			TryDo(i < 2, 'Engine bug: no ammo in current slot', true)
    45 			end;
    45 			end;
    46 		until (Ammo^[slot, CurAmmo].Count > 0) and ((Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns) or ((TrainingFlags and tfIgnoreDelays) <> 0))
    46 		until (Ammo^[slot, CurAmmo].Count > 0) and (Team^.Clan^.TurnNumber > Ammoz[Ammo^[slot, CurAmmo].AmmoType].SkipTurns)
    47 		end else
    47 		end else
    48 		begin
    48 		begin
    49 		i:= 0;
    49 		i:= 0;
    50 		// check whether there is ammo in slot
    50 		// check whether there is ammo in slot
    51 		while (i <= cMaxSlotAmmoIndex)
    51 		while (i <= cMaxSlotAmmoIndex)
    52 		  and ((Ammo^[slot, i].Count = 0)
    52 		  and ((Ammo^[slot, i].Count = 0)
    53 		       or ((Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns) and ((TrainingFlags and tfIgnoreDelays) = 0))) do inc(i);
    53 		       or (Team^.Clan^.TurnNumber <= Ammoz[Ammo^[slot, i].AmmoType].SkipTurns)) do inc(i);
    54 
    54 
    55 		if i <= cMaxSlotAmmoIndex then
    55 		if i <= cMaxSlotAmmoIndex then
    56 			begin
    56 			begin
    57 			CurSlot:= slot;
    57 			CurSlot:= slot;
    58 			CurAmmo:= i
    58 			CurAmmo:= i
    65 var t: LongInt;
    65 var t: LongInt;
    66     weap: TAmmoType;
    66     weap: TAmmoType;
    67 begin
    67 begin
    68 weap:= TAmmoType(Gear^.MsgParam);
    68 weap:= TAmmoType(Gear^.MsgParam);
    69 
    69 
    70 if (PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns) and ((TrainingFlags and tfIgnoreDelays) = 0) then exit; // weapon is not activated yet
    70 if PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then exit; // weapon is not activated yet
    71 
    71 
    72 Gear^.MsgParam:= Ammoz[weap].Slot;
    72 Gear^.MsgParam:= Ammoz[weap].Slot;
    73 
    73 
    74 t:= cMaxSlotAmmoIndex;
    74 t:= cMaxSlotAmmoIndex;
    75 
    75