hedgewars/uGears.pas
changeset 4783 f9564c66a086
parent 4780 8571151411b3
child 4784 d8eafc8dba38
--- a/hedgewars/uGears.pas	Thu Dec 30 01:44:55 2010 +0100
+++ b/hedgewars/uGears.pas	Wed Dec 29 22:44:45 2010 -0500
@@ -1840,7 +1840,7 @@
     if (x < 4) and (TeamsArray[t] <> nil) then
         begin
             // if team matches current hedgehog team, default to current hedgehog
-            if (i = 0) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
+            if (i = 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.Team = TeamsArray[t]) then hh:= CurrentHedgehog
             else 
                 begin
             // otherwise use the first living hog or the hog amongs the remaining ones indicated by i