timestep control (rate=N); not failing at SharedRandom seed

This commit is contained in:
Chris Forbes
2009-11-05 22:32:47 +13:00
parent ab7737302b
commit df4b144df4
2 changed files with 3 additions and 2 deletions

View File

@@ -132,7 +132,7 @@ namespace OpenRa.Game
} }
static int lastTime = Environment.TickCount; static int lastTime = Environment.TickCount;
public const int timestep = 40; public static int timestep = 40;
public static void ResetTimer() public static void ResetTimer()
{ {
@@ -259,7 +259,7 @@ namespace OpenRa.Game
return BuildingInfluence.GetDistanceToBuilding(b); return BuildingInfluence.GetDistanceToBuilding(b);
} }
public static Random SharedRandom = new Random(); /* for things that require sync */ public static Random SharedRandom = new Random(0); /* for things that require sync */
public static Random CosmeticRandom = new Random(); /* for things that are just fluff */ public static Random CosmeticRandom = new Random(); /* for things that are just fluff */
public static readonly Pair<VoicePool, VoicePool> SovietVoices = public static readonly Pair<VoicePool, VoicePool> SovietVoices =

View File

@@ -51,6 +51,7 @@ namespace OpenRa.Game
UiOverlay.ShowUnitDebug = settings.GetValue("udebug", false); UiOverlay.ShowUnitDebug = settings.GetValue("udebug", false);
UiOverlay.ShowBuildDebug = settings.GetValue("bdebug", false); UiOverlay.ShowBuildDebug = settings.GetValue("bdebug", false);
Game.timestep = settings.GetValue("rate", 40);
WorldRenderer.ShowUnitPaths = settings.GetValue("pathdebug", false); WorldRenderer.ShowUnitPaths = settings.GetValue("pathdebug", false);
Game.Replay = settings.GetValue("replay", ""); Game.Replay = settings.GetValue("replay", "");