From 641c65b1dd35ba2aaefbb9150b04cba579c4ddda Mon Sep 17 00:00:00 2001 From: sanderd17 Date: Wed, 8 Jan 2014 17:57:12 +0000 Subject: [PATCH] Give some explanation to my change in 0c336649e6 This was SVN commit r14548. --- binaries/data/mods/public/simulation/components/UnitAI.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index e4ae45175e..67c934b8f2 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -2604,6 +2604,9 @@ var UnitFsmSpec = { var cmpBuilder = Engine.QueryInterface(this.entity, IID_Builder); cmpBuilder.PerformBuilding(this.repairTarget); + // if the building is completed, the leave() function will be called + // by the ConstructionFinished message + // in that case, the repairTarget is deleted, and we can just return if (!this.repairTarget) return; if (this.MoveToTargetRange(this.repairTarget, IID_Builder))