DEADSOFTWARE

some fixes for recursive grid queries (grid doesn't support recursive queries, but...
[d2df-sdl.git] / src / game / g_map.pas
index b9da59dd6d2064a97120d49f7bca56425d8533b3..4f86e9b0d3f14ddc3f21e097756080f4996e2e12 100644 (file)
@@ -1217,7 +1217,7 @@ begin
   calcBoundingBox(gLifts);
   calcBoundingBox(gBlockMon);
 
-  e_WriteLog(Format('map dimensions: (%d,%d)-(%d,%d); editor size:(0,0)-(%d,%d)', [mapX0, mapY0, mapX1, mapY1, gMapInfo.Width, gMapInfo.Height]), MSG_WARNING);
+  e_LogWritefln('map dimensions: (%d,%d)-(%d,%d); editor size:(0,0)-(%d,%d)', [mapX0, mapY0, mapX1, mapY1, gMapInfo.Width, gMapInfo.Height]);
 
   if (mapX0 > 0) then mapX0 := 0;
   if (mapY0 > 0) then mapY0 := 0;
@@ -1359,12 +1359,16 @@ begin
         SetLength(s, 64);
         CopyMemory(@s[1], @_textures[a].Resource[0], 64);
         for b := 1 to Length(s) do
+        begin
           if s[b] = #0 then
           begin
             SetLength(s, b-1);
             Break;
           end;
+        end;
+        {$IF DEFINED(D2F_DEBUG)}
         e_WriteLog(Format('    Loading texture #%d: %s', [a, s]), MSG_NOTIFY);
+        {$ENDIF}
         //if g_Map_IsSpecialTexture(s) then e_WriteLog('      SPECIAL!', MSG_NOTIFY);
       // Àíèìèðîâàííàÿ òåêñòóðà:
         if ByteBool(_textures[a].Anim) then
@@ -2757,6 +2761,7 @@ var
     PAMem.LoadFromMemory(Mem);
 
     for i := 0 to Length(panels)-1 do
+    begin
       if panels[i].SaveIt then
       begin
       // ID ïàíåëè:
@@ -2767,7 +2772,10 @@ var
         end;
       // Çàãðóæàåì ïàíåëü:
         panels[i].LoadState(PAMem);
+        if (panels[i].arrIdx <> i) then raise Exception.Create('g_Map_LoadState: LoadPanelArray: Wrong Panel arrIdx');
+        if (panels[i].proxyId >= 0) then mapGrid.proxyEnabled[panels[i].proxyId] := panels[i].Enabled;
       end;
+    end;
 
   // Ýòîò ñïèñîê ïàíåëåé çàãðóæåí:
     PAMem.Free();
@@ -2820,7 +2828,7 @@ begin
 
 // Îáíîâëÿåì êàðòó ñòîëêíîâåíèé è ñåòêó:
   g_GFX_Init();
-  mapCreateGrid();
+  //mapCreateGrid();
 
 ///// Çàãðóæàåì ìóçûêó: /////
 // Ñèãíàòóðà ìóçûêè: