From af64e565d76a667fe907cea90813f185a1068e8e Mon Sep 17 00:00:00 2001 From: Freagarach Date: Fri, 24 Feb 2023 09:04:10 +0000 Subject: [PATCH] Autocontinue constructing farms when the first queued for construction is full. Seen at around minute 20 at https://wildfiregames.com/forum/topic/15271-0-ad-on-youtube/page/114/#comment-544694. If not tasked by the user, entities will not autogather. But now they at least construct the farms. Differential revision: https://code.wildfiregames.com/D4945 Comments by: @phosit, @Stan This was SVN commit r27559. --- binaries/data/mods/public/simulation/components/UnitAI.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index ce377c4511..289661fbab 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -3170,7 +3170,8 @@ UnitAI.prototype.UnitFsmSpec = { // If this building was e.g. a farm of ours, the entities that received // the build command should start gathering from it - if ((oldData.force || oldData.autoharvest) && this.CanGather(msg.data.newentity)) + if ((oldData.force || oldData.autoharvest) && this.CanGather(msg.data.newentity) && + Engine.QueryInterface(msg.data.newentity, IID_ResourceSupply).IsAvailableTo(this.entity)) { this.PerformGather(msg.data.newentity, true, false); return;