From 0a9d920eb6ce7e98af23b409cac0f1020923ae83 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 7 Aug 2013 13:53:32 +1200 Subject: [PATCH] Allow world and (render-) player actors to render. --- OpenRA.Game/Graphics/WorldRenderer.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index fe75a8fa0c..bfd1a91990 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -73,9 +73,15 @@ namespace OpenRA.Graphics var bounds = Game.viewport.WorldBounds(world); var comparer = new RenderableComparer(this); - var actors = world.FindActorsInBox( - bounds.TopLeftAsCPos(), - bounds.BottomRightAsCPos()); + var tl = bounds.TopLeftAsCPos(); + var br = bounds.BottomRightAsCPos(); + var actors = world.FindActorsInBox(tl, br) + .Append(world.WorldActor) + .ToList(); + + // Include player actor for the rendered player + if (world.RenderPlayer != null) + actors.Add(world.RenderPlayer.PlayerActor); var worldRenderables = actors.SelectMany(a => a.Render(this)); if (world.OrderGenerator != null)