fix some subtle crap in map upgrader
This commit is contained in:
@@ -151,6 +151,22 @@ namespace OpenRA
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
/* 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
|
// Upgrade map to format 5
|
||||||
if (MapFormat < 5)
|
if (MapFormat < 5)
|
||||||
@@ -171,27 +187,10 @@ namespace OpenRA
|
|||||||
Name = "Creeps",
|
Name = "Creeps",
|
||||||
Race = "Random",
|
Race = "Random",
|
||||||
NonCombatant = true,
|
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
|
||||||
Smudges = Lazy.New(() =>
|
Smudges = Lazy.New(() =>
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user