hedgewars/uGears.pas
changeset 14778 bbec6b28d072
parent 14768 185f07ec4d12
child 14860 259840ca77e3
equal deleted inserted replaced
14777:8015a6e4ca3c 14778:bbec6b28d072
  1306     if text = '' then text:= '...';
  1306     if text = '' then text:= '...';
  1307 
  1307 
  1308     if (x < 4) and (TeamsArray[t] <> nil) then
  1308     if (x < 4) and (TeamsArray[t] <> nil) then
  1309         begin
  1309         begin
  1310             // if team matches current hedgehog team, default to current hedgehog
  1310             // if team matches current hedgehog team, default to current hedgehog
  1311             if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then
  1311             if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) and (not CurrentHedgehog^.Unplaced) then
  1312                 hh:= CurrentHedgehog
  1312                 hh:= CurrentHedgehog
  1313             else
  1313             else
  1314                 begin
  1314                 begin
  1315             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i
  1315             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i
  1316                 j:= 0;
  1316                 j:= 0;
  1317                 c:= 0;
  1317                 c:= 0;
  1318                 while (j <= cMaxHHIndex) and (hh = nil) do
  1318                 while (j <= cMaxHHIndex) and (hh = nil) do
  1319                     begin
  1319                     begin
  1320                     if (TeamsArray[t]^.Hedgehogs[j].Gear <> nil) then
  1320                     if (TeamsArray[t]^.Hedgehogs[j].Gear <> nil) and (not TeamsArray[t]^.Hedgehogs[j].Unplaced) then
  1321                         begin
  1321                         begin
  1322                         inc(c);
  1322                         inc(c);
  1323                         if (i=0) or (i=c) then
  1323                         if (i=0) or (i=c) then
  1324                             hh:= @TeamsArray[t]^.Hedgehogs[j]
  1324                             hh:= @TeamsArray[t]^.Hedgehogs[j]
  1325                         end;
  1325                         end;