downloader works.

This commit is contained in:
Chris Forbes
2010-01-16 20:26:51 +13:00
parent e134773a24
commit cff25cf9cc
5 changed files with 100 additions and 17 deletions

View File

@@ -53,9 +53,11 @@ namespace OpenRa.Game
public static Minimap minimap;
public static Session LobbyInfo = new Session();
public static int2[] SpawnPoints;
static bool changePending;
public static void ChangeMap(string mapName)
{
Game.changePending = false;
Game.mapName = mapName;
SheetBuilder.Initialize(renderer);
SpriteSheetBuilder.Initialize();
@@ -170,6 +172,12 @@ namespace OpenRa.Game
public static void Tick()
{
if (changePending && PackageDownloader.IsIdle())
{
ChangeMap(LobbyInfo.GlobalSettings.Map);
return;
}
int t = Environment.TickCount;
int dt = t - lastTime;
if (dt >= Settings.Timestep)
@@ -392,7 +400,10 @@ namespace OpenRa.Game
PackageDownloader.SetPackageList(LobbyInfo.GlobalSettings.Packages);
if (!PackageDownloader.IsIdle())
{
changePending = true;
return;
}
if (mapName != LobbyInfo.GlobalSettings.Map)
{