Page MenuHomeWildfire Games

Make ship pickup nicer
Needs ReviewPublic

Authored by causative on Jun 20 2017, 9:22 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#3472
Summary

It's currently sometimes difficult to garrison units in a ship, particularly if the coastline has few available landing spots (e.g. Corsica v Sardinia). You manually direct the ship to the patch of beach where units must be loaded - then you click to load the units into the ship - and immediately the ship moves away from the landing spot!

This is because the ship did not know that it was already on the shore, and it would "helpfully" move closer to the units to try to pick them up. The only way the ship could detect it was on the shore was if it had just previously been given a pickup order, and was still at the same location resulting from the pickup order. Manually moving the ship would change the location, causing the ship to think it is no longer on the shore.

In this patch I add a more reliable test for when the ship is on the shore. I use the hierarchical pathfinder to check if there are any navcells nearby the ship that are reachable by the unit to be picked up.

I also increase the pickup range to 15 from 10, because sometimes it's tricky to get the ship far enough into shore if the coastline is partially obstructed. In doing this, I refactor the GarrisonHolder tag to the base mechanical ship template, to avoid pointless duplication. As a side effect, this means fireships are now also GarrisonHolders (garrison size of 1) which should have zero effect on gameplay.

In the course of testing I noticed an additional bug: Have two ships offshore. Tell the unit to garrison in one ship, but before it finishes doing so, tell the unit to garrison in the other ship instead. The second ship will refuse to pick up the unit, because in UnitAI, the pickup order only occurs when a unit enters the GARRISON state, but the unit was already in the GARRISON state so it could not enter it. I have fixed this bug as well. This bugfix was removed from D665 and split into D2174 on the theory that it would be easier to review in 2 parts.

Test Plan

Have a ship in the open sea away from the shore. Tell a unit to garrison in the ship. The ship should move to the shore so the unit can garrison. (It previously did this; just make sure it still works).

Directly tell the ship to move to a specific point on the coast that the unit can reach. After the ship arrives, tell a unit to garrison in the ship. The ship should not move, and should just wait for the unit.

Tell the ship to move to an area of coast (a cliff, or another island) that the unit can't reach. Tell a unit to garrison in the ship. The ship should move towards the unit.

Have two ships offshore. Tell the unit to garrison in one ship, but before it finishes doing so, tell the unit to garrison in the other ship instead. The second ship should start moving to pick up the unit.

Performance test: tell many units at once to garrison in a ship, on a large map that's mostly land so that the number of reachable hierarchical pathfinding regions is large.

Diff Detail

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1598/ for more details.

mimo added a subscriber: Itms.Jun 21 2017, 2:42 PM

There were some plans some time ago to replace the AI's connected maps (written in JS) by some c++ ones directly in the engine to allow its use also in the simulation. I suppose the HierarchicalPathfinder::GetConnectivityGrid you describe are from that, but we never push it to its term by lack of time. May be @Itms has more info about it as he wrote the c++ part.

But i still think it is the way to go to solve the problem: the root of it is to know where is the shoreline, and with connectivity grids, the one on water will give you all tiles accessible to the ship, the one on land all those accessible to the units, with the shoreline at the intersection. Then the pickup code should choose one of these shoreline tiles and move both ship and units to it. That's it (and that's how the ai works for its naval transport). While the patch you propose is only a hack to solve a specific case which i agree is really annoying, but would still be better to solve it in a more generic way.

Futhermore, although in naval maps the pickup behaviour is indeed poor, there are also other problems which are annoying and which would be solved with these connectivity maps:

  • when islands are near from each other, sometimes the nearest dropsite is on another island, and gatherers are stuck trying to drop their resources there -> that would easily be solved with such connectivity grid
  • still when island are near and you try to unload units, some of them can be spawned on the wrong island or on an isolated rock which was standing there or on some other unreachable place -> that again would be easily solved with such a grid: the player would put a rallypoint where he wants to ungarrison and units would only be spawned on tiles connected to the rallypoint (when it is set)
  • for the future, we could even think to a cleverer UnitAI+pickup: when some units are asked to be moved to a non-connected area but still reachable by ship, the nearest idle ship could come, pick up the units automatically and unload them with a rallypoint at their final destination (which could be a structure to build, some resource to gather or some target to attack)
  • and there are certainly other use cases i've not in mind at the moment

So even if it is more work, i really think it is the way to go rather than implementing in the engine some partial hacks to each specific problem which we will eventually remove when someone has time to implement the correct fix. And if in the meantime we need some short term solution, just disabling the pickup would be my first choice.

causative added a comment.EditedJun 21 2017, 6:13 PM

IMO it's straightforward, not a hack - the previous code had a test intended to check whether the ship was on the shore, which was incorrect and even had a commented TODO to fix it, and now it has been fixed. The code correctly detects when the ship is at the shore, does it not? A cliff is still "shore."

(one possibility is to look for tiles passable to the garrisoning unit rather than impassable to the ship - it is a bit more complex though).

If pickup would be removed entirely, it should be removed on the ship template rather than excising all the pickup code, so it's easier to put it back once someone does what you're talking about. Arguably it's more useful for players to have pickup, but also have it disabled when the ship is on the shore, than not to have pickup at all. But the opposite case can be made. In my experience pickup in its current implementation is near-useless, since I almost always want to manually direct the ship. But perhaps it could confuse a new player who would expect the ship to come to the units.

(By the way - does Petra depend on the UnitAI pickup at all? Or does it entirely direct the ship by its own connectivity algorithm?)

mimo added a comment.Jun 21 2017, 7:36 PM

IMO it's straightforward, not a hack - the previous code had a test intended to check whether the ship was on the shore, which was incorrect and even had a commented TODO to fix it, and now it has been fixed. The code correctly detects when the ship is at the shore, does it not? A cliff is still "shore."

No it detect that there is an obstacle, being it a shore, a rock, a cliff or whatever

(one possibility is to look for tiles passable to the garrisoning unit rather than impassable to the ship - it is a bit more complex though).
If pickup would be removed entirely, it should be removed on the ship template rather than excising all the pickup code, so it's easier to put it back once someone does what you're talking about. Arguably it's more useful for players to have pickup, but also have it disabled when the ship is on the shore, than not to have pickup at all. But the opposite case can be made. In my experience pickup in its current implementation is near-useless, since I almost always want to manually direct the ship. But perhaps it could confuse a new player who would expect the ship to come to the units.
(By the way - does Petra depend on the UnitAI pickup at all? Or does it entirely direct the ship by its own connectivity algorithm?)

