Don’t crash when saving automatically-upgraded maps.
This commit is contained in:
@@ -311,6 +311,12 @@ namespace OpenRA
|
|||||||
LastSubCell = (SubCell)(SubCellOffsets.Length - 1);
|
LastSubCell = (SubCell)(SubCellOffsets.Length - 1);
|
||||||
DefaultSubCell = (SubCell)Game.modData.Manifest.SubCellDefaultIndex;
|
DefaultSubCell = (SubCell)Game.modData.Manifest.SubCellDefaultIndex;
|
||||||
|
|
||||||
|
if (Container.Exists("map.png"))
|
||||||
|
using (var dataStream = Container.GetContent("map.png"))
|
||||||
|
CustomPreview = new Bitmap(dataStream);
|
||||||
|
|
||||||
|
PostInit();
|
||||||
|
|
||||||
// The Uid is calculated from the data on-disk, so
|
// The Uid is calculated from the data on-disk, so
|
||||||
// format changes must be flushed to disk.
|
// format changes must be flushed to disk.
|
||||||
// TODO: this isn't very nice
|
// TODO: this isn't very nice
|
||||||
@@ -318,12 +324,6 @@ namespace OpenRA
|
|||||||
Save(path);
|
Save(path);
|
||||||
|
|
||||||
Uid = ComputeHash();
|
Uid = ComputeHash();
|
||||||
|
|
||||||
if (Container.Exists("map.png"))
|
|
||||||
using (var dataStream = Container.GetContent("map.png"))
|
|
||||||
CustomPreview = new Bitmap(dataStream);
|
|
||||||
|
|
||||||
PostInit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PostInit()
|
void PostInit()
|
||||||
|
|||||||
Reference in New Issue
Block a user