Ticket #4015: change4015.5.patch
File change4015.5.patch, 3.7 KB (added by , 7 years ago) |
---|
-
binaries/data/mods/public/gui/credits/texts/programming.json
141 141 {"nick": "njm"}, 142 142 {"nick": "NoMonkey", "name": "John Mena"}, 143 143 {"nick": "notpete", "name": "Rich Cross"}, 144 {"nick": "odoaker", "name": "Agoston Sipos"}, 144 145 {"nick": "Offensive ePeen", "name": "Jared Ryan Bills"}, 145 146 {"nick": "Ols", "name": "Oliver Whiteman"}, 146 147 {"nick": "olsner", "name": "Simon Brenner"}, -
binaries/data/mods/public/simulation/components/UnitAI.js
1842 1842 { 1843 1843 // If the unit needs to unpack, do so 1844 1844 if (this.CanUnpack()) 1845 this. SetNextState("UNPACKING");1845 this.PushOrderFront("Unpack", { "force" : this.order.data.force }); 1846 1846 else 1847 1847 this.SetNextState("ATTACKING"); 1848 1848 } … … 3767 3767 var cheeringOrder = this.orderQueue.shift(); 3768 3768 this.orderQueue.unshift(cheeringOrder, order); 3769 3769 } 3770 else if (this.order && this.IsPacking() )3770 else if (this.order && this.IsPacking() && type != "CancelPack" && type != "CancelUnpack") 3771 3771 { 3772 var packingOrder = this.orderQueue.shift(); 3773 this.orderQueue.unshift(packingOrder, order); 3772 if ((this.ShouldUnpack(type, data) || type == "Stop") && this.GetCurrentState().split(".").pop() == "PACKING") 3773 this.orderQueue.unshift({ "type": "CancelPack", "data": { "force": data.force } }, order); 3774 else if ((!this.ShouldUnpack(type, data) || type == "Stop") && this.GetCurrentState().split(".").pop() == "UNPACKING") 3775 this.orderQueue.unshift({ "type": "CancelUnpack", "data": { "force": data.force } }, order); 3776 else 3777 { 3778 var packingOrder = this.orderQueue.shift(); 3779 this.orderQueue.unshift(packingOrder, order); 3780 } 3774 3781 } 3775 3782 else 3776 3783 { … … 3831 3838 else 3832 3839 this.UpdateWorkOrders(type); 3833 3840 } 3841 let order = { "type": type, "data": data }; 3834 3842 3835 3843 // Special cases of orders that shouldn't be replaced: 3836 3844 // 1. Cheering - we're invulnerable, add order after we finish … … 3838 3846 // TODO: maybe a better way of doing this would be to use priority levels 3839 3847 if (this.order && this.order.type == "Cheering") 3840 3848 { 3841 var order = { "type": type, "data": data };3842 3849 var cheeringOrder = this.orderQueue.shift(); 3843 3850 this.orderQueue = [cheeringOrder, order]; 3844 3851 } 3845 3852 else if (this.IsPacking() && type != "CancelPack" && type != "CancelUnpack") 3846 3853 { 3847 var order = { "type": type, "data": data }; 3848 var packingOrder = this.orderQueue.shift(); 3849 this.orderQueue = [packingOrder, order]; 3854 if ((this.ShouldUnpack(type, data) || type == "Stop") && this.GetCurrentState().split(".").pop() == "PACKING") 3855 { 3856 this.orderQueue = [order]; 3857 this.PushOrderFront("CancelPack", { "force": data.force }); 3858 } 3859 else if ((!this.ShouldUnpack(type, data) || type == "Stop") && this.GetCurrentState().split(".").pop() == "UNPACKING") 3860 { 3861 this.orderQueue = [order]; 3862 this.PushOrderFront("CancelUnpack", { "force": data.force }); 3863 } 3864 else 3865 this.orderQueue = [this.orderQueue.shift(), order]; 3850 3866 } 3851 3867 else 3852 3868 { … … 5960 5976 return (cmpPack && cmpPack.IsPacking()); 5961 5977 }; 5962 5978 5979 UnitAI.prototype.ShouldUnpack = function(type, data) 5980 { 5981 return type == "Attack" && this.CheckTargetAttackRange(data.target, this.GetBestAttackAgainst(data.target, false)); 5982 }; 5983 5963 5984 //// Formation specific functions //// 5964 5985 5965 5986 UnitAI.prototype.IsAttackingAsFormation = function()