Remove unused parameter from Player's constructor
This commit is contained in:
@@ -80,7 +80,7 @@ namespace OpenRA
|
|||||||
return factions.FirstOrDefault(f => f.InternalName == factionName) ?? factions.First();
|
return factions.FirstOrDefault(f => f.InternalName == factionName) ?? factions.First();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player(World world, Session.Client client, Session.Slot slot, PlayerReference pr)
|
public Player(World world, Session.Client client, PlayerReference pr)
|
||||||
{
|
{
|
||||||
string botType;
|
string botType;
|
||||||
|
|
||||||
|
|||||||
@@ -26,28 +26,28 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
// Create the unplayable map players -- neutral, shellmap, scripted, etc.
|
// Create the unplayable map players -- neutral, shellmap, scripted, etc.
|
||||||
foreach (var kv in players.Where(p => !p.Value.Playable))
|
foreach (var kv in players.Where(p => !p.Value.Playable))
|
||||||
{
|
{
|
||||||
var player = new Player(w, null, null, kv.Value);
|
var player = new Player(w, null, kv.Value);
|
||||||
w.AddPlayer(player);
|
w.AddPlayer(player);
|
||||||
if (kv.Value.OwnsWorld)
|
if (kv.Value.OwnsWorld)
|
||||||
w.WorldActor.Owner = player;
|
w.WorldActor.Owner = player;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the players which are bound through slots.
|
// Create the regular playable players.
|
||||||
foreach (var kv in w.LobbyInfo.Slots)
|
foreach (var kv in w.LobbyInfo.Slots)
|
||||||
{
|
{
|
||||||
var client = w.LobbyInfo.ClientInSlot(kv.Key);
|
var client = w.LobbyInfo.ClientInSlot(kv.Key);
|
||||||
if (client == null)
|
if (client == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var player = new Player(w, client, kv.Value, players[kv.Value.PlayerReference]);
|
var player = new Player(w, client, players[kv.Value.PlayerReference]);
|
||||||
w.AddPlayer(player);
|
w.AddPlayer(player);
|
||||||
|
|
||||||
if (client.Index == Game.LocalClientId)
|
if (client.Index == Game.LocalClientId)
|
||||||
w.SetLocalPlayer(player.InternalName);
|
w.SetLocalPlayer(player.InternalName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a player that is allied with everyone for shared observer shroud
|
// Create a player that is allied with everyone for shared observer shroud.
|
||||||
w.AddPlayer(new Player(w, null, null, new PlayerReference
|
w.AddPlayer(new Player(w, null, new PlayerReference
|
||||||
{
|
{
|
||||||
Name = "Everyone",
|
Name = "Everyone",
|
||||||
NonCombatant = true,
|
NonCombatant = true,
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Players = new MapPlayers(w.Map.PlayerDefinitions);
|
Players = new MapPlayers(w.Map.PlayerDefinitions);
|
||||||
|
|
||||||
var worldOwner = Players.Players.Select(kvp => kvp.Value).First(p => !p.Playable && p.OwnsWorld);
|
var worldOwner = Players.Players.Select(kvp => kvp.Value).First(p => !p.Playable && p.OwnsWorld);
|
||||||
w.WorldActor.Owner = new Player(w, null, null, worldOwner);
|
w.WorldActor.Owner = new Player(w, null, worldOwner);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WorldLoaded(World world, WorldRenderer wr)
|
public void WorldLoaded(World world, WorldRenderer wr)
|
||||||
|
|||||||
Reference in New Issue
Block a user