no it does everything by hand, relying on its connectivity grids. But would be more useful (and would simplify a lot petra or any custom ai code) if directly done in the simulation.

causative updated this revision to Diff 2656.Jun 22 2017, 1:28 AM
causative edited the summary of this revision. (Show Details)

Just disable pickup.

causative updated this revision to Diff 2657.Jun 22 2017, 1:29 AM
elexis updated the Trac tickets for this revision.Jun 22 2017, 2:41 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1606/ for more details.

elexis added a subscriber: elexis.Jun 22 2017, 2:47 AM

I feel you, I've been raging about this ship behavior a lot too.
Pretty sure that this is going to be reported as a regression by players though if pickup is disabled completely.
Ideally it should compute the shortest path to the units, move there and then wait for the units to garrison.

Also the same issue occurs when repairing ships and siege engines. They move all the time for no reason that is transparent to the player.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1607/ for more details.

causative added a comment.EditedJun 22 2017, 5:43 AM
In D665#26792, @elexis wrote:

I feel you, I've been raging about this ship behavior a lot too.
Pretty sure that this is going to be reported as a regression by players though if pickup is disabled completely.
Ideally it should compute the shortest path to the units, move there and then wait for the units to garrison.

Let's not make the perfect be the enemy of the good. The choices are, improved shoreline detection, or no pickup, or someone else can do the hierarchical pathfinding fix. Or we can just keep the bug. If no one commits to doing the hierarchical pathfinding fix, and the other alternatives are not accepted, we are by default committing to keeping the bug.

If we decide on improved shoreline detection, I can check for passable land unit tiles rather than impassable ship tiles, which covers certain cases such as rocks and the edge of the map and some cliffs.

There are some other considerations for the hierarchical pathfinding fix. In deep water I don't believe there is actually any intersection between areas passable to land units and areas passable to ships. Particularly when you consider a large ship and a siege engine or elephant. You want to allow for an overlap corresponding to the pickup range (15m). This is a serious issue because it means you can't rely on the connectivity maps alone for the ship to find a pickup spot - you have to either augment the connectivity maps with 15m "skip" connections between each region, or else do a costly tile-by-tile search along the coastline each time the path is requested. (How does Petra handle this btw? Wouldn't be surprised if it just leads to a bug on deepwater maps)

Also the same issue occurs when repairing ships and siege engines. They move all the time for no reason that is transparent to the player.

That's a different issue - I believe the ships and siege engines are trying to attack the enemy. I don't see them move when there is no enemy around. The player can solve it by setting the siege engine or ship on hold position. It's unclear what the desired behavior is, e.g. you don't necessarily want a siege engine to stop moving or attacking when it's being repaired.

wraitii added a subscriber: wraitii.EditedJun 22 2017, 12:19 PM

The hierarchical pathfinder (even if we assume my unit motion changes) has no tool to do this in a straightforward manner. The problem is that ship and land units have different passibilities, and there's no known connections between those.

What we can do if fetch the list of all reachable regions for both units, then compare their X/Y coordinates, and then go and compare actual navcell distances based on reachability by each unit. This is difficult as it stands now, but my unit motion improvements to the hierarchical pathfinder (D53) make it far easier and more efficient.

Ultimately we'll then be able to fetch a sea navcell that's reachable for any unit of any passability class with a rather simple check.

I'm entirely against this regression, because if it doesn't appear broken it's never going to be fixed correctly.

Are you going to do the fix yourself? It has been broken for 3 years and no one has fixed it.

causative updated this revision to Diff 2672.Jun 24 2017, 3:59 AM

I have updated the patch so that it uses the hierarchical pathfinder to determine whether the ship is on a shore that the unit to be picked up can reach.

causative edited the summary of this revision. (Show Details)Jun 24 2017, 4:00 AM
causative edited the test plan for this revision. (Show Details)Jun 24 2017, 4:45 AM
causative edited the test plan for this revision. (Show Details)Jun 24 2017, 4:47 AM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1617/ for more details.

Are you going to do the fix yourself? It has been broken for 3 years and no one has fixed it.

"Currently, 0 A.D. is still in alpha phase, which means an early experimental phase. It is playable, and you can already download and test the game."
Else?

Mh, I don't think this would really work because it doesn't fix the fundamental bug: that units don't necessarily go somewhere that's going to work (the todo in UNitAI.JS basically).
We need to pick a position where we can pick up our units, or the bug will remain. However we might order a ship to pickup several units, even units on different unconnected islands, so there might not be a single viable position.

So correct approach for me would be, when ordered to pick units up:
> If we're already trying to pick a unit up, wait until we have
> If not, Compute a position where we can pick that unit up for sure.
And repeat for each unit that we're asked to pick up (store them in a list or something and go through one after the other.)

The algorithm for picking that position needs to be fast and perfect enough, which it really isn't currently, and can't be before D53 imo. I'd need to think about it a little to ensure it performs well enough, but something like this:

  1. Fetch all reachable regions for the land unit
  2. Fetch all reachable regions for the sea unit
  3. Compare every regions together, check if they are close enough that we might find a pickup position, store them in a list.
  4. For all plausible region pairs from our list above, check all navcells of both regions for any valid pair (i.e. a pair of (navcell in region A, navcell in region B) where the distance between both is < to the pickup range).
    • If found, order the ship to go there - the unit should then be able to figure out a path to the ship, but we could also temporarily order it to go there since it'd ensure the unit doesn't behave too weirdly).
    • If not found, unit can't be picked up.

(again, will need some implementation details to be worked out and could probably use optimisations)

An alternative might be to code a custom A*-like function where we try to get the land/picked-up unit close enough to an accessible sea navcell, but this might actually mean more computations overall - unsure.

"The bug" in this context is where the ship moves away from the shore when the user wants to put something in it. This specific gameplay issue doesn't need the solution you're describing. Finding a pickup location is separate from shoreline detection, and a complete pickup solution will need both (see below), so this patch is a step forward in any case. I also want to note that mimo only asked for connectivity based shoreline detection, which we now have, so let's move forward on that.

Here are potential design issues in trying to find the pickup location using the hierarchical pathfinder:

  • If there are ships in the way, it doesn't work. In multiplayer naval combat, there are very often ships in the way because the way you win pvp naval combat is by having a lot of ships, which fill up lots of space, and move and die slowly. That means the user must micromanage each ship to get them where they want them to go. Using hierarchical pathfinding to find the pickup point can't fix this common case, and thus is not very close to being ideal.
  • If you simply move the ship to the closest pickup location for the unit, this will ignore the user's choice of where he wanted to put his ship on the shore. Maybe he had a good reason for putting it farther away; there may be enemy towers or ships near the closer pickup point, or there may be the user's own ships near the coast blocking the pickup ship from moving to another spot. If the ship moves away from the pickup point the user chose, that's the same bug mentioned in the revision description! Therefore, before searching for the closest pickup location, we must detect whether the ship is already on a reachable shore, and not move it if it is.
