From f9c940abafb0ef42a8d000b976d8585ff4c9a24f Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 17 Mar 2010 22:40:43 +1300 Subject: [PATCH] delay wall creation until there ARE players --- OpenRA.Game/Traits/World/WallLoadHook.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Traits/World/WallLoadHook.cs b/OpenRA.Game/Traits/World/WallLoadHook.cs index 0d6aaa8c3a..e297a7bb7a 100644 --- a/OpenRA.Game/Traits/World/WallLoadHook.cs +++ b/OpenRA.Game/Traits/World/WallLoadHook.cs @@ -13,22 +13,19 @@ namespace OpenRA.Traits public object Create(Actor self) { return new WallLoadHook( self, this ); } } - class WallLoadHook : ILoadWorldHook + class WallLoadHook : IGameStarted { WallLoadHookInfo info; - public WallLoadHook(Actor self, WallLoadHookInfo info) - { - this.info = info; - } + public WallLoadHook(Actor self, WallLoadHookInfo info) { this.info = info; } - public void WorldLoaded(World w) + public void GameStarted(World w) { var map = w.Map; for (int y = map.YOffset; y < map.YOffset + map.Height; y++) for (int x = map.XOffset; x < map.XOffset + map.Width; x++) if (info.OverlayTypes.Contains(w.Map.MapTiles[x, y].overlay)) - w.CreateActor(info.ActorType, new int2(x, y), w.players[0]); // todo: neutral player or null? + w.CreateActor(info.ActorType, new int2(x, y), w.NeutralPlayer); } } }