transparently upgrade maps produced by buggy converter

This commit is contained in:
Chris Forbes
2010-08-01 18:42:48 +12:00
parent 9bd808fcb8
commit eb85189c24

View File

@@ -72,6 +72,12 @@ namespace OpenRA.Editor
// load the map
var map = new Map(new Folder(mapname));
// upgrade maps that have no player definitions. editor doesnt care,
// but this breaks the game pretty badly.
if (map.Players.Count == 0)
map.Players.Add("Neutral", new PlayerReference("Neutral",
Rules.Info["world"].Traits.WithInterface<CountryInfo>().First().Race, true, true));
PrepareMapResources(manifest, map);
dirty = false;