diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index a9369e707a..5d8842980a 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -2351,7 +2351,7 @@ UnitAI.prototype.UnitFsmSpec = { // Give up on this order and try our next queued order // but first check what is our next order and, if needed, insert a returnResource order - let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer); + var cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer); if (cmpResourceGatherer.IsCarrying(resourceType.generic) && this.orderQueue.length > 1 && this.orderQueue[1] !== "ReturnResource" && (this.orderQueue[1].type !== "Gather" || this.orderQueue[1].data.type.generic !== resourceType.generic))