Bugfixes: ZipFile.GetInputStream().GetAllBytes/.Length doesn't work; Divide by zero when no shellmaps are available; UseAsShellmap isn't saved by the editor; Duplicate maps crashes game.

This commit is contained in:
Paul Chote
2010-12-30 16:39:26 +13:00
parent 47bbc3a6de
commit cb50182fac
4 changed files with 28 additions and 7 deletions

View File

@@ -195,11 +195,12 @@ namespace OpenRA
public void Save(string toPath)
{
Console.WriteLine("Saving map to path {0}",toPath);
// Todo: save to a zip file in the support dir by default
MapFormat = 3;
var root = new List<MiniYamlNode>();
foreach (var field in new string[] {"Selectable", "MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "MapSize", "TopLeft", "BottomRight"})
foreach (var field in new string[] {"Selectable", "MapFormat", "Title", "Description", "Author", "PlayerCount", "Tileset", "MapSize", "TopLeft", "BottomRight", "UseAsShellmap"})
{
FieldInfo f = this.GetType().GetField(field);
if (f.GetValue(this) == null) continue;