diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 777a0d8169..edc40517d0 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -59,6 +59,11 @@ namespace OpenRa.Game palette = new HardwarePalette(renderer, Rules.Map); world = new World(); + Game.world.ActorAdded += a => + { + if (a.Owner != null && a.Info != null) + a.Owner.Shroud.Explore(a); + }; for (int i = 0; i < 8; i++) { @@ -102,12 +107,6 @@ namespace OpenRa.Game oreFrequency = (int)(Rules.General.GrowthRate * 60 * 1000); oreTicks = oreFrequency; - - foreach (var a in Game.world.Actors) - if (a.Info != null && a.Owner == players[0]) - players[0].Shroud.Explore(a); - - Game.world.ActorAdded += a => players[0].Shroud.Explore(a); } public static void Initialize(string mapName, Renderer renderer, int2 clientSize, diff --git a/OpenRa.Game/Shroud.cs b/OpenRa.Game/Shroud.cs index 01d353245e..831af634a2 100644 --- a/OpenRa.Game/Shroud.cs +++ b/OpenRa.Game/Shroud.cs @@ -16,7 +16,7 @@ namespace OpenRa.Game public void Explore(Actor a) { - foreach (var t in Game.FindTilesInCircle(a.Location, a.Info.Sight)) + foreach (var t in Game.FindTilesInCircle((1f/Game.CellSize * a.CenterLocation).ToInt2(), a.Info.Sight)) explored[t.X, t.Y] = true; dirty = true;