Ticket #4098: 4098.3.diff

File 4098.3.diff, 20.5 KB (added by Stan, 7 years ago)

I fixed the above. About the tests I really don't know what to do for that.

  • binaries/data/mods/public/simulation/components/UnitAI.js

     
    356356        // Check if we need to move     TODO implement a better way to know if we are on the shoreline
    357357        var needToMove = true;
    358358        var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
    359         if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
    360             && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
     359        if (this.lastShorelinePosition && cmpPosition &&
     360            this.lastShorelinePosition.x == cmpPosition.GetPosition().x &&
     361            this.lastShorelinePosition.z == cmpPosition.GetPosition().z)
    361362        {
    362363            // we were already on the shoreline, and have not moved since
    363364            if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
     
    14541455
    14551456        "GuardedAttacked": function(msg) {
    14561457            // do nothing if we have a forced order in queue before the guard order
    1457             for (var i = 0; i < this.orderQueue.length; ++i)
     1458            for(let order of this.orderQueue)
    14581459            {
    1459                 if (this.orderQueue[i].type == "Guard")
     1460                if (order.type == "Guard")
    14601461                    break;
    1461                 if (this.orderQueue[i].data && this.orderQueue[i].data.force)
     1462                if (order.data && order.data.force)
    14621463                    return;
    14631464            }
    14641465            // if we already are targeting another unit still alive, finish with it first
     
    19461947                    var animationName = "attack_" + this.order.data.attackType.toLowerCase();
    19471948                    if (this.IsFormationMember())
    19481949                    {
    1949                         var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
     1950                        let cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
    19501951                        if (cmpFormation)
    19511952                            animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
    19521953                    }
     
    21692170
    21702171                        // Try to find another nearby target of the same specific type
    21712172                        // Also don't switch to a different type of huntable animal
    2172                         var nearby = this.FindNearbyResource(function (ent, type, template) {
    2173                             return (
    2174                                 ent != oldTarget
    2175                                  && ((type.generic == "treasure" && oldType.generic == "treasure")
    2176                                  || (type.specific == oldType.specific
    2177                                  && (type.specific != "meat" || oldTemplate == template)))
    2178                             );
    2179                         }, oldTarget);
     2173                        let nearby = this.FindNearbyResource((ent, type, template) =>
     2174                                ent != oldTarget &&
     2175                                (type.generic == "treasure" && oldType.generic == "treasure" ||
     2176                                (type.specific == oldType.specific &&
     2177                                (type.specific != "meat" || oldTemplate == template))),
     2178                                oldTarget);
    21802179                        if (nearby)
    21812180                        {
    21822181                            this.PerformGather(nearby, false, false);
     
    21972196                            else
    21982197                            {
    21992198                                // we're kind of stuck here. Return resource.
    2200                                 var nearby = this.FindNearestDropsite(oldType.generic);
     2199                                nearby = this.FindNearestDropsite(oldType.generic);
    22012200                                if (nearby)
    22022201                                {
    22032202                                    this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
     
    22342233
    22352234                        // Try to find another nearby target of the same specific type
    22362235                        // Also don't switch to a different type of huntable animal
    2237                         var nearby = this.FindNearbyResource(function (ent, type, template) {
    2238                             return (
    2239                                 ent != oldTarget
    2240                                 && ((type.generic == "treasure" && oldType.generic == "treasure")
    2241                                 || (type.specific == oldType.specific
    2242                                 && (type.specific != "meat" || oldTemplate == template)))
    2243                             );
    2244                         });
     2236                        let nearby = this.FindNearbyResource((ent, type, template) =>
     2237                            ent != oldTarget &&
     2238                            (type.generic == "treasure" && oldType.generic == "treasure" ||
     2239                            (type.specific == oldType.specific &&
     2240                            (type.specific != "meat" || oldTemplate == template))));
    22452241                        if (nearby)
    22462242                        {
    22472243                            this.PerformGather(nearby, false, false);
     
    22802276
    22812277                    // Try to find another nearby target of the same specific type
    22822278                    // Also don't switch to a different type of huntable animal
    2283                     var nearby = this.FindNearbyResource(function (ent, type, template) {
    2284                         return (
    2285                             (type.generic == "treasure" && resourceType.generic == "treasure")
    2286                             || (type.specific == resourceType.specific
    2287                             && (type.specific != "meat" || resourceTemplate == template))
    2288                         );
    2289                     });
     2279                    let nearby = this.FindNearbyResource((ent, type, template) =>
     2280                        (type.generic == "treasure" && resourceType.generic == "treasure") ||
     2281                        (type.specific == resourceType.specific &&
     2282                        (type.specific != "meat" || resourceTemplate == template)));
    22902283
    22912284                    // If there is a nearby resource start gathering
    22922285                    if (nearby)
     
    23002293                        return;
    23012294
    23022295                    // Nothing better to do: go back to dropsite
    2303                     var nearby = this.FindNearestDropsite(resourceType.generic);
     2296                    nearby = this.FindNearestDropsite(resourceType.generic);
    23042297                    if (nearby)
    23052298                    {
    23062299                        this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
     
    24032396                        if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
    24042397                        {
    24052398                            // Gather the resources:
     2399                            let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
    24062400
    2407                             var cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
    2408 
    24092401                            // Try to gather treasure
    24102402                            if (cmpResourceGatherer.TryInstantGather(this.gatheringTarget))
    24112403                                return;
     
    24222414                            // return to the nearest dropsite
    24232415                            if (status.filled)
    24242416                            {
    2425                                 var nearby = this.FindNearestDropsite(resourceType.generic);
     2417                                let nearby = this.FindNearestDropsite(resourceType.generic);
    24262418                                if (nearby)
    24272419                                {
    24282420                                    // (Keep this Gather order on the stack so we'll
     
    24722464
    24732465                    // Give up on this order and try our next queued order
    24742466                    // but first check what is our next order and, if needed, insert a returnResource order
    2475                     var cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
     2467                    let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
    24762468                    if (cmpResourceGatherer.IsCarrying(resourceType.generic) &&
    24772469                        this.orderQueue.length > 1 && this.orderQueue[1] !== "ReturnResource" &&
    24782470                        (this.orderQueue[1].type !== "Gather" || this.orderQueue[1].data.type.generic !== resourceType.generic))
     
    24882480
    24892481                    // Try to find a new resource of the same specific type near our current position:
    24902482                    // Also don't switch to a different type of huntable animal
    2491                     var nearby = this.FindNearbyResource(function (ent, type, template) {
    2492                         return (
    2493                             (type.generic == "treasure" && resourceType.generic == "treasure")
    2494                             || (type.specific == resourceType.specific
    2495                             && (type.specific != "meat" || resourceTemplate == template))
    2496                         );
    2497                     });
     2483                    let nearby = this.FindNearbyResource((ent, type, template) =>
     2484                        (type.generic == "treasure" && resourceType.generic == "treasure") ||
     2485                        (type.specific == resourceType.specific &&
     2486                        (type.specific != "meat" || resourceTemplate == template)));
    24982487                    if (nearby)
    24992488                    {
    25002489                        this.PerformGather(nearby, false, false);
     
    25122501                    // drop it off, and if not then we might as well head to the dropsite
    25132502                    // anyway because that's a nice enough place to congregate and idle
    25142503
    2515                     var nearby = this.FindNearestDropsite(resourceType.generic);
     2504                    nearby = this.FindNearestDropsite(resourceType.generic);
    25162505                    if (nearby)
    25172506                    {
    25182507                        this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
     
    26802669                            // Dump any resources we can
    26812670                            var dropsiteTypes = cmpResourceDropsite.GetTypes();
    26822671
    2683                             var cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
     2672                            let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
    26842673                            cmpResourceGatherer.CommitResources(dropsiteTypes);
    26852674
    26862675                            // Stop showing the carried resource animation.
     
    26962685                    // The dropsite was destroyed, or we couldn't reach it, or ownership changed
    26972686                    // Look for a new one.
    26982687
    2699                     var cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
     2688                    let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
    27002689                    var genericType = cmpResourceGatherer.GetMainCarryingType();
    27012690                    var nearby = this.FindNearestDropsite(genericType);
    27022691                    if (nearby)
     
    28912880                // the build command should look for nearby resources to gather
    28922881                if ((oldData.force || oldData.autoharvest) && this.CanReturnResource(msg.data.newentity, false))
    28932882                {
    2894                     var cmpResourceDropsite = Engine.QueryInterface(msg.data.newentity, IID_ResourceDropsite);
    2895                     var types = cmpResourceDropsite.GetTypes();
     2883                    cmpResourceDropsite = Engine.QueryInterface(msg.data.newentity, IID_ResourceDropsite);
     2884                    let types = cmpResourceDropsite.GetTypes();
    28962885                    // TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
    28972886                    //   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
    2898                     var nearby = this.FindNearbyResource(function (ent, type, template) {
    2899                         return (types.indexOf(type.generic) != -1);
    2900                     });
     2887                    let nearby = this.FindNearbyResource((ent, type, template) => types.indexOf(type.generic) != -1);
    29012888                    if (nearby)
    29022889                    {
    29032890                        this.PerformGather(nearby, true, false);
     
    29762963            "GARRISONED": {
    29772964                "enter": function() {
    29782965                    // Target is not handled the same way with Alert and direct garrisoning
    2979                     if (this.order.data.target)
    2980                         var target = this.order.data.target;
    2981                     else
     2966                    let target = this.order.data.target;
     2967                    if (!target)
    29822968                    {
    29832969                        if (!this.alertGarrisoningTarget)
    29842970                        {
     
    29862972                            this.FinishOrder();
    29872973                            return true;
    29882974                        }
    2989                         var target = this.alertGarrisoningTarget;
     2975                        target = this.alertGarrisoningTarget;
    29902976                    }
    29912977
    29922978                    // Check that we can garrison here
     
    33583344
    33593345UnitAI.prototype.IsUnderAlert = function()
    33603346{
    3361     return this.alertRaiser != undefined;
     3347    return this.alertRaiser !== undefined;
    33623348};
    33633349
    33643350UnitAI.prototype.ResetAlert = function()
     
    34883474    {
    34893475        // Switch to a virgin state to let states execute their leave handlers.
    34903476        // except if garrisoned or cheering or (un)packing, in which case we only clear the order queue
    3491         if (this.isGarrisoned || (this.orderQueue[0] && (this.orderQueue[0].type == "Cheering"
    3492             || this.orderQueue[0].type == "Pack" || this.orderQueue[0].type == "Unpack")))
     3477        if (this.isGarrisoned || (this.orderQueue[0] && (this.orderQueue[0].type == "Cheering" ||
     3478            this.orderQueue[0].type == "Pack" || this.orderQueue[0].type == "Unpack")))
    34933479        {
    34943480            this.orderQueue.length = Math.min(this.orderQueue.length, 1);
    34953481            Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
     
    35533539    {
    35543540        if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
    35553541            continue;
    3556         if (i == 0)
     3542        if (i === 0)
    35573543            this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
    35583544        else
    35593545            this.orderQueue.splice(i, 1);
     
    38383824    // TODO: maybe a better way of doing this would be to use priority levels
    38393825    if (this.order && this.order.type == "Cheering")
    38403826    {
    3841         var order = { "type": type, "data": data };
     3827        let order = { "type": type, "data": data };
    38423828        var cheeringOrder = this.orderQueue.shift();
    38433829        this.orderQueue = [cheeringOrder, order];
    38443830    }
    38453831    else if (this.IsPacking() && type != "CancelPack" && type != "CancelUnpack")
    38463832    {
    3847         var order = { "type": type, "data": data };
     3833        let order = { "type": type, "data": data };
    38483834        var packingOrder = this.orderQueue.shift();
    38493835        this.orderQueue = [packingOrder, order];
    38503836    }
     
    39013887        var cmpUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
    39023888        if (cmpUnitAI)
    39033889        {
    3904             for (var i = 0; i < cmpUnitAI.orderQueue.length; ++i)
     3890            for (let i = 0; i < cmpUnitAI.orderQueue.length; ++i)
    39053891            {
    39063892                if (isWorkType(cmpUnitAI.orderQueue[i].type))
    39073893                {
     
    39133899    }
    39143900
    39153901    // If nothing found, take the unit orders
    3916     for (var i = 0; i < this.orderQueue.length; ++i)
     3902    for (let i = 0; i < this.orderQueue.length; ++i)
    39173903    {
    39183904        if (isWorkType(this.orderQueue[i].type))
    39193905        {
     
    39253911
    39263912UnitAI.prototype.BackToWork = function()
    39273913{
    3928     if (this.workOrders.length == 0)
     3914    if (!this.workOrders.length)
    39293915        return false;
    39303916
    39313917    // Clear the order queue considering special orders not to avoid
     
    41044090        return true;
    41054091
    41064092    var cmpHealth = QueryMiragedInterface(ent, IID_Health);
    4107     return cmpHealth && cmpHealth.GetHitpoints() != 0;
     4093    return cmpHealth && cmpHealth.GetHitpoints() !== 0;
    41084094};
    41094095
    41104096/**
     
    44374423    var t = targetCmpPosition.GetPosition();
    44384424    // h is positive when I'm higher than the target
    44394425    var h = s.y-t.y+range.elevationBonus;
    4440 
     4426    let parabolicMaxRange = 0;
    44414427    // No negative roots please
    4442     if (h>-range.max/2)
    4443         var parabolicMaxRange = Math.sqrt(range.max*range.max+2*range.max*h);
    4444     else
    4445         // return false? Or hope you come close enough?
    4446         var parabolicMaxRange = 0;
    4447         //return false;
     4428    if (h > -range.max / 2)
     4429        parabolicMaxRange = Math.sqrt(range.max * range.max + 2 * range.max * h);
    44484430
    44494431    // the parabole changes while walking, take something in the middle
    4450     var guessedMaxRange = (range.max + parabolicMaxRange)/2;
     4432    var guessedMaxRange = (range.max + parabolicMaxRange) / 2;
    44514433
    44524434    var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
    44534435    if (cmpUnitMotion.MoveToTargetRange(target, range.min, guessedMaxRange))
     
    45094491    if (this.IsFormationMember())
    45104492    {
    45114493        var cmpFormationUnitAI = Engine.QueryInterface(this.formationController, IID_UnitAI);
    4512         if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation()
    4513             && cmpFormationUnitAI.order.data.target == target)
     4494        if (cmpFormationUnitAI && cmpFormationUnitAI.IsAttackingAsFormation() &&
     4495            cmpFormationUnitAI.order.data.target == target)
    45144496            return true;
    45154497    }
    45164498
     
    46894671UnitAI.prototype.AttackEntityInZone = function(ents, forceResponse)
    46904672{
    46914673    var target = ents.find(target =>
    4692         this.CanAttack(target, forceResponse)
    4693         && this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
    4694         && (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
     4674        this.CanAttack(target, forceResponse) &&
     4675        this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
     4676        (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
    46954677    );
    46964678    if (!target)
    46974679        return false;
     
    52045186
    52055187    // Remember the position of our target, if any, in case it disappears
    52065188    // later and we want to head to its last known position
    5207     var lastPos = undefined;
     5189    var lastPos;
    52085190    var cmpPosition = Engine.QueryInterface(target, IID_Position);
    52095191    if (cmpPosition && cmpPosition.IsInWorld())
    52105192        lastPos = cmpPosition.GetPosition();
     
    55275509    {
    55285510        var cmpUnitAI;
    55295511        var cmpFormation = Engine.QueryInterface(this.entity, IID_Formation);
    5530         for each (var ent in cmpFormation.members)
     5512        for (let ent of cmpFormation.members)
    55315513        {
    55325514            if (!(cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI)))
    55335515                continue;
    5534             var targets = cmpUnitAI.GetTargetsFromUnit();
    5535             for (var targ of targets)
     5516            let targets = cmpUnitAI.GetTargetsFromUnit();
     5517            for (let target of targets)
    55365518            {
    5537                 if (!cmpUnitAI.CanAttack(targ))
     5519                if (!cmpUnitAI.CanAttack(target))
    55385520                    continue;
    55395521                if (this.order.data.targetClasses)
    55405522                {
    5541                     var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
    5542                     var targetClasses = this.order.data.targetClasses;
    5543                     if (targetClasses.attack && cmpIdentity
    5544                         && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
     5523                    let cmpIdentity = Engine.QueryInterface(target, IID_Identity);
     5524                    let targetClasses = this.order.data.targetClasses;
     5525                    if (targetClasses.attack && cmpIdentity && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
    55455526                        continue;
    5546                     if (targetClasses.avoid && cmpIdentity
    5547                         && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
     5527                    if (targetClasses.avoid && cmpIdentity && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
    55485528                        continue;
    55495529                    // Only used by the AIs to prevent some choices of targets
    5550                     if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
     5530                    if (targetClasses.vetoEntities && targetClasses.vetoEntities[target])
    55515531                        continue;
    55525532                }
    5553                 this.PushOrderFront("Attack", { "target": targ, "force": true, "allowCapture": true });
     5533                this.PushOrderFront("Attack", { "target": target, "force": true, "allowCapture": true });
    55545534                return true;
    55555535            }
    55565536        }
     
    55585538    }
    55595539
    55605540    var targets = this.GetTargetsFromUnit();
    5561     for (var targ of targets)
     5541    for (let target of targets)
    55625542    {
    5563         if (!this.CanAttack(targ))
     5543        if (!this.CanAttack(target))
    55645544            continue;
    55655545        if (this.order.data.targetClasses)
    55665546        {
    5567             var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
    5568             var targetClasses = this.order.data.targetClasses;
    5569             if (cmpIdentity && targetClasses.attack
    5570                 && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
     5547            let cmpIdentity = Engine.QueryInterface(target, IID_Identity);
     5548            let targetClasses = this.order.data.targetClasses;
     5549            if (cmpIdentity && targetClasses.attack && !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
    55715550                continue;
    5572             if (cmpIdentity && targetClasses.avoid
    5573                 && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
     5551            if (cmpIdentity && targetClasses.avoid && MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
    55745552                continue;
    55755553            // Only used by the AIs to prevent some choices of targets
    5576             if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
     5554            if (targetClasses.vetoEntities && targetClasses.vetoEntities[target])
    55775555                continue;
    55785556        }
    5579         this.PushOrderFront("Attack", { "target": targ, "force": true, "allowCapture": true });
     5557        this.PushOrderFront("Attack", { "target": target, "force": true, "allowCapture": true });
    55805558        return true;
    55815559    }
    55825560
     
    56335611    var ret = { "min": 0, "max": 0 };
    56345612    if (this.GetStance().respondStandGround)
    56355613    {
    5636         var cmpRanged = Engine.QueryInterface(this.entity, iid);
     5614        let cmpRanged = Engine.QueryInterface(this.entity, iid);
    56375615        if (!cmpRanged)
    56385616            return ret;
    5639         var range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
     5617        let range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
    56405618        ret.min = range.min;
    56415619        ret.max = range.max;
    56425620    }
    56435621    else if (this.GetStance().respondChase)
    56445622    {
    5645         var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
     5623        let cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
    56465624        if (!cmpVision)
    56475625            return ret;
    5648         var range = cmpVision.GetRange();
    5649         ret.max = range;
     5626        ret.max = cmpVision.GetRange();
    56505627    }
    56515628    else if (this.GetStance().respondHoldGround)
    56525629    {
    5653         var cmpRanged = Engine.QueryInterface(this.entity, iid);
     5630        let cmpRanged = Engine.QueryInterface(this.entity, iid);
    56545631        if (!cmpRanged)
    56555632            return ret;
    5656         var range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
    5657         var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
     5633        let range = iid !== IID_Attack ? cmpRanged.GetRange() : cmpRanged.GetFullAttackRange();
     5634        let cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
    56585635        if (!cmpVision)
    56595636            return ret;
    56605637        var halfvision = cmpVision.GetRange() / 2;
     
    56645641    // but as it is the default for healers we need to set it to something sane.
    56655642    else if (iid === IID_Heal)
    56665643    {
    5667         var cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
     5644        let cmpVision = Engine.QueryInterface(this.entity, IID_Vision);
    56685645        if (!cmpVision)
    56695646            return ret;
    5670         var range = cmpVision.GetRange();
    5671         ret.max = range;
     5647       
     5648        ret.max = cmpVision.GetRange();
    56725649    }
    56735650    return ret;
    56745651};
     
    59655942UnitAI.prototype.IsAttackingAsFormation = function()
    59665943{
    59675944    var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
    5968     return cmpAttack && cmpAttack.CanAttackAsFormation()
     5945    return cmpAttack && cmpAttack.CanAttackAsFormation() 
    59695946        && this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
    59705947};
    59715948