hedgewars/uVariables.pas
branchqmlfrontend
changeset 11828 a69124eb7ce7
parent 11544 b69f5f22a3ba
parent 11734 f48408dcea36
child 11841 6adf27e85cae
--- a/hedgewars/uVariables.pas	Tue May 17 23:18:08 2016 +0300
+++ b/hedgewars/uVariables.pas	Tue May 17 23:29:49 2016 +0300
@@ -23,6 +23,8 @@
 
 uses SDLh, uTypes, uFloat, GLunit, uConsts, Math, uUtils{$IFDEF GL2}, uMatrix{$ENDIF};
 
+procedure initScreenSpaceVars();
+
 var
 /////// init flags ///////
     cMinScreenWidth    : LongInt;
@@ -2388,7 +2390,7 @@
     CurrentHedgehog: PHedgehog;
     TeamsArray: array[0..Pred(cMaxTeams)] of PTeam;
     TeamsCount: Longword;
-    ClansArray: array[0..Pred(cMaxTeams)] of PClan;
+    ClansArray, SpawnClansArray: TClansArray;
     ClansCount: Longword;
     LocalClan: LongInt;  // last non-bot, non-extdriven clan
     LocalTeam: LongInt;  // last non-bot, non-extdriven clan first team
@@ -2509,6 +2511,14 @@
     cTagsMask:= htTeamName or htName or htHealth;
 end;
 
+procedure initScreenSpaceVars();
+begin
+    // those values still are not perfect
+    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
+    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
+    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
+end;
+
 procedure initModule;
 var s: shortstring;
     i: integer;
@@ -2689,10 +2699,7 @@
     CinematicBarH   := 0;
     CinematicScript := false;
 
-    // those values still are not perfect
-    cLeftScreenBorder:= round(-cMinZoomLevel * cScreenWidth);
-    cRightScreenBorder:= round(cMinZoomLevel * cScreenWidth + LAND_WIDTH);
-    cScreenSpace:= cRightScreenBorder - cLeftScreenBorder;
+    initScreenSpaceVars();
 
     dirtyLandTexCount:= 0;
 
@@ -2766,6 +2773,8 @@
         ClansArray[i]:= nil;
         end;
 
+    SpawnClansArray:= ClansArray;
+
     for i:= Low(TeamsArray) to High(TeamsArray) do
         begin
         TeamsArray[i]:= nil;