Ticket #4015: change4015.4.patch

File change4015.4.patch, 3.1 KB (added by Ágoston Sipos, 7 years ago)
  • 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": "odoaker", "name": "Agoston Sipos"},
    144145            {"nick": "Offensive ePeen", "name": "Jared Ryan Bills"},
    145146            {"nick": "Ols", "name": "Oliver Whiteman"},
    146147            {"nick": "olsner", "name": "Simon Brenner"},
  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    18421842                    {
    18431843                        // If the unit needs to unpack, do so
    18441844                        if (this.CanUnpack())
     1845                        {
     1846                            this.PushOrderFront("Unpack", {});
    18451847                            this.SetNextState("UNPACKING");
     1848                        }
    18461849                        else
    18471850                            this.SetNextState("ATTACKING");
    18481851                    }
     
    37673770        var cheeringOrder = this.orderQueue.shift();
    37683771        this.orderQueue.unshift(cheeringOrder, order);
    37693772    }
    3770     else if (this.order && this.IsPacking())
     3773    else if (this.order && this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")
    37713774    {
    37723775        var packingOrder = this.orderQueue.shift();
    37733776        this.orderQueue.unshift(packingOrder, order);
     
    38313834        else
    38323835            this.UpdateWorkOrders(type);
    38333836    }
     3837    let order = { "type": type, "data": data };
    38343838
    38353839    // Special cases of orders that shouldn't be replaced:
    38363840    // 1. Cheering - we're invulnerable, add order after we finish
     
    38383842    // TODO: maybe a better way of doing this would be to use priority levels
    38393843    if (this.order && this.order.type == "Cheering")
    38403844    {
    3841         var order = { "type": type, "data": data };
    38423845        var cheeringOrder = this.orderQueue.shift();
    38433846        this.orderQueue = [cheeringOrder, order];
    38443847    }
    38453848    else if (this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")
    38463849    {
    3847         var order = { "type": type, "data": data };
    3848         var packingOrder = this.orderQueue.shift();
    3849         this.orderQueue = [packingOrder, order];
     3850        if (this.ShouldUnpack(type, data))
     3851        {
     3852            if (this.GetCurrentState().split(".").pop() == "PACKING")
     3853            {
     3854                this.orderQueue = [order];
     3855                this.PushOrderFront("CancelPack", { "force": true });
     3856            }
     3857            else
     3858                this.orderQueue = [this.orderQueue.shift(), order];
     3859        }
     3860        else
     3861        {
     3862            if (this.GetCurrentState().split(".").pop() == "UNPACKING")
     3863            {
     3864                this.orderQueue = [order];
     3865                this.PushOrderFront("CancelUnpack", { "force": true });
     3866            }
     3867            else
     3868                this.orderQueue = [this.orderQueue.shift(), order];
     3869        }
    38503870    }
    38513871    else
    38523872    {
     
    59605980    return (cmpPack && cmpPack.IsPacking());
    59615981};
    59625982
     5983UnitAI.prototype.ShouldUnpack = function(type, data)
     5984{
     5985    return type == "Attack" && this.CheckTargetAttackRange(data.target, this.GetBestAttackAgainst(data.target, false));
     5986};
     5987
    59635988//// Formation specific functions ////
    59645989
    59655990UnitAI.prototype.IsAttackingAsFormation = function()