From da5c94858f52b425e377e52072bf71117ab15bb9 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 1 Dec 2020 17:31:40 +0000 Subject: [PATCH] Evaluate exit distance from the exit cell instead of the spawn position. --- OpenRA.Mods.Common/Traits/Buildings/Exit.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs index 0169fb5bac..32101aef8e 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Exit.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Exit.cs @@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Traits // called on the same exits in the same order! var all = Exits(actor, productionType) .OrderBy(e => e.Info.Priority) - .ThenBy(e => (actor.CenterPosition + e.Info.SpawnOffset - pos).Length) + .ThenBy(e => (actor.World.Map.CenterOfCell(actor.Location + e.Info.ExitCell) - pos).LengthSquared) .ToList(); return p != null ? all.FirstOrDefault(p) : all.FirstOrDefault();