hedgewars/uTeams.pas
changeset 11539 c22d292e7266
parent 11532 bf86c6cb9341
child 11734 f48408dcea36
--- a/hedgewars/uTeams.pas	Mon Feb 08 14:58:36 2016 +0300
+++ b/hedgewars/uTeams.pas	Tue Feb 09 14:40:06 2016 +0300
@@ -608,14 +608,18 @@
     // color is always little endian so the mask must be constant also in big endian archs
     Color:= Color or $FF000000;
     AddTeam(Color);
-    CurrentTeam^.TeamName:= ts;
-    CurrentTeam^.PlayerHash:= s;
-    loadTeamBinds(ts);
+    
+    if CurrentTeam <> nil then
+        begin
+        CurrentTeam^.TeamName:= ts;
+        CurrentTeam^.PlayerHash:= s;
+        loadTeamBinds(ts);
 
-    if GameType in [gmtDemo, gmtSave, gmtRecord] then
-        CurrentTeam^.ExtDriven:= true;
+        if GameType in [gmtDemo, gmtSave, gmtRecord] then
+            CurrentTeam^.ExtDriven:= true;
 
-    CurrentTeam^.voicepack:= AskForVoicepack('Default')
+        CurrentTeam^.voicepack:= AskForVoicepack('Default')
+        end
     end
 end;