Changeset 25020

Timestamp:
Mar 6, 2021, 7:12:07 AM (3 years ago)
Author:
Freagarach
Message:

Allow players to push orders to the front of the queue.

Differential revision: D3605

Location:
ps/trunk/binaries/data
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/config/default.cfg

    r24986 r25020  
    320320repair = "J"                 ; Modifier to repair when clicking on building/mechanical unit
    321321queue = Shift                ; Modifier to queue unit orders instead of replacing
     322
    322323orderone = Alt               ; Modifier to order only one entity in selection.
    323324batchtrain = Shift           ; Modifier to train units in batches
  • ps/trunk/binaries/data/mods/public/gui/session/input.js

    r24752 r25020  
    12331233        popOneFromSelection(action) || g_Selection.toList();
    12341234    // If the session.queue hotkey is down, add the order to the unit's order queue instead
    1235     // of running it immediately.
    1236     return g_UnitActions[action.type].execute(target, action, selection, Engine.HotkeyIsPressed("session.queue"));
     1235    // of running it immediately. If the pushorderfront hotkey is down, execute the order
     1236    // immidiately and continue the rest of the queue afterwards.
     1237    return g_UnitActions[action.type].execute(
     1238        target,
     1239        action,
     1240        selection,
     1241        Engine.HotkeyIsPressed("session.queue"),
     1242        Engine.HotkeyIsPressed("session.pushorderfront"));
    12371243}
    12381244
  • ps/trunk/binaries/data/mods/public/gui/session/unit_actions.js

    r24999 r25020  
    4646    "move":
    4747    {
    48         "execute": function(target, action, selection, queued)
     48        "execute": function(target, action, selection, queued)
    4949        {
    5050            Engine.PostNetworkCommand({
     
    5454                "z": target.z,
    5555                "queued": queued,
     56
    5657                "formation": g_AutoFormation.getDefault()
    5758            });
     
    9091    "attack-move":
    9192    {
    92         "execute": function(target, action, selection, queued)
     93        "execute": function(target, action, selection, queued)
    9394        {
    9495            let targetClasses;
     
    105106                "targetClasses": targetClasses,
    106107                "queued": queued,
     108
    107109                "formation": g_AutoFormation.getNull()
    108110            });
     
    142144    "capture":
    143145    {
    144         "execute": function(target, action, selection, queued)
     146        "execute": function(target, action, selection, queued)
    145147        {
    146148            Engine.PostNetworkCommand({
     
    150152                "allowCapture": true,
    151153                "queued": queued,
     154
    152155                "formation": g_AutoFormation.getNull()
    153156            });
     
    188191    "attack":
    189192    {
    190         "execute": function(target, action, selection, queued)
     193        "execute": function(target, action, selection, queued)
    191194        {
    192195            Engine.PostNetworkCommand({
     
    195198                "target": action.target,
    196199                "queued": queued,
     200
    197201                "allowCapture": false,
    198202                "formation": g_AutoFormation.getNull()
     
    239243    "patrol":
    240244    {
    241         "execute": function(target, action, selection, queued)
     245        "execute": function(target, action, selection, queued)
    242246        {
    243247            Engine.PostNetworkCommand({
     
    293297    "heal":
    294298    {
    295         "execute": function(target, action, selection, queued)
     299        "execute": function(target, action, selection, queued)
    296300        {
    297301            Engine.PostNetworkCommand({
     
    300304                "target": action.target,
    301305                "queued": queued,
     306
    302307                "formation": g_AutoFormation.getNull()
    303308            });
     
    358363    "repair":
    359364    {
    360         "execute": function(target, action, selection, queued)
     365        "execute": function(target, action, selection, queued)
    361366        {
    362367            Engine.PostNetworkCommand({
     
    366371                "autocontinue": true,
    367372                "queued": queued,
     373
    368374                "formation": g_AutoFormation.getNull()
    369375            });
     
    417423    "gather":
    418424    {
    419         "execute": function(target, action, selection, queued)
     425        "execute": function(target, action, selection, queued)
    420426        {
    421427            Engine.PostNetworkCommand({
     
    424430                "target": action.target,
    425431                "queued": queued,
     432
    426433                "formation": g_AutoFormation.getNull()
    427434            });
     
    468475    "returnresource":
    469476    {
    470         "execute": function(target, action, selection, queued)
     477        "execute": function(target, action, selection, queued)
    471478        {
    472479            Engine.PostNetworkCommand({
     
    475482                "target": action.target,
    476483                "queued": queued,
     484
    477485                "formation": g_AutoFormation.getNull()
    478486            });
     
    526534    "cancel-setup-trade-route":
    527535    {
    528         "execute": function(target, action, selection, queued)
     536        "execute": function(target, action, selection, queued)
    529537        {
    530538            Engine.PostNetworkCommand({
     
    679687    "garrison":
    680688    {
    681         "execute": function(target, action, selection, queued)
     689        "execute": function(target, action, selection, queued)
    682690        {
    683691            Engine.PostNetworkCommand({
     
    686694                "target": action.target,
    687695                "queued": queued,
     696
    688697                "formation": g_AutoFormation.getNull()
    689698            });
     
    752761    "guard":
    753762    {
    754         "execute": function(target, action, selection, queued)
     763        "execute": function(target, action, selection, queued)
    755764        {
    756765            Engine.PostNetworkCommand({
     
    759768                "target": action.target,
    760769                "queued": queued,
     770
    761771                "formation": g_AutoFormation.getNull()
    762772            });
     
    850860    "remove-guard":
    851861    {
    852         "execute": function(target, action, selection, queued)
     862        "execute": function(target, action, selection, queued)
    853863        {
    854864            Engine.PostNetworkCommand({
     
    856866                "entities": selection,
    857867                "target": action.target,
    858                 "queued": queued
     868                "queued": queued,
     869                "pushFront": pushFront
    859870            });
    860871
     
    891902    "set-rallypoint":
    892903    {
    893         "execute": function(target, action, selection, queued)
     904        "execute": function(target, action, selection, queued)
    894905        {
    895906            // if there is a position set in the action then use this so that when setting a
     
    10991110    "unset-rallypoint":
    11001111    {
    1101         "execute": function(target, action, selection, queued)
     1112        "execute": function(target, action, selection, queued)
    11021113        {
    11031114            Engine.PostNetworkCommand({
  • ps/trunk/binaries/data/mods/public/simulation/ai/common-api/entity.js

    r24999 r25020  
    808808    },
    809809
    810     "move": function(x, z, queued = false) {
    811         Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued });
    812         return this;
    813     },
    814 
    815     "moveToRange": function(x, z, min, max, queued = false) {
    816         Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued });
    817         return this;
    818     },
    819 
    820     "attackMove": function(x, z, targetClasses, allowCapture = true, queued = false) {
    821         Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": [this.id()], "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued });
     810    "move": function(x, z, queued = false) {
     811        Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": x, "z": z, "queued": queued });
     812        return this;
     813    },
     814
     815    "moveToRange": function(x, z, min, max, queued = false) {
     816        Engine.PostCommand(PlayerID, { "type": "walk-to-range", "entities": [this.id()], "x": x, "z": z, "min": min, "max": max, "queued": queued });
     817        return this;
     818    },
     819
     820    "attackMove": function(x, z, targetClasses, allowCapture = true, queued = false) {
     821        Engine.PostCommand(PlayerID, { "type": "attack-walk", "entities": [this.id()], "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "queued": queued });
    822822        return this;
    823823    },
    824824
    825825    // violent, aggressive, defensive, passive, standground
    826     "setStance": function(stance, queued = false) {
     826    "setStance": function(stance, queued = false) {
    827827        if (this.getStance() === undefined)
    828828            return undefined;
    829         Engine.PostCommand(PlayerID, { "type": "stance", "entities": [this.id()], "name": stance, "queued": queued });
     829        Engine.PostCommand(PlayerID, { "type": "stance", "entities": [this.id()], "name": stance, "queued": queued });
    830830        return this;
    831831    },
    832832
    833833    "stopMoving": function() {
    834         Engine.PostCommand(PlayerID, { "type": "stop", "entities": [this.id()], "queued": false });
     834        Engine.PostCommand(PlayerID, { "type": "stop", "entities": [this.id()], "queued": false });
    835835    },
    836836
     
    883883                direction[1] /= norm;
    884884            }
    885             Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + direction[0]*dist, "z": this.position()[1] + direction[1]*dist, "queued": false });
     885            Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + direction[0]*dist, "z": this.position()[1] + direction[1]*dist, "queued": false });
    886886        }
    887887        return this;
     
    897897            FleeDirection[1] = 40 * FleeDirection[1]/dist;
    898898
    899             Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + FleeDirection[0], "z": this.position()[1] + FleeDirection[1], "queued": false });
    900         }
    901         return this;
    902     },
    903 
    904     "gather": function(target, queued = false) {
    905         Engine.PostCommand(PlayerID, { "type": "gather", "entities": [this.id()], "target": target.id(), "queued": queued });
    906         return this;
    907     },
    908 
    909     "repair": function(target, autocontinue = false, queued = false) {
    910         Engine.PostCommand(PlayerID, { "type": "repair", "entities": [this.id()], "target": target.id(), "autocontinue": autocontinue, "queued": queued });
    911         return this;
    912     },
    913 
    914     "returnResources": function(target, queued = false) {
    915         Engine.PostCommand(PlayerID, { "type": "returnresource", "entities": [this.id()], "target": target.id(), "queued": queued });
     899            Engine.PostCommand(PlayerID, { "type": "walk", "entities": [this.id()], "x": this.position()[0] + FleeDirection[0], "z": this.position()[1] + FleeDirection[1], "queued": false });
     900        }
     901        return this;
     902    },
     903
     904    "gather": function(target, queued = false) {
     905        Engine.PostCommand(PlayerID, { "type": "gather", "entities": [this.id()], "target": target.id(), "queued": queued });
     906        return this;
     907    },
     908
     909    "repair": function(target, autocontinue = false, queued = false) {
     910        Engine.PostCommand(PlayerID, { "type": "repair", "entities": [this.id()], "target": target.id(), "autocontinue": autocontinue, "queued": queued });
     911        return this;
     912    },
     913
     914    "returnResources": function(target, queued = false) {
     915        Engine.PostCommand(PlayerID, { "type": "returnresource", "entities": [this.id()], "target": target.id(), "queued": queued });
    916916        return this;
    917917    },
     
    928928
    929929    "tradeRoute": function(target, source) {
    930         Engine.PostCommand(PlayerID, { "type": "setup-trade-route", "entities": [this.id()], "target": target.id(), "source": source.id(), "route": undefined, "queued": false });
     930        Engine.PostCommand(PlayerID, { "type": "setup-trade-route", "entities": [this.id()], "target": target.id(), "source": source.id(), "route": undefined, "queued": false });
    931931        return this;
    932932    },
     
    982982            "autocontinue": false,
    983983            "queued": false,
     984
    984985            "metadata": metadata    // can be undefined
    985986        });
     
    10071008    },
    10081009
    1009     "guard": function(target, queued = false) {
    1010         Engine.PostCommand(PlayerID, { "type": "guard", "entities": [this.id()], "target": target.id(), "queued": queued });
     1010    "guard": function(target, queued = false) {
     1011        Engine.PostCommand(PlayerID, { "type": "guard", "entities": [this.id()], "target": target.id(), "queued": queued });
    10111012        return this;
    10121013    },
  • ps/trunk/binaries/data/mods/public/simulation/components/UnitAI.js

    r25000 r25020  
    53505350};
    53515351
    5352 UnitAI.prototype.AddOrder = function(type, data, queued)
     5352UnitAI.prototype.AddOrder = function(type, data, queued)
    53535353{
    53545354    if (this.expectedRoute)
    53555355        this.expectedRoute = undefined;
    53565356
    5357     if (queued)
     5357    if (pushFront)
     5358        this.PushOrderFront(type, data);
     5359    else if (queued)
    53585360        this.PushOrder(type, data);
    53595361    else
     
    53705372 * Adds guard/escort order to the queue, forced by the player.
    53715373 */
    5372 UnitAI.prototype.Guard = function(target, queued)
     5374UnitAI.prototype.Guard = function(target, queued)
    53735375{
    53745376    if (!this.CanGuard())
     
    53895391    }
    53905392
    5391     this.AddOrder("Guard", { "target": target, "force": false }, queued);
     5393    this.AddOrder("Guard", { "target": target, "force": false }, queued);
    53925394};
    53935395
     
    54715473 * Adds walk order to queue, forced by the player.
    54725474 */
    5473 UnitAI.prototype.Walk = function(x, z, queued)
    5474 {
    5475     if (this.expectedRoute && queued)
     5475UnitAI.prototype.Walk = function(x, z, queued)
     5476{
     5477    if (this.expectedRoute && queued)
    54765478        this.expectedRoute.push({ "x": x, "z": z });
    54775479    else
    5478         this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued);
     5480        this.AddOrder("Walk", { "x": x, "z": z, "force": true }, queued);
    54795481};
    54805482
     
    54825484 * Adds walk to point range order to queue, forced by the player.
    54835485 */
    5484 UnitAI.prototype.WalkToPointRange = function(x, z, min, max, queued)
    5485 {
    5486     this.AddOrder("Walk", { "x": x, "z": z, "min": min, "max": max, "force": true }, queued);
     5486UnitAI.prototype.WalkToPointRange = function(x, z, min, max, queued)
     5487{
     5488    this.AddOrder("Walk", { "x": x, "z": z, "min": min, "max": max, "force": true }, queued);
    54875489};
    54885490
     
    54905492 * Adds stop order to queue, forced by the player.
    54915493 */
    5492 UnitAI.prototype.Stop = function(queued)
    5493 {
    5494     this.AddOrder("Stop", { "force": true }, queued);
     5494UnitAI.prototype.Stop = function(queued)
     5495{
     5496    this.AddOrder("Stop", { "force": true }, queued);
    54955497};
    54965498
     
    54995501 * to a player order, and so is forced.
    55005502 */
    5501 UnitAI.prototype.WalkToTarget = function(target, queued)
    5502 {
    5503     this.AddOrder("WalkToTarget", { "target": target, "force": true }, queued);
     5503UnitAI.prototype.WalkToTarget = function(target, queued)
     5504{
     5505    this.AddOrder("WalkToTarget", { "target": target, "force": true }, queued);
    55045506};
    55055507
     
    55095511 * If targetClasses is given, only entities matching the targetClasses can be attacked.
    55105512 */
    5511 UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = true, queued = false)
    5512 {
    5513     this.AddOrder("WalkAndFight", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued);
    5514 };
    5515 
    5516 UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = true, queued = false)
     5513UnitAI.prototype.WalkAndFight = function(x, z, targetClasses, allowCapture = true, queued = false)
     5514{
     5515    this.AddOrder("WalkAndFight", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued);
     5516};
     5517
     5518UnitAI.prototype.Patrol = function(x, z, targetClasses, allowCapture = true, queued = false)
    55175519{
    55185520    if (!this.CanPatrol())
     
    55225524    }
    55235525
    5524     this.AddOrder("Patrol", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued);
     5526    this.AddOrder("Patrol", { "x": x, "z": z, "targetClasses": targetClasses, "allowCapture": allowCapture, "force": true }, queued);
    55255527};
    55265528
     
    55525554 * Adds attack order to the queue, forced by the player.
    55535555 */
    5554 UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false)
     5556UnitAI.prototype.Attack = function(target, allowCapture = true, queued = false)
    55555557{
    55565558    if (!this.CanAttack(target))
     
    55615563            this.MoveToTargetRange(target, IID_Heal);
    55625564        else
    5563             this.WalkToTarget(target, queued);
     5565            this.WalkToTarget(target, queued);
    55645566        return;
    55655567    }
     
    55835585    }
    55845586
    5585     this.AddOrder("Attack", order, queued);
     5587    this.AddOrder("Attack", order, queued);
    55865588};
    55875589
     
    55895591 * Adds garrison order to the queue, forced by the player.
    55905592 */
    5591 UnitAI.prototype.Garrison = function(target, queued)
     5593UnitAI.prototype.Garrison = function(target, queued)
    55925594{
    55935595    if (target == this.entity)
     
    55985600        return;
    55995601    }
    5600     this.AddOrder("Garrison", { "target": target, "force": true }, queued);
     5602    this.AddOrder("Garrison", { "target": target, "force": true }, queued);
    56015603};
    56025604
     
    56265628 * until the target is reached
    56275629 */
    5628 UnitAI.prototype.Gather = function(target, queued)
    5629 {
    5630     this.PerformGather(target, queued, true);
     5630UnitAI.prototype.Gather = function(target, queued)
     5631{
     5632    this.PerformGather(target, queued, true);
    56315633};
    56325634
     
    56345636 * Internal function to abstract the force parameter.
    56355637 */
    5636 UnitAI.prototype.PerformGather = function(target, queued, force)
     5638UnitAI.prototype.PerformGather = function(target, queued, force)
    56375639{
    56385640    if (!this.CanGather(target))
     
    56795681    }
    56805682
    5681     this.AddOrder("Gather", order, queued);
     5683    this.AddOrder("Gather", order, queued);
    56825684};
    56835685
     
    56865688 * interrupted by attacks.
    56875689 */
    5688 UnitAI.prototype.GatherNearPosition = function(x, z, type, template, queued)
     5690UnitAI.prototype.GatherNearPosition = function(x, z, type, template, queued)
    56895691{
    56905692    if (template.indexOf("resource|") != -1)
     
    56925694
    56935695    if (this.IsFormationController() || Engine.QueryInterface(this.entity, IID_ResourceGatherer))
    5694         this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued);
     5696        this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued);
    56955697    else
    5696         this.AddOrder("Walk", { "x": x, "z": z, "force": false }, queued);
     5698        this.AddOrder("Walk", { "x": x, "z": z, "force": false }, queued);
    56975699};
    56985700
     
    57005702 * Adds heal order to the queue, forced by the player.
    57015703 */
    5702 UnitAI.prototype.Heal = function(target, queued)
     5704UnitAI.prototype.Heal = function(target, queued)
    57035705{
    57045706    if (!this.CanHeal(target))
     
    57165718    }
    57175719
    5718     this.AddOrder("Heal", { "target": target, "force": true }, queued);
     5720    this.AddOrder("Heal", { "target": target, "force": true }, queued);
    57195721};
    57205722
     
    57225724 * Adds return resource order to the queue, forced by the player.
    57235725 */
    5724 UnitAI.prototype.ReturnResource = function(target, queued)
     5726UnitAI.prototype.ReturnResource = function(target, queued)
    57255727{
    57265728    if (!this.CanReturnResource(target, true))
     
    57305732    }
    57315733
    5732     this.AddOrder("ReturnResource", { "target": target, "force": true }, queued);
     5734    this.AddOrder("ReturnResource", { "target": target, "force": true }, queued);
    57335735};
    57345736
     
    57765778 * if coming from a RallyPoint, or through this.expectedRoute if a user command.
    57775779 */
    5778 UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued)
     5780UnitAI.prototype.SetupTradeRoute = function(target, source, route, queued)
    57795781{
    57805782    if (!this.CanTrade(target))
     
    58275829        }
    58285830        else
    5829             this.AddOrder("Trade", data, queued);
     5831            this.AddOrder("Trade", data, queued);
    58305832    }
    58315833    else
    58325834    {
    58335835        if (this.IsFormationController())
    5834             this.CallMemberFunction("WalkToTarget", [cmpTrader.GetFirstMarket(), queued]);
     5836            this.CallMemberFunction("WalkToTarget", [cmpTrader.GetFirstMarket(), queued]);
    58355837        else
    5836             this.WalkToTarget(cmpTrader.GetFirstMarket(), queued);
     5838            this.WalkToTarget(cmpTrader.GetFirstMarket(), queued);
    58375839        this.expectedRoute = [];
    58385840    }
     
    59225924 * until the target is reached
    59235925 */
    5924 UnitAI.prototype.Repair = function(target, autocontinue, queued)
     5926UnitAI.prototype.Repair = function(target, autocontinue, queued)
    59255927{
    59265928    if (!this.CanRepair(target))
     
    59395941    }
    59405942
    5941     this.AddOrder("Repair", { "target": target, "autocontinue": autocontinue, "force": true }, queued);
     5943    this.AddOrder("Repair", { "target": target, "autocontinue": autocontinue, "force": true }, queued);
    59425944};
    59435945
     
    59465948 * interrupted by attacks.
    59475949 */
    5948 UnitAI.prototype.Flee = function(target, queued)
    5949 {
    5950     this.AddOrder("Flee", { "target": target, "force": false }, queued);
     5950UnitAI.prototype.Flee = function(target, queued)
     5951{
     5952    this.AddOrder("Flee", { "target": target, "force": false }, queued);
    59515953};
    59525954
     
    59565958};
    59575959
    5958 UnitAI.prototype.Pack = function(queued)
     5960UnitAI.prototype.Pack = function(queued)
    59595961{
    59605962    if (this.CanPack())
    5961         this.AddOrder("Pack", { "force": true }, queued);
    5962 };
    5963 
    5964 UnitAI.prototype.Unpack = function(queued)
     5963        this.AddOrder("Pack", { "force": true }, queued);
     5964};
     5965
     5966UnitAI.prototype.Unpack = function(queued)
    59655967{
    59665968    if (this.CanUnpack())
    5967         this.AddOrder("Unpack", { "force": true }, queued);
    5968 };
    5969 
    5970 UnitAI.prototype.CancelPack = function(queued)
     5969        this.AddOrder("Unpack", { "force": true }, queued);
     5970};
     5971
     5972UnitAI.prototype.CancelPack = function(queued)
    59715973{
    59725974    var cmpPack = Engine.QueryInterface(this.entity, IID_Pack);
    59735975    if (cmpPack && cmpPack.IsPacking() && !cmpPack.IsPacked())
    5974         this.AddOrder("CancelPack", { "force": true }, queued);
    5975 };
    5976 
    5977 UnitAI.prototype.CancelUnpack = function(queued)
     5976        this.AddOrder("CancelPack", { "force": true }, queued);
     5977};
     5978
     5979UnitAI.prototype.CancelUnpack = function(queued)
    59785980{
    59795981    var cmpPack = Engine.QueryInterface(this.entity, IID_Pack);
    59805982    if (cmpPack && cmpPack.IsPacking() && cmpPack.IsPacked())
    5981         this.AddOrder("CancelUnpack", { "force": true }, queued);
     5983        this.AddOrder("CancelUnpack", { "force": true }, queued);
    59825984};
    59835985
     
    62996301    if (this.heldPosition)
    63006302    {
    6301         this.AddOrder("Walk", { "x": this.heldPosition.x, "z": this.heldPosition.z, "force": false }, false);
     6303        this.AddOrder("Walk", { "x": this.heldPosition.x, "z": this.heldPosition.z, "force": false }, false);
    63026304        return true;
    63036305    }
  • ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js

    r24999 r25020  
    159159    {
    160160        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    161             cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued);
     161            cmpUnitAI.Walk(cmd.x, cmd.z, cmd.queued);
    162162        });
    163163    },
     
    167167        for (let ent in data.entities)
    168168            GetFormationUnitAIs([data.entities[ent]], player, cmd, data.formation).forEach(cmpUnitAI => {
    169                 cmpUnitAI.Walk(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.queued);
     169                cmpUnitAI.Walk(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.queued);
    170170            });
    171171    },
     
    178178            var cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI);
    179179            if (cmpUnitAI)
    180                 cmpUnitAI.WalkToPointRange(cmd.x, cmd.z, cmd.min, cmd.max, cmd.queued);
     180                cmpUnitAI.WalkToPointRange(cmd.x, cmd.z, cmd.min, cmd.max, cmd.queued);
    181181        }
    182182    },
     
    187187
    188188        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    189             cmpUnitAI.WalkAndFight(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued);
     189            cmpUnitAI.WalkAndFight(cmd.x, cmd.z, cmd.targetClasses, allowCapture, cmd.queued);
    190190        });
    191191    },
     
    196196        for (let ent in data.entities)
    197197            GetFormationUnitAIs([data.entities[ent]], player, cmd, data.formation).forEach(cmpUnitAI => {
    198                 cmpUnitAI.WalkAndFight(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.targetClasses, allowCapture, cmd.queued);
     198                cmpUnitAI.WalkAndFight(cmd.targetPositions[ent].x, cmd.targetPositions[ent].y, cmd.targetClasses, allowCapture, cmd.queued);
    199199            });
    200200    },
     
    209209
    210210        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    211             cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued);
     211            cmpUnitAI.Attack(cmd.target, allowCapture, cmd.queued);
    212212        });
    213213    },
     
    228228
    229229        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    230             cmpUnitAI.Heal(cmd.target, cmd.queued);
     230            cmpUnitAI.Heal(cmd.target, cmd.queued);
    231231        });
    232232    },
     
    239239
    240240        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    241             cmpUnitAI.Repair(cmd.target, cmd.autocontinue, cmd.queued);
     241            cmpUnitAI.Repair(cmd.target, cmd.autocontinue, cmd.queued);
    242242        });
    243243    },
     
    249249
    250250        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    251             cmpUnitAI.Gather(cmd.target, cmd.queued);
     251            cmpUnitAI.Gather(cmd.target, cmd.queued);
    252252        });
    253253    },
     
    256256    {
    257257        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    258             cmpUnitAI.GatherNearPosition(cmd.x, cmd.z, cmd.resourceType, cmd.resourceTemplate, cmd.queued);
     258            cmpUnitAI.GatherNearPosition(cmd.x, cmd.z, cmd.resourceType, cmd.resourceTemplate, cmd.queued);
    259259        });
    260260    },
     
    266266
    267267        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    268             cmpUnitAI.ReturnResource(cmd.target, cmd.queued);
     268            cmpUnitAI.ReturnResource(cmd.target, cmd.queued);
    269269        });
    270270    },
     
    473473
    474474        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    475             cmpUnitAI.Garrison(cmd.target, cmd.queued);
     475            cmpUnitAI.Garrison(cmd.target, cmd.queued);
    476476        });
    477477    },
     
    487487
    488488        GetFormationUnitAIs(data.entities, player, cmd, data.formation).forEach(cmpUnitAI => {
    489             cmpUnitAI.Guard(cmd.target, cmd.queued);
     489            cmpUnitAI.Guard(cmd.target, cmd.queued);
    490490        });
    491491    },
     
    685685
    686686            if (cmd.pack)
    687                 cmpUnitAI.Pack(cmd.queued);
     687                cmpUnitAI.Pack(cmd.queued);
    688688            else
    689                 cmpUnitAI.Unpack(cmd.queued);
     689                cmpUnitAI.Unpack(cmd.queued);
    690690        }
    691691    },
     
    700700
    701701            if (cmd.pack)
    702                 cmpUnitAI.CancelPack(cmd.queued);
     702                cmpUnitAI.CancelPack(cmd.queued);
    703703            else
    704                 cmpUnitAI.CancelUnpack(cmd.queued);
     704                cmpUnitAI.CancelUnpack(cmd.queued);
    705705        }
    706706    },
Note: See TracChangeset for help on using the changeset viewer.