hedgewars/uGears.pas
changeset 4783 f9564c66a086
parent 4780 8571151411b3
child 4784 d8eafc8dba38
equal deleted inserted replaced
4782:603916ddf4b6 4783:f9564c66a086
  1838     *)
  1838     *)
  1839 
  1839 
  1840     if (x < 4) and (TeamsArray[t] <> nil) then
  1840     if (x < 4) and (TeamsArray[t] <> nil) then
  1841         begin
  1841         begin
  1842             // if team matches current hedgehog team, default to current hedgehog
  1842             // if team matches current hedgehog team, default to current hedgehog
  1843             if (i = 0) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
  1843             if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
  1844             else 
  1844             else 
  1845                 begin
  1845                 begin
  1846             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i
  1846             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i
  1847                 j:= 0;
  1847                 j:= 0;
  1848                 c:= 0;
  1848                 c:= 0;