diff --git a/OpenRA.Game/Effects/Bullet.cs b/OpenRA.Game/Effects/Bullet.cs index df8d1511f0..74274a8ce0 100755 --- a/OpenRA.Game/Effects/Bullet.cs +++ b/OpenRA.Game/Effects/Bullet.cs @@ -63,7 +63,7 @@ namespace OpenRA.Effects Args.dest += (info.Inaccuracy * factor * args.firedBy.World.SharedRandom.Gauss2D(2)).ToInt2(); } - VisualDest = Args.dest + (10 * args.firedBy.World.CosmeticRandom.Gauss2D(1)).ToInt2(); + VisualDest = Args.dest + (10 * Game.CosmeticRandom.Gauss2D(1)).ToInt2(); if (Info.Image != null) { diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 7c59e10453..7f7827d442 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -31,7 +31,9 @@ using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Support; using OpenRA.Traits; + using Timer = OpenRA.Support.Timer; +using XRandom = OpenRA.Thirdparty.Random; namespace OpenRA { @@ -49,6 +51,8 @@ namespace OpenRA public static bool skipMakeAnims = true; + public static XRandom CosmeticRandom = new XRandom(); // not synced + internal static Renderer renderer; static int2 clientSize; static string mapName; diff --git a/OpenRA.Game/GameRules/VoiceInfo.cs b/OpenRA.Game/GameRules/VoiceInfo.cs index 1cf9a947dd..92954dde1f 100644 --- a/OpenRA.Game/GameRules/VoiceInfo.cs +++ b/OpenRA.Game/GameRules/VoiceInfo.cs @@ -67,7 +67,7 @@ namespace OpenRA.GameRules if (liveclips.Count == 0) return null; /* avoid crashing if there's no clips at all */ - var i = Game.world.CosmeticRandom.Next(liveclips.Count); + var i = Game.CosmeticRandom.Next(liveclips.Count); var s = liveclips[i]; liveclips.RemoveAt(i); return s; diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 1f52c369f6..d3e6768c5d 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -39,8 +39,7 @@ namespace OpenRA List effects = new List(); List> frameEndActions = new List>(); - public XRandom SharedRandom = new XRandom(0); // synced - public XRandom CosmeticRandom = new XRandom(); // not synced + public XRandom SharedRandom = new XRandom(0); public readonly Dictionary players = new Dictionary();