hedgewars/uGears.pas
changeset 1776 dd5648e250e4
parent 1760 55a1edd97911
child 1780 9b26e9f6ee96
equal deleted inserted replaced
1775:c7dc2f191347 1776:dd5648e250e4
   414 
   414 
   415 if Gear^.TriggerId <> 0 then TickTrigger(Gear^.TriggerId);
   415 if Gear^.TriggerId <> 0 then TickTrigger(Gear^.TriggerId);
   416 if CurAmmoGear = Gear then CurAmmoGear:= nil;
   416 if CurAmmoGear = Gear then CurAmmoGear:= nil;
   417 if FollowGear = Gear then FollowGear:= nil;
   417 if FollowGear = Gear then FollowGear:= nil;
   418 RemoveGearFromList(Gear);
   418 RemoveGearFromList(Gear);
   419 
       
   420 Dispose(Gear)
   419 Dispose(Gear)
   421 end;
   420 end;
   422 
   421 
   423 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
   422 function CheckNoDamage: boolean; // returns TRUE in case of no damaged hhs
   424 var Gear: PGear;
   423 var Gear: PGear;
  1373 		i:= GetRandom(Count);
  1372 		i:= GetRandom(Count);
  1374 		FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH);
  1373 		FindPlace(ar[i]^.Gear, false, 0, LAND_WIDTH);
  1375 		if ar[i]^.Gear <> nil then
  1374 		if ar[i]^.Gear <> nil then
  1376 			begin
  1375 			begin
  1377 			ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > LAND_WIDTH div 2;
  1376 			ar[i]^.Gear^.dX.isNegative:= hwRound(ar[i]^.Gear^.X) > LAND_WIDTH div 2;
  1378 			ar[i]^.Gear^.Pos:= GetRandom(19);
  1377 			ar[i]^.Gear^.Pos:= GetRandom(19)
  1379 			ar[i]:= ar[Count - 1]
       
  1380 			end;
  1378 			end;
       
  1379 		ar[i]:= ar[Count - 1];
  1381 		dec(Count)
  1380 		dec(Count)
  1382 		end
  1381 		end
  1383 	end
  1382 	end
  1384 end;
  1383 end;
  1385 
  1384 
  1473         i:= Low(TAmmoType);
  1472         i:= Low(TAmmoType);
  1474         dec(t, Ammoz[i].Probability);
  1473         dec(t, Ammoz[i].Probability);
  1475         while t >= 0 do
  1474         while t >= 0 do
  1476           begin
  1475           begin
  1477           inc(i);
  1476           inc(i);
       
  1477           while hasBorder and ((i = amAirAttack) or (i = amMineStrike) or (i = amNapalm)) do
       
  1478               inc(i);
       
  1479 
  1478           dec(t, Ammoz[i].Probability)
  1480           dec(t, Ammoz[i].Probability)
  1479           end;
  1481           end;
  1480         PlaySound(sndReinforce, false, CurrentTeam^.voicepack);
  1482         PlaySound(sndReinforce, false, CurrentTeam^.voicepack);
  1481         FollowGear^.Pos:= posCaseAmmo;
  1483         FollowGear^.Pos:= posCaseAmmo;
  1482         FollowGear^.State:= Longword(i)
  1484         FollowGear^.State:= Longword(i)