vladislavbelov requested changes to this revision.Jun 26 2017, 12:10 AM
vladislavbelov added a subscriber: vladislavbelov.

Not deep review, mostly code style comments.

source/simulation2/components/CCmpPathfinder.cpp
287

Couldn't we replace set by unordered_set in future?

297

Spaces around = and below too.

304

Do not use count if you only search a value, use reachable.find(landRegion) != reachable.

306

Unecessary variable, you could just return a value:

if (...)
    return true;
// after loop
return false;
source/simulation2/helpers/LongPathfinder.h
247 ↗(On Diff #2672)

No need to have a space before &.

This revision now requires changes to proceed.Jun 26 2017, 12:10 AM
source/simulation2/components/CCmpPathfinder.cpp
304

... != reachable.end().

causative updated this revision to Diff 2691.Jun 26 2017, 11:16 AM
causative edited edge metadata.

vladislav changes

Build has FAILED

Updating workspaces.
Build (release)...
In file included from ../../../source/simulation2/helpers/LongPathfinder.h:22:0,
                 from ../../../source/simulation2/components/CCmpPathfinder_Common.h:39,
                 from ../../../source/simulation2/components/CCmpPathfinder.cpp:25:
../../../source/simulation2/helpers/HierarchicalPathfinder.h:116:48: error: ‘std::unordered_set’ has not been declared
  void FindReachableRegions(RegionID from, std::unordered_set<RegionID>& reachable, pass_class_t passClass);
                                                ^
../../../source/simulation2/helpers/HierarchicalPathfinder.h:116:61: error: expected ‘,’ or ‘...’ before ‘<’ token
  void FindReachableRegions(RegionID from, std::unordered_set<RegionID>& reachable, pass_class_t passClass);
                                                             ^
../../../source/simulation2/components/CCmpPathfinder.cpp: In member function ‘virtual bool CCmpPathfinder::CheckNearShore(entity_id_t, entity_id_t, fixed) const’:
../../../source/simulation2/components/CCmpPathfinder.cpp:254:2: error: ‘unordered_set’ is not a member of ‘std’
  std::unordered_set<HierarchicalPathfinder::RegionID> reachable;
  ^
../../../source/simulation2/components/CCmpPathfinder.cpp:254:53: error: expected primary-expression before ‘>’ token
  std::unordered_set<HierarchicalPathfinder::RegionID> reachable;
                                                     ^
../../../source/simulation2/components/CCmpPathfinder.cpp:254:55: error: ‘reachable’ was not declared in this scope
  std::unordered_set<HierarchicalPathfinder::RegionID> reachable;
                                                       ^
make[1]: *** [obj/simulation2_Release/CCmpPathfinder.o] Error 1
make: *** [simulation2] Error 2
make: *** Waiting for unfinished jobs....

Link to build: http://jw:8080/job/phabricator/1624/
See console output for more information: http://jw:8080/job/phabricator/1624/console

causative updated this revision to Diff 2693.Jun 26 2017, 11:53 AM
causative marked 4 inline comments as done.
causative marked an inline comment as not done.
causative updated this revision to Diff 2694.Jun 26 2017, 12:38 PM

Fix an additional (pre-existing) bug discovered in UnitAI where if you give the order to garrison the same unit in two ships in a row, the second ship will not pickup.

causative edited the summary of this revision. (Show Details)Jun 26 2017, 12:40 PM
causative edited the test plan for this revision. (Show Details)

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1626/ for more details.

causative updated this revision to Diff 2696.Jun 26 2017, 1:20 PM

replaced set with unordered_set (this required it to also be changed in many places in HierarchicalPathfinder)

causative marked 3 inline comments as done.Jun 26 2017, 1:21 PM

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1627/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1628/ for more details.

Build is green

Updating workspaces.
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

http://jw:8080/job/phabricator/1629/ for more details.

this maybe something for @temple ?:)

Adding to my review queue, no promise on when I'll get around to it.

Stan added a subscriber: Stan.Apr 19 2019, 6:14 PM

@wraitii This year maybe ? ;)

At this point it'd probably be usefully rebased on top of D1834... I'll keep this in my review queue as I might commandeer at some point in the future.

The expected player experience is that the ship moves to the closest point to the shoreline where the units to be picked up are.
The current behavior is that the ship moves to the correct island, but upon every garrisoning moves to a presumed better location again (which turns out to be a waste of time in many cases).
If I understood the patch correctly, the behavior of the patch is that the ship moves to the closest shoreline, which may be on an entirely different island, at least.

So if I understand the patch correctly, it changes one defect for another.
But the patch might be adapted to match the expected user behavior.

Imarok added a subscriber: Imarok.Apr 25 2019, 2:26 PM
In D665#76122, @elexis wrote:

The expected player experience is that the ship moves to the closest point to the shoreline where the units to be picked up are.
The current behavior is that the ship moves to the correct island, but upon every garrisoning moves to a presumed better location again (which turns out to be a waste of time in many cases).
If I understood the patch correctly, the behavior of the patch is that the ship moves to the closest shoreline, which may be on an entirely different island, at least.
So if I understand the patch correctly, it changes one defect for another.
But the patch might be adapted to match the expected user behavior.

One easy fix would be that the ship won't move if the units can be garrissoned with the ship not moving.
Or just never move the ship.

causative updated this revision to Diff 10449.Sun, Dec 1, 1:45 AM

Updated to trunk. Took out the std::unordered_set change, because other code in HierarchicalPathfinder.cpp now depends on the set being ordered.

causative added a comment.EditedSun, Dec 1, 1:48 AM
In D665#76122, @elexis wrote:

If I understood the patch correctly, the behavior of the patch is that the ship moves to the closest shoreline, which may be on an entirely different island, at least.

No. It still goes to the shoreline reachable by the unit, but *only if* the ship was offshore, or on a shore not reachable by the unit, to begin with. If the ship was already on a shore reachable by the unit, now it won't move.

In D665#76161, @Imarok wrote:

One easy fix would be that the ship won't move if the units can be garrissoned with the ship not moving.

That's what the patch already does.

Vulcan added a comment.Sun, Dec 1, 1:53 AM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/662/display/redirect

