fixing lobby bits

This commit is contained in:
Chris Forbes
2010-03-17 21:19:47 +13:00
parent 16f9f5ce89
commit eed2267568
2 changed files with 10 additions and 5 deletions

View File

@@ -386,9 +386,9 @@ namespace OpenRA
{ {
var d = left ? +1 : Player.PlayerColors.Count() - 1; var d = left ? +1 : Player.PlayerColors.Count() - 1;
var newIndex = ((int)Game.world.LocalPlayer.PaletteIndex + d) % Player.PlayerColors.Count(); var newIndex = ((int)Game.LocalClient.PaletteIndex + d) % Player.PlayerColors.Count();
while (!PaletteAvailable(newIndex) && newIndex != (int)Game.world.LocalPlayer.PaletteIndex) while (!PaletteAvailable(newIndex) && newIndex != (int)Game.LocalClient.PaletteIndex)
newIndex = (newIndex + d) % Player.PlayerColors.Count(); newIndex = (newIndex + d) % Player.PlayerColors.Count();
Game.IssueOrder( Game.IssueOrder(
@@ -399,7 +399,7 @@ namespace OpenRA
{ {
var countries = Game.world.GetCountries(); var countries = Game.world.GetCountries();
var nextCountry = countries.Concat(countries) var nextCountry = countries.Concat(countries)
.SkipWhile(c => c != Game.world.LocalPlayer.Country) .SkipWhile(c => c.Name != Game.LocalClient.Country)
.Skip(1) .Skip(1)
.First(); .First();
@@ -416,9 +416,9 @@ namespace OpenRA
{ {
var d = left ? +1 : Game.world.Map.SpawnPoints.Count(); var d = left ? +1 : Game.world.Map.SpawnPoints.Count();
var newIndex = (Game.world.LocalPlayer.SpawnPointIndex + d) % (Game.world.Map.SpawnPoints.Count()+1); var newIndex = (Game.LocalClient.SpawnPoint + d) % (Game.world.Map.SpawnPoints.Count()+1);
while (!SpawnPointAvailable(newIndex) && newIndex != (int)Game.world.LocalPlayer.SpawnPointIndex) while (!SpawnPointAvailable(newIndex) && newIndex != (int)Game.LocalClient.SpawnPoint)
newIndex = (newIndex + d) % (Game.world.Map.SpawnPoints.Count()+1); newIndex = (newIndex + d) % (Game.world.Map.SpawnPoints.Count()+1);
Game.IssueOrder( Game.IssueOrder(

View File

@@ -311,6 +311,11 @@ namespace OpenRA
get { return orderManager.Connection.LocalClientId == 0; } get { return orderManager.Connection.LocalClientId == 0; }
} }
public static Session.Client LocalClient
{
get { return LobbyInfo.Clients.FirstOrDefault(c => c.Index == orderManager.Connection.LocalClientId); }
}
public static void HandleKeyPress( KeyPressEventArgs e, Modifiers modifiers ) public static void HandleKeyPress( KeyPressEventArgs e, Modifiers modifiers )
{ {
int sync = Game.world.SyncHash(); int sync = Game.world.SyncHash();