From 20ebaa5b7906375cd2006d8f15717f70dc15e615 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 5 Mar 2011 22:18:29 +0000 Subject: [PATCH] Fix units getting stuck inside foundations This was SVN commit r9035. --- binaries/data/mods/public/simulation/components/UnitAI.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index 221b54608e..15156ea3af 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -1826,6 +1826,12 @@ UnitAI.prototype.LeaveFoundation = function(target) // TODO: we should verify this is a friendly foundation, otherwise // there's no reason we should let them build here + // If we're already being told to leave a foundation, then + // ignore this new request so we don't end up being too indecisive + // to ever actually move anywhere + if (this.order && this.order.type == "LeaveFoundation") + return; + this.PushOrderFront("LeaveFoundation", { "target": target }); };