Ticket #2206: correct_backtowork.diff

File correct_backtowork.diff, 1.6 KB (added by Itms, 11 years ago)
  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    499499    },
    500500
    501501    "Order.Gather": function(msg) {
     502        // This is a work to remember
     503        this.lastWorkOrder = this.order;
     504       
    502505        // If the target is still alive, we need to kill it first
    503506        if (this.MustKillGatherTarget(this.order.data.target))
    504507        {
     
    554557    },
    555558
    556559    "Order.ReturnResource": function(msg) {
     560        // This is a work to remember
     561        this.lastWorkOrder = this.order;
     562       
    557563        // Try to move to the dropsite
    558564        if (this.MoveToTarget(this.order.data.target))
    559565        {
     
    573579    },
    574580
    575581    "Order.Trade": function(msg) {
     582        // This is a work to remember
     583        this.lastWorkOrder = this.order;
     584       
    576585        if (this.MoveToMarket(this.order.data.firstMarket))
    577586        {
    578587            // We've started walking to the first market
     
    581590    },
    582591
    583592    "Order.Repair": function(msg) {
     593        // This is a work to remember
     594        this.lastWorkOrder = this.order;
     595       
    584596        // Try to move within range
    585597        if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
    586598        {
     
    28922904{
    28932905    var order = { "type": type, "data": data };
    28942906    this.orderQueue.push(order);
    2895    
    2896     if(type == "Gather" || type == "Trade" || type == "Repair" || type == "ReturnResource")
    2897         this.lastWorkOrder = order;
    28982907
    28992908    // If we didn't already have an order, then process this new one
    29002909    if (this.orderQueue.length == 1)