if there are no Playable playerrefs in the map, make as many as there are spawnpoints (hack)

This commit is contained in:
Chris Forbes
2010-08-23 21:39:27 +12:00
parent 298f5ec24f
commit 4a337185f5
2 changed files with 12 additions and 0 deletions

View File

@@ -169,6 +169,17 @@ namespace OpenRA
default:
throw new InvalidDataException("Map format {0} is not supported.".F(MapFormat));
}
/* hack: make some slots. */
if (!Players.Any(p => p.Value.Playable))
{
int index = 0;
foreach (var wp in Waypoints)
{
var p = new PlayerReference("Multi{0}".F(index++), "Random", false, false) { Playable = true };
Players.Add(p.Name, p);
}
}
// Smudges