Remove obsolete Player index cruft

This commit is contained in:
Paul Chote
2011-06-17 22:17:03 +12:00
parent bcbd18bb52
commit 532bd42aed
20 changed files with 49 additions and 64 deletions

View File

@@ -23,8 +23,8 @@ namespace OpenRA.Network
/* todo: this is still a hack.
* the cases we're trying to avoid are the extra players on the host's client -- Neutral, other MapPlayers,
* bots,.. */
return world.players.Values.FirstOrDefault(
p => p.ClientIndex == c.Index && p.PlayerName == c.Name);
return world.Players.FirstOrDefault(
p => (p.ClientIndex == c.Index && p.PlayerRef.Playable && !p.IsBot));
}
public static void ProcessOrder(OrderManager orderManager, World world, int clientId, Order order)
@@ -151,8 +151,8 @@ namespace OpenRA.Network
if (Game.orderManager.LobbyInfo.GlobalSettings.LockTeams)
return;
var targetPlayer = order.Player.World.players[order.TargetLocation.X];
var newStance = (Stance)order.TargetLocation.Y;
var targetPlayer = order.Player.World.Players.FirstOrDefault(p => p.InternalName == order.TargetString);
var newStance = (Stance)order.TargetLocation.X;
SetPlayerStance(world, order.Player, targetPlayer, newStance);