Ticket #4015: change4015.3.patch

File change4015.3.patch, 3.0 KB (added by Ágoston Sipos, 7 years ago)

This is the whole proposed change.

  • binaries/data/mods/public/gui/credits/texts/programming.json

     
    141141            {"nick": "njm"},
    142142            {"nick": "NoMonkey", "name": "John Mena"},
    143143            {"nick": "notpete", "name": "Rich Cross"},
    144             {"nick": "Offensive ePeen", "name": "Jared Ryan Bills"},
     144            {"nick": "odoaker", "name": "Agoston Sipos"},
     145            {"nick": "Offensive ePeen", "name": "Jared Ryan Bills"},
    145146            {"nick": "Ols", "name": "Oliver Whiteman"},
    146147            {"nick": "olsner", "name": "Simon Brenner"},
    147148            {"nick": "otero"},
  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    37673767        var cheeringOrder = this.orderQueue.shift();
    37683768        this.orderQueue.unshift(cheeringOrder, order);
    37693769    }
    3770     else if (this.order && this.IsPacking())
     3770    else if (this.order && this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")
    37713771    {
    37723772        var packingOrder = this.orderQueue.shift();
    37733773        this.orderQueue.unshift(packingOrder, order);
     
    38313831        else
    38323832            this.UpdateWorkOrders(type);
    38333833    }
     3834    var order = { "type": type, "data": data };
    38343835
    38353836    // Special cases of orders that shouldn't be replaced:
    38363837    // 1. Cheering - we're invulnerable, add order after we finish
     
    38383839    // TODO: maybe a better way of doing this would be to use priority levels
    38393840    if (this.order && this.order.type == "Cheering")
    38403841    {
    3841         var order = { "type": type, "data": data };
    38423842        var cheeringOrder = this.orderQueue.shift();
    38433843        this.orderQueue = [cheeringOrder, order];
    38443844    }
    38453845    else if (this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")
    38463846    {
    3847         var order = { "type": type, "data": data };
    3848         var packingOrder = this.orderQueue.shift();
    3849         this.orderQueue = [packingOrder, order];
     3847        if (this.ShouldUnpack(type, data))
     3848        {
     3849            if (this.GetCurrentState().split(".").pop() == "PACKING")
     3850            {
     3851                this.orderQueue = [order];
     3852                this.PushOrderFront("CancelPack", { "force": true });
     3853            }
     3854            else
     3855                this.orderQueue = [this.orderQueue.shift(), order];
     3856        }
     3857        else
     3858        {
     3859            if (this.GetCurrentState().split(".").pop() == "UNPACKING")
     3860            {
     3861                this.orderQueue = [order];
     3862                this.PushOrderFront("CancelUnpack", { "force": true });
     3863            }
     3864            else
     3865                this.orderQueue = [this.orderQueue.shift(), order];
     3866        }
    38503867    }
    38513868    else
    38523869    {
     
    59605977    return (cmpPack && cmpPack.IsPacking());
    59615978};
    59625979
     5980UnitAI.prototype.ShouldUnpack = function(type, data)
     5981{
     5982    return type == "Attack" && this.CheckTargetAttackRange(data.target, this.GetBestAttackAgainst(data.target, false));
     5983};
     5984
    59635985//// Formation specific functions ////
    59645986
    59655987UnitAI.prototype.IsAttackingAsFormation = function()