fix some subtle crap in map upgrader
This commit is contained in:
@@ -149,9 +149,25 @@ namespace OpenRA
|
||||
|
||||
return ret;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/* hack: make some slots. */
|
||||
if (!Players.Any(p => p.Value.Playable))
|
||||
{
|
||||
for (int index = 0; index < SpawnPoints.Count(); index++)
|
||||
{
|
||||
var p = new PlayerReference
|
||||
{
|
||||
Name = "Multi{0}".F(index),
|
||||
Race = "Random",
|
||||
Playable = true,
|
||||
DefaultStartingUnits = true,
|
||||
Enemies = new[] { "Creeps" }
|
||||
};
|
||||
Players.Add(p.Name, p);
|
||||
}
|
||||
}
|
||||
|
||||
// Upgrade map to format 5
|
||||
if (MapFormat < 5)
|
||||
{
|
||||
@@ -171,26 +187,9 @@ namespace OpenRA
|
||||
Name = "Creeps",
|
||||
Race = "Random",
|
||||
NonCombatant = true,
|
||||
Enemies = Players.Keys.Where(k => k != "Neutral").ToArray()
|
||||
Enemies = Players.Where(p => p.Value.Playable).Select(p => p.Key).ToArray()
|
||||
});
|
||||
}
|
||||
|
||||
/* hack: make some slots. */
|
||||
if (!Players.Any(p => p.Value.Playable))
|
||||
{
|
||||
for (int index = 0; index < SpawnPoints.Count(); index++)
|
||||
{
|
||||
var p = new PlayerReference
|
||||
{
|
||||
Name = "Multi{0}".F(index),
|
||||
Race = "Random",
|
||||
Playable = true,
|
||||
DefaultStartingUnits = true,
|
||||
Enemies = new[]{"Creeps"}
|
||||
};
|
||||
Players.Add(p.Name, p);
|
||||
}
|
||||
}
|
||||
|
||||
// Smudges
|
||||
Smudges = Lazy.New(() =>
|
||||
|
||||
Reference in New Issue
Block a user