Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js +++ binaries/data/mods/public/simulation/components/UnitAI.js @@ -3588,7 +3588,8 @@ * Call when the current order has been completed (or failed). * Removes the current order from the queue, and processes the * next one (if any). Returns false and defaults to IDLE - * if there are no remaining orders. + * if there are no remaining orders or if the unit is not + * inWorld (usually waiting to be destroyed) */ UnitAI.prototype.FinishOrder = function() { @@ -3603,7 +3604,8 @@ this.orderQueue.shift(); this.order = this.orderQueue[0]; - if (this.orderQueue.length) + let cmpPosition = Engine.QueryInterface(this.entity, IID_Position); + if (this.orderQueue.length && cmpPosition && cmpPosition.IsInWorld()) { let ret = this.UnitFsm.ProcessMessage(this, {"type": "Order."+this.order.type, "data": this.order.data}