From eb85189c24916e4cd9a7b91bc81f5ca9f8eb4413 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 1 Aug 2010 18:42:48 +1200 Subject: [PATCH] transparently upgrade maps produced by buggy converter --- OpenRA.Editor/Form1.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index e8f363267d..36f1f15e90 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -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().First().Race, true, true)); + PrepareMapResources(manifest, map); dirty = false;