Merge pull request #10477 from pchote/fix-pbog-decoration-offset

Use the correct CenterPosition for PBOG overlays.
This commit is contained in:
Oliver Brakmann
2016-01-11 21:47:03 +01:00

View File

@@ -148,12 +148,12 @@ namespace OpenRA.Mods.Common.Orders
{
var xy = wr.Viewport.ViewToWorld(Viewport.LastMousePos);
var topLeft = xy - FootprintUtils.AdjustForBuildingSize(buildingInfo);
var offset = world.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(world, buildingInfo);
var rules = world.Map.Rules;
var actorInfo = rules.Actors[building];
foreach (var dec in actorInfo.TraitInfos<IPlaceBuildingDecorationInfo>())
foreach (var r in dec.Render(wr, world, actorInfo, world.Map.CenterOfCell(xy)))
foreach (var r in dec.Render(wr, world, actorInfo, offset))
yield return r;
var cells = new Dictionary<CPos, bool>();
@@ -194,7 +194,6 @@ namespace OpenRA.Mods.Common.Orders
initialized = true;
}
var offset = world.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(world, buildingInfo);
var previewRenderables = preview
.SelectMany(p => p.Render(wr, offset))
.OrderBy(WorldRenderer.RenderableScreenZPositionComparisonKey);