Give upgraded mpspawns an owner.
This commit is contained in:
@@ -122,6 +122,12 @@ namespace OpenRA
|
|||||||
if (MapFormat < 4)
|
if (MapFormat < 4)
|
||||||
throw new InvalidDataException("Map format {0} is not supported.\n File: {1}".F(MapFormat, path));
|
throw new InvalidDataException("Map format {0} is not supported.\n File: {1}".F(MapFormat, path));
|
||||||
|
|
||||||
|
// Load players
|
||||||
|
foreach (var kv in yaml.NodesDict["Players"].NodesDict)
|
||||||
|
{
|
||||||
|
var player = new PlayerReference(kv.Value);
|
||||||
|
Players.Add(player.Name, player);
|
||||||
|
}
|
||||||
|
|
||||||
Actors = Lazy.New(() =>
|
Actors = Lazy.New(() =>
|
||||||
{
|
{
|
||||||
@@ -138,18 +144,14 @@ namespace OpenRA
|
|||||||
string[] loc = wp.Value.Value.Split( ',' );
|
string[] loc = wp.Value.Value.Split( ',' );
|
||||||
var a = new ActorReference("mpspawn");
|
var a = new ActorReference("mpspawn");
|
||||||
a.Add(new LocationInit(new int2( int.Parse( loc[ 0 ] ), int.Parse( loc[ 1 ] ) )));
|
a.Add(new LocationInit(new int2( int.Parse( loc[ 0 ] ), int.Parse( loc[ 1 ] ) )));
|
||||||
|
a.Add(new OwnerInit(Players.First(p => p.Value.OwnsWorld).Key));
|
||||||
ret.Add(wp.Key, a);
|
ret.Add(wp.Key, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Load players
|
|
||||||
foreach (var kv in yaml.NodesDict["Players"].NodesDict)
|
|
||||||
{
|
|
||||||
var player = new PlayerReference(kv.Value);
|
|
||||||
Players.Add(player.Name, player);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Upgrade map to format 5
|
// Upgrade map to format 5
|
||||||
if (MapFormat < 5)
|
if (MapFormat < 5)
|
||||||
|
|||||||
Reference in New Issue
Block a user