Vulcan added a comment.Sun, Dec 1, 2:06 AM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpPathfinder.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/simulation2/components/ICmpPathfinder.h
|  34| template<typename·T>·class·Grid;
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/CCmpPathfinder_Common.h
|  34| #include·"graphics/Overlay.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/HierarchicalPathfinder.h
|  34| ·*·is·defined·as·a·region.
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 344| 344| 		let cmpGarrisonHolder = Engine.QueryInterface(this.entity, IID_GarrisonHolder);
| 345| 345| 		let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
| 346| 346| 
| 347|    |-		if (!cmpTimer || !cmpGarrisonHolder || cmpGarrisonHolder.IsFull()
| 348|    |-			|| this.lastPickupTime && this.lastPickupTime + 100 > cmpTimer.GetTime())
|    | 347|+		if (!cmpTimer || !cmpGarrisonHolder || cmpGarrisonHolder.IsFull() ||
|    | 348|+			this.lastPickupTime && this.lastPickupTime + 100 > cmpTimer.GetTime())
| 349| 349| 		{
| 350| 350| 			this.FinishOrder();
| 351| 351| 			return;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 763| 763| 					this.FinishOrder();
| 764| 764| 					return;
| 765| 765| 				}
| 766|    |-				else
| 767|    |-				{
|    | 766|+				
| 768| 767| 					this.SetNextState("GARRISON.APPROACHING");
| 769| 768| 					return;
| 770|    |-				}
|    | 769|+				
| 771| 770| 			}
| 772| 771| 
| 773| 772| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1031|1031| 			},
|1032|1032| 		},
|1033|1033| 
|1034|    |-		"GARRISON":{
|    |1034|+		"GARRISON": {
|1035|1035| 			"leave": function() {
|1036|1036| 				// If a pickup has been requested and not yet canceled, cancel it
|1037|1037| 				if (this.pickup)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1964|1964| 
|1965|1965| 				"Attacked": function(msg) {
|1966|1966| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1967|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1968|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1967|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1968|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1969|1969| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1970|1970| 				},
|1971|1971| 			},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2692|2692| 					{
|2693|2693| 						// The building was already finished/fully repaired before we arrived;
|2694|2694| 						// let the ConstructionFinished handler handle this.
|2695|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2695|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2696|2696| 						return true;
|2697|2697| 					}
|2698|2698| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2692|2692| 					{
|2693|2693| 						// The building was already finished/fully repaired before we arrived;
|2694|2694| 						// let the ConstructionFinished handler handle this.
|2695|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2695|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2696|2696| 						return true;
|2697|2697| 					}
|2698|2698| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3191|3191| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3192|3192| 
|3193|3193| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3194|    |-							// only used for domestic animals
|    |3194|+		// only used for domestic animals
|3195|3195| 	},
|3196|3196| };
|3197|3197| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3248|3248| 
|3249|3249| UnitAI.prototype.IsAnimal = function()
|3250|3250| {
|3251|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3251|+	return (!!this.template.NaturalBehaviour);
|3252|3252| };
|3253|3253| 
|3254|3254| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3364|3364| 		{
|3365|3365| 			let index = this.GetCurrentState().indexOf(".");
|3366|3366| 			if (index != -1)
|3367|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3367|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3368|3368| 			this.Stop(false);
|3369|3369| 		}
|3370|3370| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3420|3420| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3421|3421| 			continue;
|3422|3422| 		if (i == 0)
|3423|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3423|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3424|3424| 		else
|3425|3425| 			this.orderQueue.splice(i, 1);
|3426|3426| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3420|3420| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3421|3421| 			continue;
|3422|3422| 		if (i == 0)
|3423|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3423|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3424|3424| 		else
|3425|3425| 			this.orderQueue.splice(i, 1);
|3426|3426| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3504|3504| };
|3505|3505| 
|3506|3506| 
|3507|    |-//// FSM linkage functions ////
|    |3507|+// // FSM linkage functions ////
|3508|3508| 
|3509|3509| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3510|3510| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3674|3674| 				continue;
|3675|3675| 			if (this.orderQueue[i].type == type)
|3676|3676| 				continue;
|3677|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3677|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3678|3678| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3679|3679| 			return;
|3680|3680| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3674|3674| 				continue;
|3675|3675| 			if (this.orderQueue[i].type == type)
|3676|3676| 				continue;
|3677|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3677|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3678|3678| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3679|3679| 			return;
|3680|3680| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3845|3845| 	if (data.timerRepeat === undefined)
|3846|3846| 		this.timer = undefined;
|3847|3847| 
|3848|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3848|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3849|3849| };
|3850|3850| 
|3851|3851| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3845|3845| 	if (data.timerRepeat === undefined)
|3846|3846| 		this.timer = undefined;
|3847|3847| 
|3848|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3848|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3849|3849| };
|3850|3850| 
|3851|3851| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3890|3890| 	// TODO: This is a bit inefficient since every unit listens to every
|3891|3891| 	// construction message - ideally we could scope it to only the one we're building
|3892|3892| 
|3893|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3893|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3894|3894| };
|3895|3895| 
|3896|3896| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3890|3890| 	// TODO: This is a bit inefficient since every unit listens to every
|3891|3891| 	// construction message - ideally we could scope it to only the one we're building
|3892|3892| 
|3893|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3893|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3894|3894| };
|3895|3895| 
|3896|3896| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3915|3915| 
|3916|3916| UnitAI.prototype.OnAttacked = function(msg)
|3917|3917| {
|3918|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3918|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3919|3919| };
|3920|3920| 
|3921|3921| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3915|3915| 
|3916|3916| UnitAI.prototype.OnAttacked = function(msg)
|3917|3917| {
|3918|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3918|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3919|3919| };
|3920|3920| 
|3921|3921| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3920|3920| 
|3921|3921| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3922|3922| {
|3923|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3923|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3924|3924| };
|3925|3925| 
|3926|3926| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3920|3920| 
|3921|3921| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3922|3922| {
|3923|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3923|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3924|3924| };
|3925|3925| 
|3926|3926| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3925|3925| 
|3926|3926| UnitAI.prototype.OnHealthChanged = function(msg)
|3927|3927| {
|3928|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3928|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3929|3929| };
|3930|3930| 
|3931|3931| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3925|3925| 
|3926|3926| UnitAI.prototype.OnHealthChanged = function(msg)
|3927|3927| {
|3928|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3928|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3929|3929| };
|3930|3930| 
|3931|3931| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3931|3931| UnitAI.prototype.OnRangeUpdate = function(msg)
|3932|3932| {
|3933|3933| 	if (msg.tag == this.losRangeQuery)
|3934|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3934|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3935|3935| 	else if (msg.tag == this.losHealRangeQuery)
|3936|3936| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3937|3937| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3931|3931| UnitAI.prototype.OnRangeUpdate = function(msg)
|3932|3932| {
|3933|3933| 	if (msg.tag == this.losRangeQuery)
|3934|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3934|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3935|3935| 	else if (msg.tag == this.losHealRangeQuery)
|3936|3936| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3937|3937| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3933|3933| 	if (msg.tag == this.losRangeQuery)
|3934|3934| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3935|3935| 	else if (msg.tag == this.losHealRangeQuery)
|3936|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3936|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3937|3937| };
|3938|3938| 
|3939|3939| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3933|3933| 	if (msg.tag == this.losRangeQuery)
|3934|3934| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3935|3935| 	else if (msg.tag == this.losHealRangeQuery)
|3936|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3936|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3937|3937| };
|3938|3938| 
|3939|3939| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3938|3938| 
|3939|3939| UnitAI.prototype.OnPackFinished = function(msg)
|3940|3940| {
|3941|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3941|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3942|3942| };
|3943|3943| 
|3944|3944| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3938|3938| 
|3939|3939| UnitAI.prototype.OnPackFinished = function(msg)
|3940|3940| {
|3941|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3941|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3942|3942| };
|3943|3943| 
|3944|3944| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3941|3941| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3942|3942| };
|3943|3943| 
|3944|    |-//// Helper functions to be called by the FSM ////
|    |3944|+// // Helper functions to be called by the FSM ////
|3945|3945| 
|3946|3946| UnitAI.prototype.GetWalkSpeed = function()
|3947|3947| {
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 4 spaces.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4346|4346| 		return false;
|4347|4347| 	var range = cmpGarrisonHolder.GetLoadingRange();
|4348|4348| 
|4349|    |-    // If a pickup has been requested earlier, cancel it
|    |4349|+	// If a pickup has been requested earlier, cancel it
|4350|4350| 	if (this.pickup)
|4351|4351| 	{
|4352|4352| 		Engine.PostMessage(this.pickup, MT_PickupCanceled, { "entity": this.entity });
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4623|4623| UnitAI.prototype.AttackEntityInZone = function(ents)
|4624|4624| {
|4625|4625| 	var target = ents.find(target =>
|4626|    |-		this.CanAttack(target)
|4627|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4626|+		this.CanAttack(target) &&
|    |4627|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4628|4628| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4629|4629| 	);
|4630|4630| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4624|4624| {
|4625|4625| 	var target = ents.find(target =>
|4626|4626| 		this.CanAttack(target)
|4627|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4628|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4627|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4628|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4629|4629| 	);
|4630|4630| 	if (!target)
|4631|4631| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4688|4688| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4689|4689| 	if (this.isGuardOf)
|4690|4690| 	{
|4691|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4691|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4692|4692| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4693|4693| 		if (cmpUnitAI && cmpAttack &&
|4694|4694| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4692|4692| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4693|4693| 		if (cmpUnitAI && cmpAttack &&
|4694|4694| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4695|    |-				return false;
|    |4695|+			return false;
|4696|4696| 	}
|4697|4697| 
|4698|4698| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4730|4730| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4731|4731| 	if (this.isGuardOf)
|4732|4732| 	{
|4733|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4733|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4734|4734| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4735|4735| 		if (cmpUnitAI && cmpAttack &&
|4736|4736| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4743|4743| 	return false;
|4744|4744| };
|4745|4745| 
|4746|    |-//// External interface functions ////
|    |4746|+// // External interface functions ////
|4747|4747| 
|4748|4748| UnitAI.prototype.SetFormationController = function(ent)
|4749|4749| {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4899|4899| 	{
|4900|4900| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4901|4901| 			return;
|4902|    |-		else
|4903|    |-			this.RemoveGuard();
|    |4902|+		this.RemoveGuard();
|4904|4903| 	}
|4905|4904| 
|4906|4905| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5231|5231| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5232|5232| 	{
|5233|5233| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5234|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5234|+		if (cmpTrader.HasBothMarkets() &&
|5235|5235| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5236|5236| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5237|5237| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5512|5512| 				{
|5513|5513| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5514|5514| 					var targetClasses = this.order.data.targetClasses;
|5515|    |-					if (targetClasses.attack && cmpIdentity
|5516|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5515|+					if (targetClasses.attack && cmpIdentity &&
|    |5516|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5517|5517| 						continue;
|5518|5518| 					if (targetClasses.avoid && cmpIdentity
|5519|5519| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5515|5515| 					if (targetClasses.attack && cmpIdentity
|5516|5516| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5517|5517| 						continue;
|5518|    |-					if (targetClasses.avoid && cmpIdentity
|5519|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5518|+					if (targetClasses.avoid && cmpIdentity &&
|    |5519|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5520|5520| 						continue;
|5521|5521| 					// Only used by the AIs to prevent some choices of targets
|5522|5522| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5538|5538| 		{
|5539|5539| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5540|5540| 			var targetClasses = this.order.data.targetClasses;
|5541|    |-			if (cmpIdentity && targetClasses.attack
|5542|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5541|+			if (cmpIdentity && targetClasses.attack &&
|    |5542|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5543|5543| 				continue;
|5544|5544| 			if (cmpIdentity && targetClasses.avoid
|5545|5545| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5541|5541| 			if (cmpIdentity && targetClasses.attack
|5542|5542| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5543|5543| 				continue;
|5544|    |-			if (cmpIdentity && targetClasses.avoid
|5545|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5544|+			if (cmpIdentity && targetClasses.avoid &&
|    |5545|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5546|5546| 				continue;
|5547|5547| 			// Only used by the AIs to prevent some choices of targets
|5548|5548| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5698|5698| 
|5699|5699| UnitAI.prototype.SetHeldPosition = function(x, z)
|5700|5700| {
|5701|    |-	this.heldPosition = {"x": x, "z": z};
|    |5701|+	this.heldPosition = { "x": x, "z": z};
|5702|5702| };
|5703|5703| 
|5704|5704| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5698|5698| 
|5699|5699| UnitAI.prototype.SetHeldPosition = function(x, z)
|5700|5700| {
|5701|    |-	this.heldPosition = {"x": x, "z": z};
|    |5701|+	this.heldPosition = {"x": x, "z": z };
|5702|5702| };
|5703|5703| 
|5704|5704| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5725|5725| 	return false;
|5726|5726| };
|5727|5727| 
|5728|    |-//// Helper functions ////
|    |5728|+// // Helper functions ////
|5729|5729| 
|5730|5730| UnitAI.prototype.CanAttack = function(target)
|5731|5731| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5929|5929| 	return cmpPack && cmpPack.IsPacking();
|5930|5930| };
|5931|5931| 
|5932|    |-//// Formation specific functions ////
|    |5932|+// // Formation specific functions ////
|5933|5933| 
|5934|5934| UnitAI.prototype.IsAttackingAsFormation = function()
|5935|5935| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5934|5934| UnitAI.prototype.IsAttackingAsFormation = function()
|5935|5935| {
|5936|5936| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5937|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5938|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5937|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5938|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5939|5939| };
|5940|5940| 
|5941|5941| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5938|5938| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5939|5939| };
|5940|5940| 
|5941|    |-//// Animal specific functions ////
|    |5941|+// // Animal specific functions ////
|5942|5942| 
|5943|5943| UnitAI.prototype.MoveRandomly = function(distance)
|5944|5944| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 331| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 918| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 943| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 993| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1046| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1076| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1108| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1268| »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1325| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1500| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1522| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1554| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1708| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1758| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1836| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2013| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2129| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2404| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2437| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2543| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2609| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2648| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2849| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3026| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3750| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4610| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4625| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4671| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4694| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 348| »   »   »   ||·this.lastPickupTime·&&·this.lastPickupTime·+·100·>·cmpTimer.GetTime())
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1968| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|3712| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3781| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4627| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4628| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5516| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5519| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5532| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5533| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5539| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5540| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5542| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5545| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5620| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5623| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5628| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5631| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5632| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5642| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5645| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5938| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1178/display/redirect

causative updated this revision to Diff 10452.Sun, Dec 1, 12:23 PM

Remove the extra bugfix that was split into D2174.

causative edited the summary of this revision. (Show Details)Sun, Dec 1, 12:25 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/664/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/components/ICmpPathfinder.h
|  34| template<typename·T>·class·Grid;
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/components/ICmpPathfinder.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/simulation2/components/CCmpPathfinder_Common.h
|  34| #include·"graphics/Overlay.h"
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.

source/simulation2/helpers/HierarchicalPathfinder.h
|  34| ·*·is·defined·as·a·region.
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'template<...' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 344| 344| 		let cmpGarrisonHolder = Engine.QueryInterface(this.entity, IID_GarrisonHolder);
| 345| 345| 		let cmpTimer = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer);
| 346| 346| 
| 347|    |-		if (!cmpTimer || !cmpGarrisonHolder || cmpGarrisonHolder.IsFull()
| 348|    |-			|| this.lastPickupTime && this.lastPickupTime + 100 > cmpTimer.GetTime())
|    | 347|+		if (!cmpTimer || !cmpGarrisonHolder || cmpGarrisonHolder.IsFull() ||
|    | 348|+			this.lastPickupTime && this.lastPickupTime + 100 > cmpTimer.GetTime())
| 349| 349| 		{
| 350| 350| 			this.FinishOrder();
| 351| 351| 			return;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
| 763| 763| 					this.FinishOrder();
| 764| 764| 					return;
| 765| 765| 				}
| 766|    |-				else
| 767|    |-				{
|    | 766|+				
| 768| 767| 					this.SetNextState("GARRISON.APPROACHING");
| 769| 768| 					return;
| 770|    |-				}
|    | 769|+				
| 771| 770| 			}
| 772| 771| 
| 773| 772| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1031|1031| 			},
|1032|1032| 		},
|1033|1033| 
|1034|    |-		"GARRISON":{
|    |1034|+		"GARRISON": {
|1035|1035| 			"enter": function() {
|1036|1036| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1037|1037| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|1980|1980| 
|1981|1981| 				"Attacked": function(msg) {
|1982|1982| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1983|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1984|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1983|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1984|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1985|1985| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1986|1986| 				},
|1987|1987| 			},
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2708|2708| 					{
|2709|2709| 						// The building was already finished/fully repaired before we arrived;
|2710|2710| 						// let the ConstructionFinished handler handle this.
|2711|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2711|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2712|2712| 						return true;
|2713|2713| 					}
|2714|2714| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|2708|2708| 					{
|2709|2709| 						// The building was already finished/fully repaired before we arrived;
|2710|2710| 						// let the ConstructionFinished handler handle this.
|2711|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2711|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2712|2712| 						return true;
|2713|2713| 					}
|2714|2714| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3217|3217| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3218|3218| 
|3219|3219| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3220|    |-							// only used for domestic animals
|    |3220|+		// only used for domestic animals
|3221|3221| 	},
|3222|3222| };
|3223|3223| 
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3274|3274| 
|3275|3275| UnitAI.prototype.IsAnimal = function()
|3276|3276| {
|3277|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3277|+	return (!!this.template.NaturalBehaviour);
|3278|3278| };
|3279|3279| 
|3280|3280| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3390|3390| 		{
|3391|3391| 			let index = this.GetCurrentState().indexOf(".");
|3392|3392| 			if (index != -1)
|3393|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3393|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3394|3394| 			this.Stop(false);
|3395|3395| 		}
|3396|3396| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3446|3446| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3447|3447| 			continue;
|3448|3448| 		if (i == 0)
|3449|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3449|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3450|3450| 		else
|3451|3451| 			this.orderQueue.splice(i, 1);
|3452|3452| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3446|3446| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3447|3447| 			continue;
|3448|3448| 		if (i == 0)
|3449|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3449|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3450|3450| 		else
|3451|3451| 			this.orderQueue.splice(i, 1);
|3452|3452| 		Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3530|3530| };
|3531|3531| 
|3532|3532| 
|3533|    |-//// FSM linkage functions ////
|    |3533|+// // FSM linkage functions ////
|3534|3534| 
|3535|3535| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3536|3536| UnitAI.prototype.SetNextState = function(state)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3700|3700| 				continue;
|3701|3701| 			if (this.orderQueue[i].type == type)
|3702|3702| 				continue;
|3703|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3703|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3704|3704| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3705|3705| 			return;
|3706|3706| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3700|3700| 				continue;
|3701|3701| 			if (this.orderQueue[i].type == type)
|3702|3702| 				continue;
|3703|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3703|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3704|3704| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3705|3705| 			return;
|3706|3706| 		}
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3871|3871| 	if (data.timerRepeat === undefined)
|3872|3872| 		this.timer = undefined;
|3873|3873| 
|3874|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3874|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3875|3875| };
|3876|3876| 
|3877|3877| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3871|3871| 	if (data.timerRepeat === undefined)
|3872|3872| 		this.timer = undefined;
|3873|3873| 
|3874|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3874|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3875|3875| };
|3876|3876| 
|3877|3877| /**
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| 	// TODO: This is a bit inefficient since every unit listens to every
|3917|3917| 	// construction message - ideally we could scope it to only the one we're building
|3918|3918| 
|3919|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3919|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3920|3920| };
|3921|3921| 
|3922|3922| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3916|3916| 	// TODO: This is a bit inefficient since every unit listens to every
|3917|3917| 	// construction message - ideally we could scope it to only the one we're building
|3918|3918| 
|3919|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3919|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3920|3920| };
|3921|3921| 
|3922|3922| UnitAI.prototype.OnGlobalEntityRenamed = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3941|3941| 
|3942|3942| UnitAI.prototype.OnAttacked = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3944|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3945|3945| };
|3946|3946| 
|3947|3947| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3941|3941| 
|3942|3942| UnitAI.prototype.OnAttacked = function(msg)
|3943|3943| {
|3944|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3944|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3945|3945| };
|3946|3946| 
|3947|3947| UnitAI.prototype.OnGuardedAttacked = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3946|3946| 
|3947|3947| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3948|3948| {
|3949|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3949|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3950|3950| };
|3951|3951| 
|3952|3952| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3946|3946| 
|3947|3947| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3948|3948| {
|3949|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3949|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3950|3950| };
|3951|3951| 
|3952|3952| UnitAI.prototype.OnHealthChanged = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3951|3951| 
|3952|3952| UnitAI.prototype.OnHealthChanged = function(msg)
|3953|3953| {
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3954|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3955|3955| };
|3956|3956| 
|3957|3957| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3951|3951| 
|3952|3952| UnitAI.prototype.OnHealthChanged = function(msg)
|3953|3953| {
|3954|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3954|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3955|3955| };
|3956|3956| 
|3957|3957| UnitAI.prototype.OnRangeUpdate = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3957|3957| UnitAI.prototype.OnRangeUpdate = function(msg)
|3958|3958| {
|3959|3959| 	if (msg.tag == this.losRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3961|3961| 	else if (msg.tag == this.losHealRangeQuery)
|3962|3962| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3963|3963| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3957|3957| UnitAI.prototype.OnRangeUpdate = function(msg)
|3958|3958| {
|3959|3959| 	if (msg.tag == this.losRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3961|3961| 	else if (msg.tag == this.losHealRangeQuery)
|3962|3962| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3963|3963| };
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3959|3959| 	if (msg.tag == this.losRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3961|3961| 	else if (msg.tag == this.losHealRangeQuery)
|3962|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3962|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3963|3963| };
|3964|3964| 
|3965|3965| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3959|3959| 	if (msg.tag == this.losRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3961|3961| 	else if (msg.tag == this.losHealRangeQuery)
|3962|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3962|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3963|3963| };
|3964|3964| 
|3965|3965| UnitAI.prototype.OnPackFinished = function(msg)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3964|3964| 
|3965|3965| UnitAI.prototype.OnPackFinished = function(msg)
|3966|3966| {
|3967|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3967|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3968|3968| };
|3969|3969| 
|3970|3970| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3964|3964| 
|3965|3965| UnitAI.prototype.OnPackFinished = function(msg)
|3966|3966| {
|3967|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3967|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3968|3968| };
|3969|3969| 
|3970|3970| //// Helper functions to be called by the FSM ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3967|3967| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3968|3968| };
|3969|3969| 
|3970|    |-//// Helper functions to be called by the FSM ////
|    |3970|+// // Helper functions to be called by the FSM ////
|3971|3971| 
|3972|3972| UnitAI.prototype.GetWalkSpeed = function()
|3973|3973| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4636|4636| UnitAI.prototype.AttackEntityInZone = function(ents)
|4637|4637| {
|4638|4638| 	var target = ents.find(target =>
|4639|    |-		this.CanAttack(target)
|4640|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4639|+		this.CanAttack(target) &&
|    |4640|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4641|4641| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4642|4642| 	);
|4643|4643| 	if (!target)
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4637|4637| {
|4638|4638| 	var target = ents.find(target =>
|4639|4639| 		this.CanAttack(target)
|4640|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4641|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4640|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4641|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4642|4642| 	);
|4643|4643| 	if (!target)
|4644|4644| 		return false;
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4701|4701| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4702|4702| 	if (this.isGuardOf)
|4703|4703| 	{
|4704|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4704|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4705|4705| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4706|4706| 		if (cmpUnitAI && cmpAttack &&
|4707|4707| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 4.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4705|4705| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4706|4706| 		if (cmpUnitAI && cmpAttack &&
|4707|4707| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4708|    |-				return false;
|    |4708|+			return false;
|4709|4709| 	}
|4710|4710| 
|4711|4711| 	// Stop if we're in hold-ground mode and it's too far from the holding point
|    | [NORMAL] ESLintBear (no-multi-spaces):
|    | Multiple spaces found before 'Engine'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4743|4743| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4744|4744| 	if (this.isGuardOf)
|4745|4745| 	{
|4746|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4746|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4747|4747| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4748|4748| 		if (cmpUnitAI && cmpAttack &&
|4749|4749| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4756|4756| 	return false;
|4757|4757| };
|4758|4758| 
|4759|    |-//// External interface functions ////
|    |4759|+// // External interface functions ////
|4760|4760| 
|4761|4761| UnitAI.prototype.SetFormationController = function(ent)
|4762|4762| {
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|4912|4912| 	{
|4913|4913| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4914|4914| 			return;
|4915|    |-		else
|4916|    |-			this.RemoveGuard();
|    |4915|+		this.RemoveGuard();
|4917|4916| 	}
|4918|4917| 
|4919|4918| 	this.AddOrder("Guard", { "target": target, "force": false }, queued);
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5244|5244| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5245|5245| 	{
|5246|5246| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5247|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5247|+		if (cmpTrader.HasBothMarkets() &&
|5248|5248| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5249|5249| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5250|5250| 		{
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5525|5525| 				{
|5526|5526| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5527|5527| 					var targetClasses = this.order.data.targetClasses;
|5528|    |-					if (targetClasses.attack && cmpIdentity
|5529|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5528|+					if (targetClasses.attack && cmpIdentity &&
|    |5529|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5530|5530| 						continue;
|5531|5531| 					if (targetClasses.avoid && cmpIdentity
|5532|5532| 						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5528|5528| 					if (targetClasses.attack && cmpIdentity
|5529|5529| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5530|5530| 						continue;
|5531|    |-					if (targetClasses.avoid && cmpIdentity
|5532|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5531|+					if (targetClasses.avoid && cmpIdentity &&
|    |5532|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5533|5533| 						continue;
|5534|5534| 					// Only used by the AIs to prevent some choices of targets
|5535|5535| 					if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5551|5551| 		{
|5552|5552| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5553|5553| 			var targetClasses = this.order.data.targetClasses;
|5554|    |-			if (cmpIdentity && targetClasses.attack
|5555|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5554|+			if (cmpIdentity && targetClasses.attack &&
|    |5555|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5556|5556| 				continue;
|5557|5557| 			if (cmpIdentity && targetClasses.avoid
|5558|5558| 				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5554|5554| 			if (cmpIdentity && targetClasses.attack
|5555|5555| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5556|5556| 				continue;
|5557|    |-			if (cmpIdentity && targetClasses.avoid
|5558|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5557|+			if (cmpIdentity && targetClasses.avoid &&
|    |5558|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5559|5559| 				continue;
|5560|5560| 			// Only used by the AIs to prevent some choices of targets
|5561|5561| 			if (targetClasses.vetoEntities && targetClasses.vetoEntities[targ])
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5711|5711| 
|5712|5712| UnitAI.prototype.SetHeldPosition = function(x, z)
|5713|5713| {
|5714|    |-	this.heldPosition = {"x": x, "z": z};
|    |5714|+	this.heldPosition = { "x": x, "z": z};
|5715|5715| };
|5716|5716| 
|5717|5717| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5711|5711| 
|5712|5712| UnitAI.prototype.SetHeldPosition = function(x, z)
|5713|5713| {
|5714|    |-	this.heldPosition = {"x": x, "z": z};
|    |5714|+	this.heldPosition = {"x": x, "z": z };
|5715|5715| };
|5716|5716| 
|5717|5717| UnitAI.prototype.SetHeldPositionOnEntity = function(entity)
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5738|5738| 	return false;
|5739|5739| };
|5740|5740| 
|5741|    |-//// Helper functions ////
|    |5741|+// // Helper functions ////
|5742|5742| 
|5743|5743| UnitAI.prototype.CanAttack = function(target)
|5744|5744| {
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5942|5942| 	return cmpPack && cmpPack.IsPacking();
|5943|5943| };
|5944|5944| 
|5945|    |-//// Formation specific functions ////
|    |5945|+// // Formation specific functions ////
|5946|5946| 
|5947|5947| UnitAI.prototype.IsAttackingAsFormation = function()
|5948|5948| {
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5947|5947| UnitAI.prototype.IsAttackingAsFormation = function()
|5948|5948| {
|5949|5949| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5950|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5951|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5950|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5951|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5952|5952| };
|5953|5953| 
|5954|5954| //// Animal specific functions ////
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|5951|5951| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5952|5952| };
|5953|5953| 
|5954|    |-//// Animal specific functions ////
|    |5954|+// // Animal specific functions ////
|5955|5955| 
|5956|5956| UnitAI.prototype.MoveRandomly = function(distance)
|5957|5957| {

binaries/data/mods/public/simulation/components/UnitAI.js
| 331| »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'Order.WalkToTarget' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
| 918| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 943| »   »   »   "enter":·function(msg)·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
| 993| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1056| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1092| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1124| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1284| »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1341| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1516| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1538| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1570| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1724| »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1774| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|1852| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2029| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2145| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2420| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2453| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2559| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2625| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2664| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|2875| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3052| »   »   »   »   "enter":·function()·{
|    | [NORMAL] ESLintBear (consistent-return):
|    | Expected to return a value at the end of method 'enter'.

binaries/data/mods/public/simulation/components/UnitAI.js
|3776| »   var·isWorkType·=·type·=>·type·==·"Gather"·||·type·==·"Trade"·||·type·==·"Repair"·||·type·==·"ReturnResource";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4623| »   var·target·=·ents.find(target·=>·this.CanAttack(target));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4638| »   var·target·=·ents.find(target·=>
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'target' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4684| »   var·ent·=·ents.find(ent·=>·this.CanHeal(ent));
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
|4707| »   »   ····cmpAttack.GetAttackTypes().some(type·=>·cmpUnitAI.CheckTargetAttackRange(this.isGuardOf,·type)))
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'type' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/UnitAI.js
| 348| »   »   »   ||·this.lastPickupTime·&&·this.lastPickupTime·+·100·>·cmpTimer.GetTime())
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|1984| »   »   »   »   »   »   &&·this.order.data.target·!=·msg.data.attacker·&&·this.GetBestAttackAgainst(msg.data.attacker,·true)·!=·"Capture")
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|3738| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|3807| »   for·(var·i·=·0;·i·<·this.orderQueue.length;·++i)
|    | [NORMAL] JSHintBear:
|    | 'i' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|4640| »   »   &&·this.CheckTargetDistanceFromHeldPosition(target,·IID_Attack,·this.GetBestAttackAgainst(target,·true))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|4641| »   »   &&·(this.GetStance().respondChaseBeyondVision·||·this.CheckTargetIsInVisionRange(target))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5529| »   »   »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5532| »   »   »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5545| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5546| »   for·(var·targ·of·targets)
|    | [NORMAL] JSHintBear:
|    | 'targ' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5552| »   »   »   var·cmpIdentity·=·Engine.QueryInterface(targ,·IID_Identity);
|    | [NORMAL] JSHintBear:
|    | 'cmpIdentity' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5553| »   »   »   var·targetClasses·=·this.order.data.targetClasses;
|    | [NORMAL] JSHintBear:
|    | 'targetClasses' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5555| »   »   »   »   &&·!MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.attack))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5558| »   »   »   »   &&·MatchesClassList(cmpIdentity.GetClassesList(),·targetClasses.avoid))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/UnitAI.js
|5633| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5636| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5641| »   »   var·cmpRanged·=·Engine.QueryInterface(this.entity,·iid);
|    | [NORMAL] JSHintBear:
|    | 'cmpRanged' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5644| »   »   var·range·=·iid·!==·IID_Attack·?·cmpRanged.GetRange()·:·cmpRanged.GetFullAttackRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5645| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5655| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5658| »   »   var·range·=·cmpVision.GetRange();
|    | [NORMAL] JSHintBear:
|    | 'range' is already defined.

binaries/data/mods/public/simulation/components/UnitAI.js
|5951| »   »   &&·this.GetCurrentState()·==·"FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '&&'; readers may interpret this as an expression boundary.
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1180/display/redirect

Angen added a subscriber: Angen.Sun, Dec 1, 4:35 PM