started removing '

players exist before game starts' assumptions
This commit is contained in:
Chris Forbes
2010-02-25 18:59:56 +13:00
parent c18d4c524e
commit 88423b158a
2 changed files with 6 additions and 2 deletions

View File

@@ -431,9 +431,8 @@ namespace OpenRa
world.Minimap.Draw(minimapRect, true);
world.Minimap.DrawSpawnPoints(minimapRect);
if (Game.world.LocalPlayer.Index == 0)
if (Game.IsHost)
{
// we are host
AddUiButton(new int2(r.Right - 100, r.Top + 300), "Change Map",
_ =>
{

View File

@@ -324,6 +324,11 @@ namespace OpenRa
// throw new InvalidOperationException( "Desync in OnKeyDown" );
}
public static bool IsHost
{
get { return orderManager.Connection.LocalClientId == 0; }
}
public static void HandleKeyPress( KeyPressEventArgs e, Modifiers modifiers )
{
int sync = Game.world.SyncHash();