From bd35f48e48246cf08a24f33216bd47b6e696be85 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 17 Mar 2010 21:39:16 +1300 Subject: [PATCH] successful gamestart; shroud is borked --- OpenRA.Game/Game.cs | 2 ++ OpenRA.Game/Graphics/Viewport.cs | 3 ++- OpenRA.Game/Traits/World/BridgeLoadHook.cs | 4 ++-- OpenRA.Game/World.cs | 5 +---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 62fdcf79ff..71f7396b07 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -271,6 +271,8 @@ namespace OpenRA for (int i = 0; i < 8; i++) world.players[i] = new Player(world, i, LobbyInfo.Clients.FirstOrDefault(a => a.Index == i)); + world.Queries = new World.AllQueries(world); + foreach (var gs in world.WorldActor.traits.WithInterface()) gs.GameStarted(world); diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index c85d0eb01b..2ab8cecf0e 100644 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -65,7 +65,8 @@ namespace OpenRA.Graphics ConnectionState lastConnectionState = ConnectionState.PreConnecting; public void DrawRegions( World world ) { - world.WorldRenderer.palette.Update(world.Queries.WithTraitMultiple().Select(t=>t.Trait)); + world.WorldRenderer.palette.Update( + world.WorldActor.traits.WithInterface()); float2 r1 = new float2(2, -2) / screenSize; float2 r2 = new float2(-1, 1); diff --git a/OpenRA.Game/Traits/World/BridgeLoadHook.cs b/OpenRA.Game/Traits/World/BridgeLoadHook.cs index 1c7687c603..ae817da1ec 100644 --- a/OpenRA.Game/Traits/World/BridgeLoadHook.cs +++ b/OpenRA.Game/Traits/World/BridgeLoadHook.cs @@ -37,8 +37,8 @@ namespace OpenRA.Traits if (IsBridge(w, w.Map.MapTiles[i, j].tile)) ConvertBridgeToActor(w, i, j); - foreach (var br in w.Queries.WithTraitMultiple()) - br.Trait.FinalizeBridges(w); + foreach (var br in w.Actors.SelectMany(a => a.traits.WithInterface())) + br.FinalizeBridges(w); } static void ConvertBridgeToActor(World w, int i, int j) diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index d1f87ad4f5..545a1c8e90 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -99,9 +99,6 @@ namespace OpenRA Timer.Time( "worldActor, players: {0}" ); - Queries = new AllQueries( this ); - Timer.Time( "queries: {0}" ); - foreach (var wlh in WorldActor.traits.WithInterface()) wlh.WorldLoaded(this); @@ -252,6 +249,6 @@ namespace OpenRA } } - public readonly AllQueries Queries; + public AllQueries Queries; } }