DEADSOFTWARE

map: fix sky loading while import ini map
[d2df-editor.git] / src / editor / g_map.pas
index 792f258c43bb41a22a472eaf166e062391ddde1e..10160e4ac0b6a679d1caa2f7934d123e1d5130c9 100644 (file)
@@ -1730,7 +1730,7 @@ begin
     MainForm.pbLoad.StepIt();
     Application.ProcessMessages();
 
-    s := TexturePrefix + UpperCase(map.ReadStr('Textures', 'TextureName'+IntToStr(a), ''));
+    s := TexturePrefix + UpperCase(win2utf(map.ReadStr('Textures', 'TextureName'+IntToStr(a), '')));
     if s = TexturePrefix then
       Continue;
 
@@ -1784,7 +1784,7 @@ begin
   // Текстура панели:
     if panel.PanelType in [PANEL_WALL, PANEL_BACK, PANEL_FORE, PANEL_STEP] then
       begin
-        s := TexturePrefix + UpperCase(map.ReadStr(section, 'TextureName', ''));
+        s := TexturePrefix + UpperCase(win2utf(map.ReadStr(section, 'TextureName', '')));
 
         if g_GetTexture(s, panel.TextureID) then
           begin
@@ -1897,8 +1897,8 @@ begin
 // Чтение параметров карты:
   with gMapInfo do
   begin
-    Name := map.ReadStr('MapOptions', 'MapName', '');
-    Description := map.ReadStr('MapOptions', 'MapDescription', '');
+    Name := win2utf(map.ReadStr('MapOptions', 'MapName', ''));
+    Description := win2utf(map.ReadStr('MapOptions', 'MapDescription', ''));
     Author := '';
     MusicName := DefaultMusRes;
     SkyName := DefaultSkyRes;
@@ -1912,6 +1912,8 @@ begin
       SetLength(Description, 256);
   end;
 
+  LoadSky(gMapInfo.SkyName);
+
   map.Free();
 
   Result := True;