From a0e028ee0e0e4428a907ce3c3ec4e96b419b3c06 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 25 Sep 2017 21:13:06 +0100 Subject: [PATCH] Fix mine field overlay extending to map corner for the first tick. --- OpenRA.Mods.Cnc/Traits/Minelayer.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Cnc/Traits/Minelayer.cs b/OpenRA.Mods.Cnc/Traits/Minelayer.cs index 2418318816..94fb21f3c6 100644 --- a/OpenRA.Mods.Cnc/Traits/Minelayer.cs +++ b/OpenRA.Mods.Cnc/Traits/Minelayer.cs @@ -199,7 +199,6 @@ namespace OpenRA.Mods.Cnc.Traits world.CancelInputMode(); } - CPos lastMousePos; public IEnumerable Render(WorldRenderer wr, World world) { yield break; } public IEnumerable RenderAboveShroud(WorldRenderer wr, World world) { @@ -208,6 +207,7 @@ namespace OpenRA.Mods.Cnc.Traits yield break; // We get the biggest depth so we cover all cells that mines could be placed on. + var lastMousePos = wr.Viewport.ViewToWorld(Viewport.LastMousePos); var minefield = GetMinefieldCells(minefieldStart, lastMousePos, minelayers.Max(m => m.Info.TraitInfo().MinefieldDepth)); @@ -223,7 +223,7 @@ namespace OpenRA.Mods.Cnc.Traits public string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi) { - lastMousePos = cell; return "ability"; /* TODO */ + return "ability"; } }