Ticket #2206: correct_backtowork.diff
File correct_backtowork.diff, 1.6 KB (added by , 11 years ago) |
---|
-
binaries/data/mods/public/simulation/components/UnitAI.js
499 499 }, 500 500 501 501 "Order.Gather": function(msg) { 502 // This is a work to remember 503 this.lastWorkOrder = this.order; 504 502 505 // If the target is still alive, we need to kill it first 503 506 if (this.MustKillGatherTarget(this.order.data.target)) 504 507 { … … 554 557 }, 555 558 556 559 "Order.ReturnResource": function(msg) { 560 // This is a work to remember 561 this.lastWorkOrder = this.order; 562 557 563 // Try to move to the dropsite 558 564 if (this.MoveToTarget(this.order.data.target)) 559 565 { … … 573 579 }, 574 580 575 581 "Order.Trade": function(msg) { 582 // This is a work to remember 583 this.lastWorkOrder = this.order; 584 576 585 if (this.MoveToMarket(this.order.data.firstMarket)) 577 586 { 578 587 // We've started walking to the first market … … 581 590 }, 582 591 583 592 "Order.Repair": function(msg) { 593 // This is a work to remember 594 this.lastWorkOrder = this.order; 595 584 596 // Try to move within range 585 597 if (this.MoveToTargetRange(this.order.data.target, IID_Builder)) 586 598 { … … 2892 2904 { 2893 2905 var order = { "type": type, "data": data }; 2894 2906 this.orderQueue.push(order); 2895 2896 if(type == "Gather" || type == "Trade" || type == "Repair" || type == "ReturnResource")2897 this.lastWorkOrder = order;2898 2907 2899 2908 // If we didn't already have an order, then process this new one 2900 2909 if (this.orderQueue.length == 1)