Page MenuHomeWildfire Games

Remove health component from relics.
Needs ReviewPublic

Authored by Freagarach on Jan 28 2018, 10:33 PM.

Details

Reviewers
bb
temple
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Trac Tickets
#5007
#5014
Summary

This is the second half of D341.
This allows at least relics to have no health (#5007). And adds a player colour background to panel entities (#5014).
Also the capture bar will be shown for panel entities and a capturable-tooltip.

In a later diff, the removal of the health requirement can be extended (e.g. garrisonHolder is required to have health, return resource in UnitAI requires the entity to have health).

Test Plan

Petra should be okay after rP21048 & rP21049.


Verify that:

  • Petra works as usual by playing some test games (or observing).
  • A relic shows as panel entity with the capture bar.
  • A wonder shows as panel entitity with capture and health bars.
  • A hero shows as panel entity with the health bar.
  • Relics cannot be attacked anymore, but can be captured.

Event Timeline

temple created this revision.Jan 28 2018, 10:33 PM
Vulcan added a subscriber: Vulcan.Jan 28 2018, 11:36 PM

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 494| 494| 
| 495| 495| 		let horizSpeed = +this.template[type].ProjectileSpeed;
| 496| 496| 		let gravity = +this.template[type].Gravity;
| 497|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 497|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 498| 498| 
| 499| 499| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 500| 500| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 543| 543| 		let launchPoint = selfPosition.clone();
| 544| 544| 		// TODO: remove this when all the ranged unit templates are updated with Projectile/Launchpoint
| 545| 545| 		launchPoint.y += 3;
| 546|    |-		
|    | 546|+
| 547| 547| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 548| 548| 		if (cmpVisual)
| 549| 549| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 615| 615| 			});
| 616| 616| 	}
| 617| 617| 	else
| 618|    |-	{
|    | 618|+	
| 619| 619| 		// Melee attack - hurt the target immediately
| 620| 620| 		cmpDamage.CauseDamage({
| 621| 621| 			"strengths": this.GetAttackStrengths(type),
| 625| 625| 			"type": type,
| 626| 626| 			"attackerOwner": attackerOwner
| 627| 627| 		});
| 628|    |-	}
|    | 628|+	
| 629| 629| };
| 630| 630| 
| 631| 631| /**

binaries/data/mods/public/simulation/components/Attack.js
| 484| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 589| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template.Ranged.Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1612|1612| 	for (let rct of resourcesCounterTypes)
|1613|1613| 		for (let rt of resourcesTypes)
|1614|1614| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1615|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1615|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1616|1616| 
|1617|1617| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1618|1618| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
| 976| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1051| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1052| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1053| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| // do worry around armies slaughtering the guy standing next to you), etc.
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|    |-		targetVisibleEnemies: true,
|    |  76|+		"targetVisibleEnemies": true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|    |-		targetAttackersAlways: true,
|    |  77|+		"targetAttackersAlways": true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|    |-		respondFlee: false,
|    |  78|+		"respondFlee": false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|    |-		respondChase: true,
|    |  79|+		"respondChase": true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|    |-		respondChaseBeyondVision: true,
|    |  80|+		"respondChaseBeyondVision": true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|  83|  83|
bb added a subscriber: bb.Jan 30 2018, 3:33 PM

The capture bar looks ugly with that empty space above, maybe make the bars in some kind of loop

binaries/data/mods/public/simulation/components/UnitAI.js
393–394

I will reconsider these calls when rebasing secondary attacks, for now looks ok

729

there is an allowCapture variable already, same below

4001

was wondering if we also should check for cmpCapturable.canCapture

elexis added a subscriber: elexis.Jan 30 2018, 3:46 PM
elexis added inline comments.
binaries/data/mods/public/gui/session/session.js
932

So you agree with removing this feature? Maybe useful for mods or is it really universally useless?
When removing features, should always do a blame on the lines and maybe quickly read through the design process of the feature to see if you're doing a huge faux-pas (although it's often unlikely to find a good reason for a bad feature)

983

I don't recall what I had implemented in the D341 diff at the time, but we should add the capture bar to the panel entities, independently of this diff where applicable.

bb requested changes to this revision.Feb 6 2018, 8:47 PM

also requesting changes as above

binaries/data/mods/public/gui/session/session.js
932

hmm left-right split doesn't seem required on first sight (they would essentially be the same right?), but now I wonder why this function isn't used for the xp bars
feature seems unused while it should have been in that perspective

This revision now requires changes to proceed.Feb 6 2018, 8:47 PM
temple updated this revision to Diff 5743.Feb 10 2018, 3:14 AM
temple updated the Trac tickets for this revision.

Move the capture bar to the top of the center panel (for entities without health or resource bars).
Add capture bars to relics in the panel entities (in the top left).
Add blinking when relics are being captured (i.e. same behavior as when heroes are attacked).
Add player color outline to panel entities (#5014).
(Currently we only show heroes with health or relics with capture bars. If/when someone adds entities with both, they can decide how they want to display the bars, e.g. one on the top and one on the bottom, or stacked on the bottom, etc.)

temple marked 2 inline comments as done.Feb 10 2018, 3:22 AM
temple added inline comments.
binaries/data/mods/public/gui/session/session.js
932

It's unused, not worth keeping around in my opinion.

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

Sure. TargetIsAlive doesn't have that kind of check, but whatever. Probably the two should be combined for attacks and instead ask if we can continue to attack this target (using our current attack, whether that's capture or something else), or something like that. Anyway, hopefully this should be okay for now.

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

Updating workspaces...
Build (release)...
Build (debug)...
ar: ../../../binaries/system/libsimulation2_dbg.a: No space left on device
make[1]: *** [../../../binaries/system/libsimulation2_dbg.a] Error 1
make: *** [simulation2] Error 2
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
build/jenkins/build-patch.sh: 78: build/jenkins/build-patch.sh: ./test_dbg: not found
Checking XML files...

Link to build: https://jenkins.wildfiregames.com/job/phabricator/2717/display/redirect

Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 495| 495| 
| 496| 496| 		let horizSpeed = +this.template[type].ProjectileSpeed;
| 497| 497| 		let gravity = +this.template[type].Gravity;
| 498|    |-		//horizSpeed /= 2; gravity /= 2; // slow it down for testing
|    | 498|+		// horizSpeed /= 2; gravity /= 2; // slow it down for testing
| 499| 499| 
| 500| 500| 		let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 501| 501| 		if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (no-trailing-spaces):
|    | Trailing spaces not allowed.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 544| 544| 		let launchPoint = selfPosition.clone();
| 545| 545| 		// TODO: remove this when all the ranged unit templates are updated with Projectile/Launchpoint
| 546| 546| 		launchPoint.y += 3;
| 547|    |-		
|    | 547|+
| 548| 548| 		let cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
| 549| 549| 		if (cmpVisual)
| 550| 550| 		{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/Attack.js
| 616| 616| 			});
| 617| 617| 	}
| 618| 618| 	else
| 619|    |-	{
|    | 619|+	
| 620| 620| 		// Melee attack - hurt the target immediately
| 621| 621| 		cmpDamage.CauseDamage({
| 622| 622| 			"strengths": this.GetAttackStrengths(type),
| 626| 626| 			"type": type,
| 627| 627| 			"attackerOwner": attackerOwner
| 628| 628| 		});
| 629|    |-	}
|    | 629|+	
| 630| 630| };
| 631| 631| 
| 632| 632| /**

binaries/data/mods/public/simulation/components/Attack.js
| 485| ·»   let·cmpDamage·=·Engine.QueryInterface(SYSTEM_ENTITY,·IID_Damage);
|    | [NORMAL] ESLintBear (no-mixed-spaces-and-tabs):
|    | Mixed spaces and tabs.

binaries/data/mods/public/simulation/components/Attack.js
| 590| »   »   cmpTimer.SetTimeout(SYSTEM_ENTITY,·IID_Damage,·"MissileHit",·timeToTarget·*·1000·+·+this.template.Ranged.Delay,·data);
|    | [NORMAL] JSHintBear:
|    | Confusing plusses.

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
| 410| 410| 				// Players see colors depending on diplomacy
| 411| 411| 				g_DisplayedPlayerColors[i] =
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
|    | 413|+						g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414| 414| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415| 415| 					g_DiplomacyColorPalette.Enemy;
| 416| 416| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
| 411| 411| 				g_DisplayedPlayerColors[i] =
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413| 413| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
|    | 414|+							g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415| 415| 					g_DiplomacyColorPalette.Enemy;
| 416| 416| 
| 417| 417| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
| 412| 412| 					g_ViewedPlayer == i ? g_DiplomacyColorPalette.Self :
| 413| 413| 					g_Players[g_ViewedPlayer].isAlly[i] ? g_DiplomacyColorPalette.Ally :
| 414| 414| 					g_Players[g_ViewedPlayer].isNeutral[i] ? g_DiplomacyColorPalette.Neutral :
| 415|    |-					g_DiplomacyColorPalette.Enemy;
|    | 415|+								g_DiplomacyColorPalette.Enemy;
| 416| 416| 
| 417| 417| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 418| 418| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1248|1248| 
|1249|1249| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1250|1250| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1251|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1251|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1252|1252| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1253|1253| 	});
|1254|1254| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1249|1249| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1250|1250| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1251|1251| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1252|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1252|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1253|1253| 	});
|1254|1254| 
|1255|1255| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1250|1250| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1251|1251| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1252|1252| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1253|    |-	});
|    |1253|+		});
|1254|1254| 
|1255|1255| 	let resCodes = g_ResourceData.GetCodes();
|1256|1256| 	for (let r = 0; r < resCodes.length; ++r)
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 1 tab but found 3.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/gui/session/session.js
|1736|1736| 	for (let rct of resourcesCounterTypes)
|1737|1737| 		for (let rt of resourcesTypes)
|1738|1738| 			reportObject[rt + rct.substr(9)] = playerStatistics[rct][rt];
|1739|    |-			// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|    |1739|+	// eg. rt = food rct.substr = Gathered rct = resourcesGathered
|1740|1740| 
|1741|1741| 	reportObject.vegetarianFoodGathered = playerStatistics.resourcesGathered.vegetarianFood;
|1742|1742| 	for (let type of unitsClasses)

binaries/data/mods/public/gui/session/session.js
|1072| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1151| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1152| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1153| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  73|  73| // do worry around armies slaughtering the guy standing next to you), etc.
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|    |-		targetVisibleEnemies: true,
|    |  76|+		"targetVisibleEnemies": true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  74|  74| var g_Stances = {
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|    |-		targetAttackersAlways: true,
|    |  77|+		"targetAttackersAlways": true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  75|  75| 	"violent": {
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|    |-		respondFlee: false,
|    |  78|+		"respondFlee": false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  76|  76| 		targetVisibleEnemies: true,
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|    |-		respondChase: true,
|    |  79|+		"respondChase": true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  77|  77| 		targetAttackersAlways: true,
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|    |-		respondChaseBeyondVision: true,
|    |  80|+		"respondChaseBeyondVision": true,
|  81|  81| 		respondStandGround: false,
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  78|  78| 		respondFlee: false,
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|    |-		respondStandGround: false,
|    |  81|+		"respondStandGround": false,
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  79|  79| 		respondChase: true,
|  80|  80| 		respondChaseBeyondVision: true,
|  81|  81| 		respondStandGround: false,
|  82|    |-		respondHoldGround: false,
|    |  82|+		"respondHoldGround": false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  82|  82| 		respondHoldGround: false,
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|    |-		targetVisibleEnemies: true,
|    |  85|+		"targetVisibleEnemies": true,
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  83|  83| 	},
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|  86|    |-		targetAttackersAlways: false,
|    |  86|+		"targetAttackersAlways": false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  84|  84| 	"aggressive": {
|  85|  85| 		targetVisibleEnemies: true,
|  86|  86| 		targetAttackersAlways: false,
|  87|    |-		respondFlee: false,
|    |  87|+		"respondFlee": false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  85|  85| 		targetVisibleEnemies: true,
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|    |-		respondChase: true,
|    |  88|+		"respondChase": true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|  91|  91| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  86|  86| 		targetAttackersAlways: false,
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|    |-		respondChaseBeyondVision: false,
|    |  89|+		"respondChaseBeyondVision": false,
|  90|  90| 		respondStandGround: false,
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  87|  87| 		respondFlee: false,
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|    |-		respondStandGround: false,
|    |  90|+		"respondStandGround": false,
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  88|  88| 		respondChase: true,
|  89|  89| 		respondChaseBeyondVision: false,
|  90|  90| 		respondStandGround: false,
|  91|    |-		respondHoldGround: false,
|    |  91|+		"respondHoldGround": false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  91|  91| 		respondHoldGround: false,
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|    |-		targetVisibleEnemies: true,
|    |  94|+		"targetVisibleEnemies": true,
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  92|  92| 	},
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|  95|    |-		targetAttackersAlways: false,
|    |  95|+		"targetAttackersAlways": false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  93|  93| 	"defensive": {
|  94|  94| 		targetVisibleEnemies: true,
|  95|  95| 		targetAttackersAlways: false,
|  96|    |-		respondFlee: false,
|    |  96|+		"respondFlee": false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  94|  94| 		targetVisibleEnemies: true,
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|    |-		respondChase: false,
|    |  97|+		"respondChase": false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
| 100| 100| 		respondHoldGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  95|  95| 		targetAttackersAlways: false,
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|    |-		respondChaseBeyondVision: false,
|    |  98|+		"respondChaseBeyondVision": false,
|  99|  99| 		respondStandGround: false,
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  96|  96| 		respondFlee: false,
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|    |-		respondStandGround: false,
|    |  99|+		"respondStandGround": false,
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
| 102| 102| 	"passive": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|  97|  97| 		respondChase: false,
|  98|  98| 		respondChaseBeyondVision: false,
|  99|  99| 		respondStandGround: false,
| 100|    |-		respondHoldGround: true,
|    | 100|+		"respondHoldGround": true,
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 100| 100| 		respondHoldGround: true,
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103|    |-		targetVisibleEnemies: false,
|    | 103|+		"targetVisibleEnemies": false,
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 101| 101| 	},
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
| 104|    |-		targetAttackersAlways: false,
|    | 104|+		"targetAttackersAlways": false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 102| 102| 	"passive": {
| 103| 103| 		targetVisibleEnemies: false,
| 104| 104| 		targetAttackersAlways: false,
| 105|    |-		respondFlee: true,
|    | 105|+		"respondFlee": true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 103| 103| 		targetVisibleEnemies: false,
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106|    |-		respondChase: false,
|    | 106|+		"respondChase": false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
| 109| 109| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 104| 104| 		targetAttackersAlways: false,
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107|    |-		respondChaseBeyondVision: false,
|    | 107|+		"respondChaseBeyondVision": false,
| 108| 108| 		respondStandGround: false,
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 105| 105| 		respondFlee: true,
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108|    |-		respondStandGround: false,
|    | 108|+		"respondStandGround": false,
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
| 111| 111| 	"standground": {
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 106| 106| 		respondChase: false,
| 107| 107| 		respondChaseBeyondVision: false,
| 108| 108| 		respondStandGround: false,
| 109|    |-		respondHoldGround: false,
|    | 109|+		"respondHoldGround": false,
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetVisibleEnemies' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 109| 109| 		respondHoldGround: false,
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112|    |-		targetVisibleEnemies: true,
|    | 112|+		"targetVisibleEnemies": true,
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'targetAttackersAlways' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 110| 110| 	},
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
| 113|    |-		targetAttackersAlways: false,
|    | 113|+		"targetAttackersAlways": false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondFlee' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 111| 111| 	"standground": {
| 112| 112| 		targetVisibleEnemies: true,
| 113| 113| 		targetAttackersAlways: false,
| 114|    |-		respondFlee: false,
|    | 114|+		"respondFlee": false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChase' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 112| 112| 		targetVisibleEnemies: true,
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115|    |-		respondChase: false,
|    | 115|+		"respondChase": false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
| 118| 118| 		respondHoldGround: false,
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondChaseBeyondVision' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 113| 113| 		targetAttackersAlways: false,
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116|    |-		respondChaseBeyondVision: false,
|    | 116|+		"respondChaseBeyondVision": false,
| 117| 117| 		respondStandGround: true,
| 118| 118| 		respondHoldGround: false,
| 119| 119| 	},
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondStandGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 114| 114| 		respondFlee: false,
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117|    |-		respondStandGround: true,
|    | 117|+		"respondStandGround": true,
| 118| 118| 		respondHoldGround: false,
| 119| 119| 	},
| 120| 120| };
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'respondHoldGround' found.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 115| 115| 		respondChase: false,
| 116| 116| 		respondChaseBeyondVision: false,
| 117| 117| 		respondStandGround: true,
| 118|    |-		respondHoldGround: false,
|    | 118|+		"respondHoldGround": false,
| 119| 119| 	},
| 120| 120| };
| 121| 121| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 216| 216| 		// Move a tile outside the building
| 217| 217| 		let range = 4;
| 218| 218| 		if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
| 219|    |-		{
|    | 219|+		
| 220| 220| 			// We've started walking to the given point
| 221| 221| 			this.SetNextState("INDIVIDUAL.WALKING");
| 222|    |-		}
|    | 222|+		
| 223| 223| 		else
| 224| 224| 		{
| 225| 225| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 221| 221| 			this.SetNextState("INDIVIDUAL.WALKING");
| 222| 222| 		}
| 223| 223| 		else
| 224|    |-		{
|    | 224|+		
| 225| 225| 			// We are already at the target, or can't move at all
| 226| 226| 			this.FinishOrder();
| 227|    |-		}
|    | 227|+		
| 228| 228| 	},
| 229| 229| 
| 230| 230| 	// Individual orders:
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 326| 326| 
| 327| 327| 		var ok = this.MoveToTarget(this.order.data.target);
| 328| 328| 		if (ok)
| 329|    |-		{
|    | 329|+		
| 330| 330| 			// We've started walking to the given point
| 331| 331| 			if (this.IsAnimal())
| 332| 332| 				this.SetNextState("ANIMAL.WALKING");
| 333| 333| 			else
| 334| 334| 				this.SetNextState("INDIVIDUAL.WALKING");
| 335|    |-		}
|    | 335|+		
| 336| 336| 		else
| 337| 337| 		{
| 338| 338| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 354| 354| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 355| 355| 		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 356| 356| 		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 357|    |-		{
|    | 357|+		
| 358| 358| 			// we were already on the shoreline, and have not moved since
| 359| 359| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
| 360| 360| 				needToMove = false;
| 361|    |-		}
|    | 361|+		
| 362| 362| 
| 363| 363| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 364| 364| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 352| 352| 		// Check if we need to move     TODO implement a better way to know if we are on the shoreline
| 353| 353| 		var needToMove = true;
| 354| 354| 		var cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
| 355|    |-		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x)
| 356|    |-		    && (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
|    | 355|+		if (this.lastShorelinePosition && cmpPosition && (this.lastShorelinePosition.x == cmpPosition.GetPosition().x) &&
|    | 356|+		    (this.lastShorelinePosition.z == cmpPosition.GetPosition().z))
| 357| 357| 		{
| 358| 358| 			// we were already on the shoreline, and have not moved since
| 359| 359| 			if (DistanceBetweenEntities(this.entity, this.order.data.target) < 50)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 363| 363| 		// TODO: what if the units are on a cliff ? the ship will go below the cliff
| 364| 364| 		// and the units won't be able to garrison. Should go to the nearest (accessible) shore
| 365| 365| 		if (needToMove && this.MoveToTarget(this.order.data.target))
| 366|    |-		{
|    | 366|+		
| 367| 367| 			this.SetNextState("INDIVIDUAL.PICKUP.APPROACHING");
| 368|    |-		}
|    | 368|+		
| 369| 369| 		else
| 370| 370| 		{
| 371| 371| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 392| 392| 		var distance = DistanceBetweenEntities(this.entity, this.order.data.target) + (+this.template.FleeDistance);
| 393| 393| 		var cmpUnitMotion = Engine.QueryInterface(this.entity, IID_UnitMotion);
| 394| 394| 		if (cmpUnitMotion.MoveToTargetRange(this.order.data.target, distance, -1))
| 395|    |-		{
|    | 395|+		
| 396| 396| 			// We've started fleeing from the given target
| 397| 397| 			if (this.IsAnimal())
| 398| 398| 				this.SetNextState("ANIMAL.FLEEING");
| 399| 399| 			else
| 400| 400| 				this.SetNextState("INDIVIDUAL.FLEEING");
| 401|    |-		}
|    | 401|+		
| 402| 402| 		else
| 403| 403| 		{
| 404| 404| 			// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 448| 448| 			}
| 449| 449| 
| 450| 450| 			if (this.order.data.attackType == this.oldAttackType)
| 451|    |-			{
|    | 451|+			
| 452| 452| 				if (this.IsAnimal())
| 453| 453| 					this.SetNextState("ANIMAL.COMBAT.ATTACKING");
| 454| 454| 				else
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456|    |-			}
|    | 456|+			
| 457| 457| 			else
| 458| 458| 			{
| 459| 459| 				if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 455| 455| 					this.SetNextState("INDIVIDUAL.COMBAT.ATTACKING");
| 456| 456| 			}
| 457| 457| 			else
| 458|    |-			{
|    | 458|+			
| 459| 459| 				if (this.IsAnimal())
| 460| 460| 					this.SetNextStateAlwaysEntering("ANIMAL.COMBAT.ATTACKING");
| 461| 461| 				else
| 462| 462| 					this.SetNextStateAlwaysEntering("INDIVIDUAL.COMBAT.ATTACKING");
| 463|    |-			}
|    | 463|+			
| 464| 464| 			return;
| 465| 465| 		}
| 466| 466| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 593| 593| 					this.PushOrderFront("Walk", this.order.data.lastPos);
| 594| 594| 				}
| 595| 595| 				else
| 596|    |-				{
|    | 596|+				
| 597| 597| 					// We couldn't move there, or the target moved away
| 598| 598| 					this.FinishOrder();
| 599|    |-				}
|    | 599|+				
| 600| 600| 				return;
| 601| 601| 			}
| 602| 602| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 606| 606| 
| 607| 607| 		// Try to move within range
| 608| 608| 		if (this.MoveToTargetRange(this.order.data.target, IID_ResourceGatherer))
| 609|    |-		{
|    | 609|+		
| 610| 610| 			// We've started walking to the given point
| 611| 611| 			this.SetNextState("INDIVIDUAL.GATHER.APPROACHING");
| 612|    |-		}
|    | 612|+		
| 613| 613| 		else
| 614| 614| 		{
| 615| 615| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 683| 683| 	"Order.Repair": function(msg) {
| 684| 684| 		// Try to move within range
| 685| 685| 		if (this.MoveToTargetRange(this.order.data.target, IID_Builder))
| 686|    |-		{
|    | 686|+		
| 687| 687| 			// We've started walking to the given point
| 688| 688| 			this.SetNextState("INDIVIDUAL.REPAIR.APPROACHING");
| 689|    |-		}
|    | 689|+		
| 690| 690| 		else
| 691| 691| 		{
| 692| 692| 			// We are already at the target, or can't move at all,
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 720| 720| 		}
| 721| 721| 
| 722| 722| 		if (this.MoveToGarrisonRange(this.order.data.target))
| 723|    |-		{
|    | 723|+		
| 724| 724| 			this.SetNextState("INDIVIDUAL.GARRISON.APPROACHING");
| 725|    |-		}
|    | 725|+		
| 726| 726| 		else
| 727| 727| 		{
| 728| 728| 			// We do a range check before actually garrisoning
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 858| 858| 			if (!this.CheckTargetAttackRange(target, target))
| 859| 859| 			{
| 860| 860| 				if ((this.TargetIsAlive(target) || allowCapture && this.TargetIsCapturable(target)) && this.CheckTargetVisible(target))
| 861|    |-				{
|    | 861|+				
| 862| 862| 					if (this.MoveToTargetAttackRange(target, target))
| 863| 863| 					{
| 864| 864| 						this.SetNextState("COMBAT.APPROACHING");
| 865| 865| 						return;
| 866| 866| 					}
| 867|    |-				}
|    | 867|+				
| 868| 868| 				this.FinishOrder();
| 869| 869| 				return;
| 870| 870| 			}
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 883| 883| 			}
| 884| 884| 			// Check if we are already in range, otherwise walk there
| 885| 885| 			if (!this.CheckGarrisonRange(msg.data.target))
| 886|    |-			{
|    | 886|+			
| 887| 887| 				if (!this.CheckTargetVisible(msg.data.target))
| 888| 888| 				{
| 889| 889| 					this.FinishOrder();
| 898| 898| 						return;
| 899| 899| 					}
| 900| 900| 				}
| 901|    |-			}
|    | 901|+			
| 902| 902| 
| 903| 903| 			this.SetNextState("GARRISON.GARRISONING");
| 904| 904| 		},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 890| 890| 					return;
| 891| 891| 				}
| 892| 892| 				else
| 893|    |-				{
|    | 893|+				
| 894| 894| 					// Out of range; move there in formation
| 895| 895| 					if (this.MoveToGarrisonRange(msg.data.target))
| 896| 896| 					{
| 897| 897| 						this.SetNextState("GARRISON.APPROACHING");
| 898| 898| 						return;
| 899| 899| 					}
| 900|    |-				}
|    | 900|+				
| 901| 901| 			}
| 902| 902| 
| 903| 903| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 889| 889| 					this.FinishOrder();
| 890| 890| 					return;
| 891| 891| 				}
| 892|    |-				else
| 893|    |-				{
|    | 892|+				
| 894| 893| 					// Out of range; move there in formation
| 895| 894| 					if (this.MoveToGarrisonRange(msg.data.target))
| 896| 895| 					{
| 897| 896| 						this.SetNextState("GARRISON.APPROACHING");
| 898| 897| 						return;
| 899| 898| 					}
| 900|    |-				}
|    | 899|+				
| 901| 900| 			}
| 902| 901| 
| 903| 902| 			this.SetNextState("GARRISON.GARRISONING");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
| 916| 916| 						this.PushOrderFront("Walk", msg.data.lastPos);
| 917| 917| 					}
| 918| 918| 					else
| 919|    |-					{
|    | 919|+					
| 920| 920| 						// We couldn't move there, or the target moved away
| 921| 921| 						this.FinishOrder();
| 922|    |-					}
|    | 922|+					
| 923| 923| 					return;
| 924| 924| 				}
| 925| 925| 
|    | [NORMAL] ESLintBear (key-spacing):
|    | Missing space before value for key 'GARRISON'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1137|1137| 			},
|1138|1138| 		},
|1139|1139| 
|1140|    |-		"GARRISON":{
|    |1140|+		"GARRISON": {
|1141|1141| 			"enter": function() {
|1142|1142| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1143|1143| 				var cmpGarrisonHolder = Engine.QueryInterface(this.order.data.target, IID_GarrisonHolder);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1318|1318| 			// If the controller handled an order but some members rejected it,
|1319|1319| 			// they will have no orders and be in the FORMATIONMEMBER.IDLE state.
|1320|1320| 			if (this.orderQueue.length)
|1321|    |-			{
|    |1321|+			
|1322|1322| 				// We're leaving the formation, so stop our FormationWalk order
|1323|1323| 				if (this.FinishOrder())
|1324|1324| 					return;
|1325|    |-			}
|    |1325|+			
|1326|1326| 
|1327|1327| 			// No orders left, we're an individual now
|1328|1328| 			if (this.IsAnimal())
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1346|1346| 			// Move a tile outside the building
|1347|1347| 			let range = 4;
|1348|1348| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|1349|    |-			{
|    |1349|+			
|1350|1350| 				// We've started walking to the given point
|1351|1351| 				this.SetNextState("WALKINGTOPOINT");
|1352|    |-			}
|    |1352|+			
|1353|1353| 			else
|1354|1354| 			{
|1355|1355| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1351|1351| 				this.SetNextState("WALKINGTOPOINT");
|1352|1352| 			}
|1353|1353| 			else
|1354|    |-			{
|    |1354|+			
|1355|1355| 				// We are already at the target, or can't move at all
|1356|1356| 				this.FinishOrder();
|1357|    |-			}
|    |1357|+			
|1358|1358| 		},
|1359|1359| 
|1360|1360| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1369|1369| 		},
|1370|1370| 
|1371|1371| 		"WALKING": {
|1372|    |-			"enter": function () {
|    |1372|+			"enter": function() {
|1373|1373| 				var cmpFormation = Engine.QueryInterface(this.formationController, IID_Formation);
|1374|1374| 				var cmpVisual = Engine.QueryInterface(this.entity, IID_Visual);
|1375|1375| 				if (cmpFormation && cmpVisual)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1552|1552| 
|1553|1553| 			"LosRangeUpdate": function(msg) {
|1554|1554| 				if (this.GetStance().targetVisibleEnemies)
|1555|    |-				{
|    |1555|+				
|1556|1556| 					// Start attacking one of the newly-seen enemy (if any)
|1557|1557| 					this.AttackEntitiesByPreference(msg.data.added);
|1558|    |-				}
|    |1558|+				
|1559|1559| 			},
|1560|1560| 
|1561|1561| 			"LosHealRangeUpdate": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1580|1580| 		},
|1581|1581| 
|1582|1582| 		"WALKING": {
|1583|    |-			"enter": function () {
|    |1583|+			"enter": function() {
|1584|1584| 				this.SelectAnimation("move");
|1585|1585| 			},
|1586|1586| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1590|1590| 		},
|1591|1591| 
|1592|1592| 		"WALKINGANDFIGHTING": {
|1593|    |-			"enter": function () {
|    |1593|+			"enter": function() {
|1594|1594| 				// Show weapons rather than carried resources.
|1595|1595| 				this.SetAnimationVariant("combat");
|1596|1596| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1612|1612| 		},
|1613|1613| 
|1614|1614| 		"PATROL": {
|1615|    |-			"enter": function () {
|    |1615|+			"enter": function() {
|1616|1616| 				// Memorize the origin position in case that we want to go back
|1617|1617| 				let cmpPosition = Engine.QueryInterface(this.entity, IID_Position);
|1618|1618| 				if (!cmpPosition || !cmpPosition.IsInWorld())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1656|1656| 			},
|1657|1657| 
|1658|1658| 			"ESCORTING": {
|1659|    |-				"enter": function () {
|    |1659|+				"enter": function() {
|1660|1660| 					// Show weapons rather than carried resources.
|1661|1661| 					this.SetAnimationVariant("combat");
|1662|1662| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1705|1705| 			},
|1706|1706| 
|1707|1707| 			"GUARDING": {
|1708|    |-				"enter": function () {
|    |1708|+				"enter": function() {
|1709|1709| 					this.StartTimer(1000, 1000);
|1710|1710| 					this.SetHeldPositionOnEntity(this.entity);
|1711|1711| 					this.SelectAnimation("idle");
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1733|1733| 						// if nothing better to do, check if the guarded needs to be healed or repaired
|1734|1734| 						var cmpHealth = Engine.QueryInterface(this.isGuardOf, IID_Health);
|1735|1735| 						if (cmpHealth && (cmpHealth.GetHitpoints() < cmpHealth.GetMaxHitpoints()))
|1736|    |-						{
|    |1736|+						
|1737|1737| 							if (this.CanHeal(this.isGuardOf))
|1738|1738| 								this.PushOrderFront("Heal", { "target": this.isGuardOf, "force": false });
|1739|1739| 							else if (this.CanRepair(this.isGuardOf))
|1740|1740| 								this.PushOrderFront("Repair", { "target": this.isGuardOf, "autocontinue": false, "force": false });
|1741|    |-						}
|    |1741|+						
|1742|1742| 					}
|1743|1743| 				},
|1744|1744| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1790|1790| 			},
|1791|1791| 
|1792|1792| 			"APPROACHING": {
|1793|    |-				"enter": function () {
|    |1793|+				"enter": function() {
|1794|1794| 					// Show weapons rather than carried resources.
|1795|1795| 					this.SetAnimationVariant("combat");
|1796|1796| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1820|1820| 				"MoveCompleted": function() {
|1821|1821| 
|1822|1822| 					if (this.CheckTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1823|    |-					{
|    |1823|+					
|1824|1824| 						// If the unit needs to unpack, do so
|1825|1825| 						if (this.CanUnpack())
|1826|1826| 						{
|1829|1829| 						}
|1830|1830| 						else
|1831|1831| 							this.SetNextState("ATTACKING");
|1832|    |-					}
|    |1832|+					
|1833|1833| 					else
|1834|1834| 					{
|1835|1835| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1827|1827| 							this.PushOrderFront("Unpack", { "force": true });
|1828|1828| 							return;
|1829|1829| 						}
|1830|    |-						else
|1831|    |-							this.SetNextState("ATTACKING");
|    |1830|+						this.SetNextState("ATTACKING");
|1832|1831| 					}
|1833|1832| 					else
|1834|1833| 					{
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1831|1831| 							this.SetNextState("ATTACKING");
|1832|1832| 					}
|1833|1833| 					else
|1834|    |-					{
|    |1834|+					
|1835|1835| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1836|1836| 						{
|1837|1837| 							this.SetNextState("APPROACHING");
|1841|1841| 							// Give up
|1842|1842| 							this.FinishOrder();
|1843|1843| 						}
|1844|    |-					}
|    |1844|+					
|1845|1845| 				},
|1846|1846| 			},
|1847|1847| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1833|1833| 					else
|1834|1834| 					{
|1835|1835| 						if (this.MoveToTargetAttackRange(this.order.data.target, this.order.data.attackType))
|1836|    |-						{
|    |1836|+						
|1837|1837| 							this.SetNextState("APPROACHING");
|1838|    |-						}
|    |1838|+						
|1839|1839| 						else
|1840|1840| 						{
|1841|1841| 							// Give up
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1837|1837| 							this.SetNextState("APPROACHING");
|1838|1838| 						}
|1839|1839| 						else
|1840|    |-						{
|    |1840|+						
|1841|1841| 							// Give up
|1842|1842| 							this.FinishOrder();
|1843|    |-						}
|    |1843|+						
|1844|1844| 					}
|1845|1845| 				},
|1846|1846| 			},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1858|1858| 					}
|1859|1859| 					// Check the target is still alive and attackable
|1860|1860| 					if (this.CanAttack(target) && !this.CheckTargetAttackRange(target, this.order.data.attackType))
|1861|    |-					{
|    |1861|+					
|1862|1862| 						// Can't reach it - try to chase after it
|1863|1863| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1864|1864| 						{
|1868|1868| 								return;
|1869|1869| 							}
|1870|1870| 						}
|1871|    |-					}
|    |1871|+					
|1872|1872| 
|1873|1873| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|1874|1874| 					this.attackTimers = cmpAttack.GetTimers(this.order.data.attackType);
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1861|1861| 					{
|1862|1862| 						// Can't reach it - try to chase after it
|1863|1863| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1864|    |-						{
|    |1864|+						
|1865|1865| 							if (this.MoveToTargetAttackRange(target, this.order.data.attackType))
|1866|1866| 							{
|1867|1867| 								this.SetNextState("COMBAT.CHASING");
|1868|1868| 								return;
|1869|1869| 							}
|1870|    |-						}
|    |1870|+						
|1871|1871| 					}
|1872|1872| 
|1873|1873| 					var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1898|1898| 					// TODO: we should probably only bother syncing projectile attacks, not melee
|1899|1899| 
|1900|1900| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|1901|    |-					this.resyncAnimation = (prepare != this.attackTimers.prepare) ? true : false;
|    |1901|+					this.resyncAnimation = (prepare != this.attackTimers.prepare);
|1902|1902| 
|1903|1903| 					this.FaceTowardsTarget(this.order.data.target);
|1904|1904| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|1972|1972| 
|1973|1973| 						// Can't reach it - try to chase after it
|1974|1974| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|1975|    |-						{
|    |1975|+						
|1976|1976| 							if (this.MoveToTargetRange(target, IID_Attack, this.order.data.attackType))
|1977|1977| 							{
|1978|1978| 								this.SetNextState("COMBAT.CHASING");
|1979|1979| 								return;
|1980|1980| 							}
|1981|    |-						}
|    |1981|+						
|1982|1982| 					}
|1983|1983| 
|1984|1984| 					// if we're targetting a formation, find a new member of that formation
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2019|2019| 
|2020|2020| 				"Attacked": function(msg) {
|2021|2021| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2022|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2023|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2022|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2023|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2024|2024| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2025|2025| 				},
|2026|2026| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2026|2026| 			},
|2027|2027| 
|2028|2028| 			"CHASING": {
|2029|    |-				"enter": function () {
|    |2029|+				"enter": function() {
|2030|2030| 					// Show weapons rather than carried resources.
|2031|2031| 					this.SetAnimationVariant("combat");
|2032|2032| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2101|2101| 
|2102|2102| 						// Try to find another nearby target of the same specific type
|2103|2103| 						// Also don't switch to a different type of huntable animal
|2104|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2104|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2105|2105| 							return (
|2106|2106| 								ent != oldTarget
|2107|2107| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2103|2103| 						// Also don't switch to a different type of huntable animal
|2104|2104| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2105|2105| 							return (
|2106|    |-								ent != oldTarget
|2107|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2106|+								ent != oldTarget &&
|    |2107|+								 ((type.generic == "treasure" && oldType.generic == "treasure")
|2108|2108| 								 || (type.specific == oldType.specific
|2109|2109| 								 && (type.specific != "meat" || oldTemplate == template)))
|2110|2110| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2104|2104| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2105|2105| 							return (
|2106|2106| 								ent != oldTarget
|2107|    |-								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2108|    |-								 || (type.specific == oldType.specific
|    |2107|+								 && ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2108|+								 (type.specific == oldType.specific
|2109|2109| 								 && (type.specific != "meat" || oldTemplate == template)))
|2110|2110| 							);
|2111|2111| 						}, oldTarget);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2105|2105| 							return (
|2106|2106| 								ent != oldTarget
|2107|2107| 								 && ((type.generic == "treasure" && oldType.generic == "treasure")
|2108|    |-								 || (type.specific == oldType.specific
|2109|    |-								 && (type.specific != "meat" || oldTemplate == template)))
|    |2108|+								 || (type.specific == oldType.specific &&
|    |2109|+								 (type.specific != "meat" || oldTemplate == template)))
|2110|2110| 							);
|2111|2111| 						}, oldTarget);
|2112|2112| 						if (nearby)
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2114|2114| 							this.PerformGather(nearby, false, false);
|2115|2115| 							return true;
|2116|2116| 						}
|2117|    |-						else
|2118|    |-						{
|    |2117|+						
|2119|2118| 							// It's probably better in this case, to avoid units getting stuck around a dropsite
|2120|2119| 							// in a "Target is far away, full, nearby are no good resources, return to dropsite" loop
|2121|2120| 							// to order it to GatherNear the resource position.
|2136|2135| 									return true;
|2137|2136| 								}
|2138|2137| 							}
|2139|    |-						}
|    |2138|+						
|2140|2139| 						return true;
|2141|2140| 					}
|2142|2141| 					return false;
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2126|2126| 								this.GatherNearPosition(pos.x, pos.z, oldType, oldTemplate);
|2127|2127| 								return true;
|2128|2128| 							}
|2129|    |-							else
|2130|    |-							{
|    |2129|+							
|2131|2130| 								// we're kind of stuck here. Return resource.
|2132|2131| 								var nearby = this.FindNearestDropsite(oldType.generic);
|2133|2132| 								if (nearby)
|2135|2134| 									this.PushOrderFront("ReturnResource", { "target": nearby, "force": false });
|2136|2135| 									return true;
|2137|2136| 								}
|2138|    |-							}
|    |2137|+							
|2139|2138| 						}
|2140|2139| 						return true;
|2141|2140| 					}
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2166|2166| 
|2167|2167| 						// Try to find another nearby target of the same specific type
|2168|2168| 						// Also don't switch to a different type of huntable animal
|2169|    |-						var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2169|+						var nearby = this.FindNearbyResource(function(ent, type, template) {
|2170|2170| 							return (
|2171|2171| 								ent != oldTarget
|2172|2172| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2168|2168| 						// Also don't switch to a different type of huntable animal
|2169|2169| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2170|2170| 							return (
|2171|    |-								ent != oldTarget
|2172|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|    |2171|+								ent != oldTarget &&
|    |2172|+								((type.generic == "treasure" && oldType.generic == "treasure")
|2173|2173| 								|| (type.specific == oldType.specific
|2174|2174| 								&& (type.specific != "meat" || oldTemplate == template)))
|2175|2175| 							);
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2169|2169| 						var nearby = this.FindNearbyResource(function (ent, type, template) {
|2170|2170| 							return (
|2171|2171| 								ent != oldTarget
|2172|    |-								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2173|    |-								|| (type.specific == oldType.specific
|    |2172|+								&& ((type.generic == "treasure" && oldType.generic == "treasure") ||
|    |2173|+								(type.specific == oldType.specific
|2174|2174| 								&& (type.specific != "meat" || oldTemplate == template)))
|2175|2175| 							);
|2176|2176| 						});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2170|2170| 							return (
|2171|2171| 								ent != oldTarget
|2172|2172| 								&& ((type.generic == "treasure" && oldType.generic == "treasure")
|2173|    |-								|| (type.specific == oldType.specific
|2174|    |-								&& (type.specific != "meat" || oldTemplate == template)))
|    |2173|+								|| (type.specific == oldType.specific &&
|    |2174|+								(type.specific != "meat" || oldTemplate == template)))
|2175|2175| 							);
|2176|2176| 						});
|2177|2177| 						if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2212|2212| 
|2213|2213| 					// Try to find another nearby target of the same specific type
|2214|2214| 					// Also don't switch to a different type of huntable animal
|2215|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2215|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2216|2216| 						return (
|2217|2217| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2218|2218| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2214|2214| 					// Also don't switch to a different type of huntable animal
|2215|2215| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2216|2216| 						return (
|2217|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2218|    |-							|| (type.specific == resourceType.specific
|    |2217|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2218|+							(type.specific == resourceType.specific
|2219|2219| 							&& (type.specific != "meat" || resourceTemplate == template))
|2220|2220| 						);
|2221|2221| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2215|2215| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2216|2216| 						return (
|2217|2217| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2218|    |-							|| (type.specific == resourceType.specific
|2219|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2218|+							|| (type.specific == resourceType.specific &&
|    |2219|+							(type.specific != "meat" || resourceTemplate == template))
|2220|2220| 						);
|2221|2221| 					});
|2222|2222| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2331|2331| 
|2332|2332| 					var cmpSupply = Engine.QueryInterface(this.gatheringTarget, IID_ResourceSupply);
|2333|2333| 					if (cmpSupply && cmpSupply.IsAvailable(cmpOwnership.GetOwner(), this.entity))
|2334|    |-					{
|    |2334|+					
|2335|2335| 						// Check we can still reach and gather from the target
|2336|2336| 						if (this.CheckTargetRange(this.gatheringTarget, IID_ResourceGatherer) && this.CanGather(this.gatheringTarget))
|2337|2337| 						{
|2397|2397| 								return;
|2398|2398| 							}
|2399|2399| 						}
|2400|    |-					}
|    |2400|+					
|2401|2401| 
|2402|2402| 					// We're already in range, can't get anywhere near it or the target is exhausted.
|2403|2403| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2421|2421| 
|2422|2422| 					// Try to find a new resource of the same specific type near our current position:
|2423|2423| 					// Also don't switch to a different type of huntable animal
|2424|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2424|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2425|2425| 						return (
|2426|2426| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2427|2427| 							|| (type.specific == resourceType.specific
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2423|2423| 					// Also don't switch to a different type of huntable animal
|2424|2424| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2425|2425| 						return (
|2426|    |-							(type.generic == "treasure" && resourceType.generic == "treasure")
|2427|    |-							|| (type.specific == resourceType.specific
|    |2426|+							(type.generic == "treasure" && resourceType.generic == "treasure") ||
|    |2427|+							(type.specific == resourceType.specific
|2428|2428| 							&& (type.specific != "meat" || resourceTemplate == template))
|2429|2429| 						);
|2430|2430| 					});
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '&&' should be placed at the end of the line.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2424|2424| 					var nearby = this.FindNearbyResource(function (ent, type, template) {
|2425|2425| 						return (
|2426|2426| 							(type.generic == "treasure" && resourceType.generic == "treasure")
|2427|    |-							|| (type.specific == resourceType.specific
|2428|    |-							&& (type.specific != "meat" || resourceTemplate == template))
|    |2427|+							|| (type.specific == resourceType.specific &&
|    |2428|+							(type.specific != "meat" || resourceTemplate == template))
|2429|2429| 						);
|2430|2430| 					});
|2431|2431| 					if (nearby)
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2465|2465| 			},
|2466|2466| 
|2467|2467| 			"APPROACHING": {
|2468|    |-				"enter": function () {
|    |2468|+				"enter": function() {
|2469|2469| 					this.SelectAnimation("move");
|2470|2470| 					this.StartTimer(1000, 1000);
|2471|2471| 				},
|    | [NORMAL] ESLintBear (no-unneeded-ternary):
|    | Unnecessary use of boolean literals in conditional expression.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2511|2511| 					this.StartTimer(prepare, this.healTimers.repeat);
|2512|2512| 
|2513|2513| 					// If using a non-default prepare time, re-sync the animation when the timer runs.
|2514|    |-					this.resyncAnimation = (prepare != this.healTimers.prepare) ? true : false;
|    |2514|+					this.resyncAnimation = (prepare != this.healTimers.prepare);
|2515|2515| 
|2516|2516| 					this.FaceTowardsTarget(this.order.data.target);
|2517|2517| 				},
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2544|2544| 						}
|2545|2545| 						// Can't reach it - try to chase after it
|2546|2546| 						if (this.ShouldChaseTargetedEntity(target, this.order.data.force))
|2547|    |-						{
|    |2547|+						
|2548|2548| 							if (this.MoveToTargetRange(target, IID_Heal))
|2549|2549| 							{
|2550|2550| 								this.SetNextState("HEAL.CHASING");
|2551|2551| 								return;
|2552|2552| 							}
|2553|    |-						}
|    |2553|+						
|2554|2554| 					}
|2555|2555| 					// Can't reach it, healed to max hp or doesn't exist any more - give up
|2556|2556| 					if (this.FinishOrder())
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2566|2566| 				},
|2567|2567| 			},
|2568|2568| 			"CHASING": {
|2569|    |-				"enter": function () {
|    |2569|+				"enter": function() {
|2570|2570| 					this.SelectAnimation("move");
|2571|2571| 					this.StartTimer(1000, 1000);
|2572|2572| 				},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2571|2571| 					this.StartTimer(1000, 1000);
|2572|2572| 				},
|2573|2573| 
|2574|    |-				"leave": function () {
|    |2574|+				"leave": function() {
|2575|2575| 					this.StopTimer();
|2576|2576| 				},
|2577|2577| 				"Timer": function(msg) {
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2585|2585| 							this.WalkToHeldPosition();
|2586|2586| 					}
|2587|2587| 				},
|2588|    |-				"MoveCompleted": function () {
|    |2588|+				"MoveCompleted": function() {
|2589|2589| 					this.SetNextState("HEALING");
|2590|2590| 				},
|2591|2591| 			},
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2594|2594| 		// Returning to dropsite
|2595|2595| 		"RETURNRESOURCE": {
|2596|2596| 			"APPROACHING": {
|2597|    |-				"enter": function () {
|    |2597|+				"enter": function() {
|2598|2598| 					this.SelectAnimation("move");
|2599|2599| 				},
|2600|2600| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2652|2652| 			},
|2653|2653| 
|2654|2654| 			"APPROACHINGMARKET": {
|2655|    |-				"enter": function () {
|    |2655|+				"enter": function() {
|2656|2656| 					this.SelectAnimation("move");
|2657|2657| 				},
|2658|2658| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2680|2680| 
|2681|2681| 		"REPAIR": {
|2682|2682| 			"APPROACHING": {
|2683|    |-				"enter": function () {
|    |2683|+				"enter": function() {
|2684|2684| 					this.SelectAnimation("move");
|2685|2685| 				},
|2686|2686| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2721|2721| 					{
|2722|2722| 						// The building was already finished/fully repaired before we arrived;
|2723|2723| 						// let the ConstructionFinished handler handle this.
|2724|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2724|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2725|2725| 						return true;
|2726|2726| 					}
|2727|2727| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required before '}'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2721|2721| 					{
|2722|2722| 						// The building was already finished/fully repaired before we arrived;
|2723|2723| 						// let the ConstructionFinished handler handle this.
|2724|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2724|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2725|2725| 						return true;
|2726|2726| 					}
|2727|2727| 
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2761|2761| 					if (this.MoveToTargetRange(this.repairTarget, IID_Builder))
|2762|2762| 						this.SetNextState("APPROACHING");
|2763|2763| 					else if (!this.CheckTargetRange(this.repairTarget, IID_Builder))
|2764|    |-						this.FinishOrder(); //can't approach and isn't in reach
|    |2764|+						this.FinishOrder(); // can't approach and isn't in reach
|2765|2765| 				},
|2766|2766| 			},
|2767|2767| 
|    | [NORMAL] ESLintBear (space-before-function-paren):
|    | Unexpected space before function parentheses.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2828|2828| 					var types = cmpResourceDropsite.GetTypes();
|2829|2829| 					// TODO: Slightly undefined behavior here, we don't know what type of resource will be collected,
|2830|2830| 					//   may cause problems for AIs (especially hunting fast animals), but avoid ugly hacks to fix that!
|2831|    |-					var nearby = this.FindNearbyResource(function (ent, type, template) {
|    |2831|+					var nearby = this.FindNearbyResource(function(ent, type, template) {
|2832|2832| 						return (types.indexOf(type.generic) != -1);
|2833|2833| 					}, msg.data.newentity);
|2834|2834| 					if (nearby)
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2848|2848| 
|2849|2849| 				// Unit was approaching and there's nothing to do now, so switch to walking
|2850|2850| 				if (oldState === "INDIVIDUAL.REPAIR.APPROACHING")
|2851|    |-				{
|    |2851|+				
|2852|2852| 					// We're already walking to the given point, so add this as a order.
|2853|2853| 					this.WalkToTarget(msg.data.newentity, true);
|2854|    |-				}
|    |2854|+				
|2855|2855| 			},
|2856|2856| 		},
|2857|2857| 
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|2898|2898| 
|2899|2899| 					// Check that we can garrison here
|2900|2900| 					if (this.CanGarrison(target))
|2901|    |-					{
|    |2901|+					
|2902|2902| 						// Check that we're in range of the garrison target
|2903|2903| 						if (this.CheckGarrisonRange(target))
|2904|2904| 						{
|2974|2974| 								return false;
|2975|2975| 							}
|2976|2976| 						}
|2977|    |-					}
|    |2977|+					
|2978|2978| 					// Garrisoning failed for some reason, so finish the order
|2979|2979| 					this.FinishOrder();
|2980|2980| 					return true;
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3091|3091| 		"Attacked": function(msg) {
|3092|3092| 			if (this.template.NaturalBehaviour == "skittish" ||
|3093|3093| 			    this.template.NaturalBehaviour == "passive")
|3094|    |-			{
|    |3094|+			
|3095|3095| 				this.Flee(msg.data.attacker, false);
|3096|    |-			}
|    |3096|+			
|3097|3097| 			else if (this.IsDangerousAnimal() || this.template.NaturalBehaviour == "defensive")
|3098|3098| 			{
|3099|3099| 				if (this.CanAttack(msg.data.attacker))
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3100|3100| 					this.Attack(msg.data.attacker, false);
|3101|3101| 			}
|3102|3102| 			else if (this.template.NaturalBehaviour == "domestic")
|3103|    |-			{
|    |3103|+			
|3104|3104| 				// Never flee, stop what we were doing
|3105|3105| 				this.SetNextState("IDLE");
|3106|    |-			}
|    |3106|+			
|3107|3107| 		},
|3108|3108| 
|3109|3109| 		"Order.LeaveFoundation": function(msg) {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3110|3110| 			// Move a tile outside the building
|3111|3111| 			var range = 4;
|3112|3112| 			if (this.MoveToTargetRangeExplicit(msg.data.target, range, range))
|3113|    |-			{
|    |3113|+			
|3114|3114| 				// We've started walking to the given point
|3115|3115| 				this.SetNextState("WALKING");
|3116|    |-			}
|    |3116|+			
|3117|3117| 			else
|3118|3118| 			{
|3119|3119| 				// We are already at the target, or can't move at all
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'else'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3115|3115| 				this.SetNextState("WALKING");
|3116|3116| 			}
|3117|3117| 			else
|3118|    |-			{
|    |3118|+			
|3119|3119| 				// We are already at the target, or can't move at all
|3120|3120| 				this.FinishOrder();
|3121|    |-			}
|    |3121|+			
|3122|3122| 		},
|3123|3123| 
|3124|3124| 		"IDLE": {
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3157|3157| 				}
|3158|3158| 				// Start attacking one of the newly-seen enemy (if any)
|3159|3159| 				else if (this.IsDangerousAnimal())
|3160|    |-				{
|    |3160|+				
|3161|3161| 					this.AttackVisibleEntity(msg.data.added);
|3162|    |-				}
|    |3162|+				
|3163|3163| 
|3164|3164| 				// TODO: if two units enter our range together, we'll attack the
|3165|3165| 				// first and then the second won't trigger another LosRangeUpdate
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3200|3200| 				}
|3201|3201| 				// Start attacking one of the newly-seen enemy (if any)
|3202|3202| 				else if (this.template.NaturalBehaviour == "violent")
|3203|    |-				{
|    |3203|+				
|3204|3204| 					this.AttackVisibleEntity(msg.data.added);
|3205|    |-				}
|    |3205|+				
|3206|3206| 			},
|3207|3207| 
|3208|3208| 			"MoveCompleted": function() { },
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 7.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/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.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3281|3281| 
|3282|3282| UnitAI.prototype.IsAnimal = function()
|3283|3283| {
|3284|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3284|+	return (!!this.template.NaturalBehaviour);
|3285|3285| };
|3286|3286| 
|3287|3287| UnitAI.prototype.IsDangerousAnimal = function()
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'if' condition.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3319|3319| UnitAI.prototype.GetGarrisonHolder = function()
|3320|3320| {
|3321|3321| 	if (this.IsGarrisoned())
|3322|    |-	{
|    |3322|+	
|3323|3323| 		for (let order of this.orderQueue)
|3324|3324| 			if (order.type == "Garrison" || order.type == "Autogarrison")
|3325|3325| 				return order.data.target;
|3326|    |-	}
|    |3326|+	
|3327|3327| 	return INVALID_ENTITY;
|3328|3328| };
|3329|3329| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|3400|3400| 		{
|3401|3401| 			let index = this.GetCurrentState().indexOf(".");
|3402|3402| 			if (index != -1)
|3403|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3403|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3404|3404| 			this.Stop(false);
|3405|3405| 		}
|3406|3406| 
|    | [NORMAL] ESLintBear (object-curly-spacing):
|    | A space is required after '{'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binar

Link to build: https://jenkins.wildfiregames.com/job/phabricator_lint/1014/display/redirect

Partly related, @ffffffff suggests graying out hero icons when they're garrisoned.

In D1268#56891, @temple wrote:

Partly related, @ffffffff suggests graying out hero icons when they're garrisoned.

and or grouped units as they are also iconed

bb requested changes to this revision.Mar 19 2018, 9:13 PM

(one could add a test here and there with units without health components)

missing cmpHealth checks (not counting damage and armour):
GarrisonHolder.HasEnoughHealth
Repairable.GetRepairRate (probably not required since how you can repai something without health?)
Foundation.GetBuildRate (probably same)
Promotion.promote (twice)

Not sure but can we also get rid of that armour component with this?

binaries/data/mods/public/gui/session/session.js
916

I kindof need to agree with elexis here as removing such contents is bad for modding, it did be good to have a updateGUIStatusBar function around with the functionality of the current capture bar (notice that the health bar is just a two players capture bar in a way), so it can be called from anywhere in the gui (perhaps experience could use it too dunno)

1092

"changed" can also mean "increase" not just "decrease"
(we could have some healing blink but meh)
also "the animation" sounds vague

binaries/data/mods/public/gui/session/session_objects/panel_entities.xml
17–36

wondering if at some point those bars could share some code, but that is for another patch

30

hmm hardcoding player count, they should be everywhere in code I guess, but out of scope

binaries/data/mods/public/gui/session/unit_actions.js
202

this one might get removed aswell in the secondary attacks, need to see. at least upper one is correct as it will be checked for in CanCapture (called from cmpAttack.CanAttack)

binaries/data/mods/public/simulation/components/UnitAI.js
393–394

those checks seem unneeded here since they will be checked in the CanAttack call aswell right?

1149

(unitAI is a big bulky duplicate check machine: we need cleanup)

3980–3981

could be merged with the check above

4001

I have some unsubmitted patches in that direction for the secondary attacks...

This revision now requires changes to proceed.Mar 19 2018, 9:13 PM
elexis added inline comments.Mar 19 2018, 10:20 PM
binaries/data/mods/public/gui/session/session.js
916

The only removed feature is the direction. IMO ok to remove it, but we should say that it's a decision to drop support for that as it's unlikely to be used by mods and not exclusively laziness that we try not to mention.

1092

(I think I saw that somewhere already blinking when being healed for the duration of one blink. Might be mistaken.)

elexis added inline comments.Apr 20 2018, 2:49 PM
binaries/data/mods/public/gui/session/session.js
965

(Using the same variable name in XML and JS allows more text searches and less reader memory, but in this case it might be ok as the XML word is quite long.)

967

Should only return when both are false, right?
The early return can be removed, doesn't add anything significant.
It looks like we could have two independent functions, or even better one function being called with few arguments (gui name, entity state percent, ..).

1001
  • Is this large enough for a global function? We don't define local functions too often as keeping the nesting down has advantages like excluding the possibility of referencing variables defined outside of the function scope without a g_ prefix. (Eventually we should have a more object-oriented JS GUI ordering rather than everything of the entire session gui in one giant scope)
  • It looks like we can remove the rright redundancy if this function is called for both sections.
binaries/data/mods/public/gui/session/session_objects/panel_entities.xml
17–36

Since that's what the JS code should do too, we might get away with less code here too by adding just one more repeat node.

30

XML being a markup language prevents us from using variables afaics.

binaries/data/mods/public/simulation/components/Attack.js
590 ↗(On Diff #5743)

(Changes in this file accepted)

602 ↗(On Diff #5743)

(!hitpoints if you want) (agree to do this early return first)

(Was wondering if it would make sense to do some let maxHealth = cmpHealth && cmpHealth.GetMaxHitpoints(); if (!maxHealth) return; pattern but that only benefitted with the previous logic)

605 ↗(On Diff #5743)

(good to inline the multipliers)

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

Can we reduce duplication introduction by doing the TargetIsAlive and CheckTargetVisible check in TargetIsCapturable?

3980–3981

Seems easier to read the current way and conditionally avoids one cmp getter.

binaries/data/mods/public/simulation/templates/template_unit_catafalque.xml
13

(We need this badly for gaia maps)

maybe sort relicts hero by player owned?

Freagarach updated this revision to Diff 10079.Oct 5 2019, 9:17 AM
Freagarach retitled this revision from Remove health component from relics to Remove health component from relics..
Freagarach added a reviewer: Restricted Owners Package.
Freagarach added a subscriber: Freagarach.

Rebased.

Owners added a subscriber: Restricted Owners Package.Oct 5 2019, 9:17 AM
Vulcan added a comment.Oct 5 2019, 9:21 AM

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

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

Vulcan added a comment.Oct 5 2019, 9:25 AM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|  18|  18| 	this.cp = [];
|  19|  19| };
|  20|  20| 
|  21|    |-//// Interface functions ////
|    |  21|+// // Interface functions ////
|  22|  22| 
|  23|  23| /**
|  24|  24|  * Returns the current capture points array
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 149| 149| 	return sourceEnemyCp > 0;
| 150| 150| };
| 151| 151| 
| 152|    |-//// Private functions ////
|    | 152|+// // Private functions ////
| 153| 153| 
| 154| 154| /**
| 155| 155|  * This has to be called whenever the capture points are changed.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 264| 264| 	Engine.PostMessage(this.entity, MT_CaptureRegenStateChanged, { "regenerating": true, "regenRate": regenRate, "territoryDecay": decay });
| 265| 265| };
| 266| 266| 
| 267|    |-//// Message Listeners ////
|    | 267|+// // Message Listeners ////
| 268| 268| 
| 269| 269| Capturable.prototype.OnValueModification = function(msg)
| 270| 270| {

binaries/data/mods/public/simulation/components/Capturable.js
| 196| »   »   var·garrisonRegenRate·=·0;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' is already defined.

binaries/data/mods/public/simulation/components/Capturable.js
| 198| »   return·regenRate·+·garrisonRegenRate;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' used out of scope.

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 392| 392| 				// Players see colors depending on diplomacy
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 395|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 396|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397|    |-					getDiplomacyColor("enemy");
|    | 397|+								getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 400| 400| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 656| 656| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 657| 657| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 658| 658| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 659|    |-			});
|    | 659|+				});
| 660| 660| 	}
| 661| 661| 
| 662| 662| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1269|1269| 
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1272|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1273|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|    |-	});
|    |1274|+		});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|1277|1277| 	for (let r = 0; r < resCodes.length; ++r)

binaries/data/mods/public/gui/session/session.js
|1123| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1205| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1206| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1207| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [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
| 755| 755| 					this.FinishOrder();
| 756| 756| 					return;
| 757| 757| 				}
| 758|    |-				else
| 759|    |-				{
|    | 758|+				
| 760| 759| 					this.SetNextState("GARRISON.APPROACHING");
| 761| 760| 					return;
| 762|    |-				}
|    | 761|+				
| 763| 762| 			}
| 764| 763| 
| 765| 764| 			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
|1023|1023| 			},
|1024|1024| 		},
|1025|1025| 
|1026|    |-		"GARRISON":{
|    |1026|+		"GARRISON": {
|1027|1027| 			"enter": function() {
|1028|1028| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1029|1029| 				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
|1974|1974| 
|1975|1975| 				"Attacked": function(msg) {
|1976|1976| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1977|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1978|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1977|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1978|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1979|1979| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1980|1980| 				},
|1981|1981| 			},
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|3215|3215| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3216|3216| 
|3217|3217| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3218|    |-							// only used for domestic animals
|    |3218|+		// only used for domestic animals
|3219|3219| 	},
|3220|3220| };
|3221|3221| 
|    | [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
|3272|3272| 
|3273|3273| UnitAI.prototype.IsAnimal = function()
|3274|3274| {
|3275|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3275|+	return (!!this.template.NaturalBehaviour);
|3276|3276| };
|3277|3277| 
|3278|3278| 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
|3388|3388| 		{
|3389|3389| 			let index = this.GetCurrentState().indexOf(".");
|3390|3390| 			if (index != -1)
|3391|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3391|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3392|3392| 			this.Stop(false);
|3393|3393| 		}
|3394|3394| 
|    | [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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3528|3528| };
|3529|3529| 
|3530|3530| 
|3531|    |-//// FSM linkage functions ////
|    |3531|+// // FSM linkage functions ////
|3532|3532| 
|3533|3533| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3534|3534| 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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3965|3965| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|    |-//// Helper functions to be called by the FSM ////
|    |3968|+// // Helper functions to be called by the FSM ////
|3969|3969| 
|3970|3970| UnitAI.prototype.GetWalkSpeed = function()
|3971|3971| {
|    | [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
|4634|4634| UnitAI.prototype.AttackEntityInZone = function(ents)
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|    |-		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4637|+		this.CanAttack(target) &&
|    |4638|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|4639| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	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
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|4637| 		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4638|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4639|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	if (!target)
|4642|4642| 		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
|4699|4699| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4700|4700| 	if (this.isGuardOf)
|4701|4701| 	{
|4702|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4702|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    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
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4706|    |-				return false;
|    |4706|+			return false;
|4707|4707| 	}
|4708|4708| 
|4709|4709| 	// 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
|4741|4741| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4742|4742| 	if (this.isGuardOf)
|4743|4743| 	{
|4744|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4744|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4745|4745| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4746|4746| 		if (cmpUnitAI && cmpAttack &&
|4747|4747| 		    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
|4754|4754| 	return false;
|4755|4755| };
|4756|4756| 
|4757|    |-//// External interface functions ////
|    |4757|+// // External interface functions ////
|4758|4758| 
|4759|4759| UnitAI.prototype.SetFormationController = function(ent)
|4760|4760| {
|    | [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
|4910|4910| 	{
|4911|4911| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4912|4912| 			return;
|4913|    |-		else
|4914|    |-			this.RemoveGuard();
|    |4913|+		this.RemoveGuard();
|4915|4914| 	}
|4916|4915| 
|4917|4916| 	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
|5242|5242| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5243|5243| 	{
|5244|5244| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5245|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5245|+		if (cmpTrader.HasBothMarkets() &&
|5246|5246| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5247|5247| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5248|5248| 		{
|    | [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
|5523|5523| 				{
|5524|5524| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5525|5525| 					var targetClasses = this.order.data.targetClasses;
|5526|    |-					if (targetClasses.attack && cmpIdentity
|5527|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5526|+					if (targetClasses.attack && cmpIdentity &&
|    |5527|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|5529| 					if (targetClasses.avoid && cmpIdentity
|5530|5530| 						&& 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
|5526|5526| 					if (targetClasses.attack && cmpIdentity
|5527|5527| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|    |-					if (targetClasses.avoid && cmpIdentity
|5530|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5529|+					if (targetClasses.avoid && cmpIdentity &&
|    |5530|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5531|5531| 						continue;
|5532|5532| 					// Only used by the AIs to prevent some choices of targets
|5533|5533| 					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
|5549|5549| 		{
|5550|5550| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5551|5551| 			var targetClasses = this.order.data.targetClasses;
|5552|    |-			if (cmpIdentity && targetClasses.attack
|5553|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5552|+			if (cmpIdentity && targetClasses.attack &&
|    |5553|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|5555| 			if (cmpIdentity && targetClasses.avoid
|5556|5556| 				&& 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
|5552|5552| 			if (cmpIdentity && targetClasses.attack
|5553|5553| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|    |-			if (cmpIdentity && targetClasses.avoid
|5556|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5555|+			if (cmpIdentity && targetClasses.avoid &&
|    |5556|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5557|5557| 				continue;
|5558|5558| 			// Only used by the AIs to prevent some choices of targets
|5559|5559| 			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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = { "x": x, "z": z};
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = {"x": x, "z": z };
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5736|5736| 	return false;
|5737|5737| };
|5738|5738| 
|5739|    |-//// Helper functions ////
|    |5739|+// // Helper functions ////
|5740|5740| 
|5741|5741| UnitAI.prototype.CanAttack = function(target)
|5742|5742| {
|    | [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
|5940|5940| 	return cmpPack && cmpPack.IsPacking();
|5941|5941| };
|5942|5942| 
|5943|    |-//// Formation specific functions ////
|    |5943|+// // Formation specific functions ////
|5944|5944| 
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|    | [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
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|5947|5947| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5948|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5949|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5948|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5949|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|5952| //// 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
|5949|5949| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|    |-//// Animal specific functions ////
|    |5952|+// // Animal specific functions ////
|5953|5953| 
|5954|5954| UnitAI.prototype.MoveRandomly = function(distance)
|5955|5955| {

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
| 910| »   »   »   "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
| 935| »   »   »   "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
| 985| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1048| »   »   »   »   "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
|1084| »   »   »   "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
|1116| »   »   »   »   "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
|1276| »   »   "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
|1333| »   »   »   "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
|1508| »   »   »   "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
|1530| »   »   »   "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
|1562| »   »   »   "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
|1718| »   »   »   "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
|1768| »   »   »   »   "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
|1846| »   »   »   »   "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
|2023| »   »   »   »   "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
|2139| »   »   »   »   "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
|2414| »   »   »   »   "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
|2447| »   »   »   »   "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
|2553| »   »   »   »   "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
|2619| »   »   »   »   "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
|2658| »   »   »   »   "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
|2869| »   »   »   »   "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
|3050| »   »   »   »   "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
|3774| »   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
|4621| »   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
|4636| »   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
|4682| »   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
|4705| »   »   ····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
|1978| »   »   »   »   »   »   &&·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
|3736| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4638| »   »   &&·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
|4639| »   »   &&·(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
|5527| »   »   »   »   »   »   &&·!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
|5530| »   »   »   »   »   »   &&·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
|5543| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5553| »   »   »   »   &&·!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
|5556| »   »   »   »   &&·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
|5631| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5949| »   »   &&·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/918/display/redirect

Freagarach updated this revision to Diff 10131.Oct 12 2019, 6:45 PM
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)

Combined a check in updatePanelEntityBars in session.js.

Freagarach commandeered this revision.Oct 12 2019, 6:45 PM
Freagarach edited the test plan for this revision. (Show Details)
Freagarach added a reviewer: temple.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|  18|  18| 	this.cp = [];
|  19|  19| };
|  20|  20| 
|  21|    |-//// Interface functions ////
|    |  21|+// // Interface functions ////
|  22|  22| 
|  23|  23| /**
|  24|  24|  * Returns the current capture points array
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 149| 149| 	return sourceEnemyCp > 0;
| 150| 150| };
| 151| 151| 
| 152|    |-//// Private functions ////
|    | 152|+// // Private functions ////
| 153| 153| 
| 154| 154| /**
| 155| 155|  * This has to be called whenever the capture points are changed.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 264| 264| 	Engine.PostMessage(this.entity, MT_CaptureRegenStateChanged, { "regenerating": true, "regenRate": regenRate, "territoryDecay": decay });
| 265| 265| };
| 266| 266| 
| 267|    |-//// Message Listeners ////
|    | 267|+// // Message Listeners ////
| 268| 268| 
| 269| 269| Capturable.prototype.OnValueModification = function(msg)
| 270| 270| {

binaries/data/mods/public/simulation/components/Capturable.js
| 196| »   »   var·garrisonRegenRate·=·0;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' is already defined.

binaries/data/mods/public/simulation/components/Capturable.js
| 198| »   return·regenRate·+·garrisonRegenRate;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' used out of scope.

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 392| 392| 				// Players see colors depending on diplomacy
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 395|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 396|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397|    |-					getDiplomacyColor("enemy");
|    | 397|+								getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 400| 400| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 656| 656| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 657| 657| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 658| 658| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 659|    |-			});
|    | 659|+				});
| 660| 660| 	}
| 661| 661| 
| 662| 662| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1269|1269| 
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1272|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1273|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|    |-	});
|    |1274|+		});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|1277|1277| 	for (let r = 0; r < resCodes.length; ++r)

binaries/data/mods/public/gui/session/session.js
|1123| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1205| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1206| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1207| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [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
| 755| 755| 					this.FinishOrder();
| 756| 756| 					return;
| 757| 757| 				}
| 758|    |-				else
| 759|    |-				{
|    | 758|+				
| 760| 759| 					this.SetNextState("GARRISON.APPROACHING");
| 761| 760| 					return;
| 762|    |-				}
|    | 761|+				
| 763| 762| 			}
| 764| 763| 
| 765| 764| 			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
|1023|1023| 			},
|1024|1024| 		},
|1025|1025| 
|1026|    |-		"GARRISON":{
|    |1026|+		"GARRISON": {
|1027|1027| 			"enter": function() {
|1028|1028| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1029|1029| 				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
|1974|1974| 
|1975|1975| 				"Attacked": function(msg) {
|1976|1976| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1977|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1978|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1977|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1978|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1979|1979| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1980|1980| 				},
|1981|1981| 			},
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|3215|3215| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3216|3216| 
|3217|3217| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3218|    |-							// only used for domestic animals
|    |3218|+		// only used for domestic animals
|3219|3219| 	},
|3220|3220| };
|3221|3221| 
|    | [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
|3272|3272| 
|3273|3273| UnitAI.prototype.IsAnimal = function()
|3274|3274| {
|3275|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3275|+	return (!!this.template.NaturalBehaviour);
|3276|3276| };
|3277|3277| 
|3278|3278| 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
|3388|3388| 		{
|3389|3389| 			let index = this.GetCurrentState().indexOf(".");
|3390|3390| 			if (index != -1)
|3391|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3391|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3392|3392| 			this.Stop(false);
|3393|3393| 		}
|3394|3394| 
|    | [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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3528|3528| };
|3529|3529| 
|3530|3530| 
|3531|    |-//// FSM linkage functions ////
|    |3531|+// // FSM linkage functions ////
|3532|3532| 
|3533|3533| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3534|3534| 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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3965|3965| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|    |-//// Helper functions to be called by the FSM ////
|    |3968|+// // Helper functions to be called by the FSM ////
|3969|3969| 
|3970|3970| UnitAI.prototype.GetWalkSpeed = function()
|3971|3971| {
|    | [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
|4634|4634| UnitAI.prototype.AttackEntityInZone = function(ents)
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|    |-		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4637|+		this.CanAttack(target) &&
|    |4638|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|4639| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	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
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|4637| 		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4638|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4639|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	if (!target)
|4642|4642| 		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
|4699|4699| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4700|4700| 	if (this.isGuardOf)
|4701|4701| 	{
|4702|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4702|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    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
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4706|    |-				return false;
|    |4706|+			return false;
|4707|4707| 	}
|4708|4708| 
|4709|4709| 	// 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
|4741|4741| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4742|4742| 	if (this.isGuardOf)
|4743|4743| 	{
|4744|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4744|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4745|4745| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4746|4746| 		if (cmpUnitAI && cmpAttack &&
|4747|4747| 		    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
|4754|4754| 	return false;
|4755|4755| };
|4756|4756| 
|4757|    |-//// External interface functions ////
|    |4757|+// // External interface functions ////
|4758|4758| 
|4759|4759| UnitAI.prototype.SetFormationController = function(ent)
|4760|4760| {
|    | [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
|4910|4910| 	{
|4911|4911| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4912|4912| 			return;
|4913|    |-		else
|4914|    |-			this.RemoveGuard();
|    |4913|+		this.RemoveGuard();
|4915|4914| 	}
|4916|4915| 
|4917|4916| 	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
|5242|5242| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5243|5243| 	{
|5244|5244| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5245|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5245|+		if (cmpTrader.HasBothMarkets() &&
|5246|5246| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5247|5247| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5248|5248| 		{
|    | [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
|5523|5523| 				{
|5524|5524| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5525|5525| 					var targetClasses = this.order.data.targetClasses;
|5526|    |-					if (targetClasses.attack && cmpIdentity
|5527|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5526|+					if (targetClasses.attack && cmpIdentity &&
|    |5527|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|5529| 					if (targetClasses.avoid && cmpIdentity
|5530|5530| 						&& 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
|5526|5526| 					if (targetClasses.attack && cmpIdentity
|5527|5527| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|    |-					if (targetClasses.avoid && cmpIdentity
|5530|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5529|+					if (targetClasses.avoid && cmpIdentity &&
|    |5530|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5531|5531| 						continue;
|5532|5532| 					// Only used by the AIs to prevent some choices of targets
|5533|5533| 					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
|5549|5549| 		{
|5550|5550| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5551|5551| 			var targetClasses = this.order.data.targetClasses;
|5552|    |-			if (cmpIdentity && targetClasses.attack
|5553|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5552|+			if (cmpIdentity && targetClasses.attack &&
|    |5553|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|5555| 			if (cmpIdentity && targetClasses.avoid
|5556|5556| 				&& 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
|5552|5552| 			if (cmpIdentity && targetClasses.attack
|5553|5553| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|    |-			if (cmpIdentity && targetClasses.avoid
|5556|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5555|+			if (cmpIdentity && targetClasses.avoid &&
|    |5556|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5557|5557| 				continue;
|5558|5558| 			// Only used by the AIs to prevent some choices of targets
|5559|5559| 			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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = { "x": x, "z": z};
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = {"x": x, "z": z };
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5736|5736| 	return false;
|5737|5737| };
|5738|5738| 
|5739|    |-//// Helper functions ////
|    |5739|+// // Helper functions ////
|5740|5740| 
|5741|5741| UnitAI.prototype.CanAttack = function(target)
|5742|5742| {
|    | [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
|5940|5940| 	return cmpPack && cmpPack.IsPacking();
|5941|5941| };
|5942|5942| 
|5943|    |-//// Formation specific functions ////
|    |5943|+// // Formation specific functions ////
|5944|5944| 
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|    | [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
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|5947|5947| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5948|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5949|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5948|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5949|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|5952| //// 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
|5949|5949| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|    |-//// Animal specific functions ////
|    |5952|+// // Animal specific functions ////
|5953|5953| 
|5954|5954| UnitAI.prototype.MoveRandomly = function(distance)
|5955|5955| {

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
| 910| »   »   »   "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
| 935| »   »   »   "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
| 985| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1048| »   »   »   »   "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
|1084| »   »   »   "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
|1116| »   »   »   »   "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
|1276| »   »   "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
|1333| »   »   »   "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
|1508| »   »   »   "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
|1530| »   »   »   "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
|1562| »   »   »   "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
|1718| »   »   »   "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
|1768| »   »   »   »   "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
|1846| »   »   »   »   "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
|2023| »   »   »   »   "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
|2139| »   »   »   »   "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
|2414| »   »   »   »   "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
|2447| »   »   »   »   "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
|2553| »   »   »   »   "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
|2619| »   »   »   »   "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
|2658| »   »   »   »   "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
|2869| »   »   »   »   "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
|3050| »   »   »   »   "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
|3774| »   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
|4621| »   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
|4636| »   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
|4682| »   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
|4705| »   »   ····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
|1978| »   »   »   »   »   »   &&·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
|3736| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4638| »   »   &&·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
|4639| »   »   &&·(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
|5527| »   »   »   »   »   »   &&·!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
|5530| »   »   »   »   »   »   &&·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
|5543| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5553| »   »   »   »   &&·!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
|5556| »   »   »   »   &&·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
|5631| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5949| »   »   &&·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/953/display/redirect

Freagarach updated this revision to Diff 10132.Oct 12 2019, 6:59 PM
Freagarach marked 24 inline comments as done.

Typo.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|  18|  18| 	this.cp = [];
|  19|  19| };
|  20|  20| 
|  21|    |-//// Interface functions ////
|    |  21|+// // Interface functions ////
|  22|  22| 
|  23|  23| /**
|  24|  24|  * Returns the current capture points array
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 149| 149| 	return sourceEnemyCp > 0;
| 150| 150| };
| 151| 151| 
| 152|    |-//// Private functions ////
|    | 152|+// // Private functions ////
| 153| 153| 
| 154| 154| /**
| 155| 155|  * This has to be called whenever the capture points are changed.
|    | [NORMAL] ESLintBear (spaced-comment):
|    | Expected space or tab after '//' in comment.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/Capturable.js
| 264| 264| 	Engine.PostMessage(this.entity, MT_CaptureRegenStateChanged, { "regenerating": true, "regenRate": regenRate, "territoryDecay": decay });
| 265| 265| };
| 266| 266| 
| 267|    |-//// Message Listeners ////
|    | 267|+// // Message Listeners ////
| 268| 268| 
| 269| 269| Capturable.prototype.OnValueModification = function(msg)
| 270| 270| {

binaries/data/mods/public/simulation/components/Capturable.js
| 196| »   »   var·garrisonRegenRate·=·0;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' is already defined.

binaries/data/mods/public/simulation/components/Capturable.js
| 198| »   return·regenRate·+·garrisonRegenRate;
|    | [NORMAL] JSHintBear:
|    | 'garrisonRegenRate' used out of scope.

binaries/data/mods/public/gui/session/unit_actions.js
| 557| »   »   »   switch·(tradingDetails.type)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 6 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 392| 392| 				// Players see colors depending on diplomacy
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395|    |-					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
|    | 395|+						g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 7 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 393| 393| 				g_DisplayedPlayerColors[i] =
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396|    |-					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
|    | 396|+							g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397| 397| 					getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 8 tabs but found 5.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 394| 394| 					g_ViewedPlayer == i ? getDiplomacyColor("self") :
| 395| 395| 					g_Players[g_ViewedPlayer].isAlly[i] ? getDiplomacyColor("ally") :
| 396| 396| 					g_Players[g_ViewedPlayer].isNeutral[i] ? getDiplomacyColor("neutral") :
| 397|    |-					getDiplomacyColor("enemy");
|    | 397|+								getDiplomacyColor("enemy");
| 398| 398| 
| 399| 399| 		g_DisplayedPlayerColors[0] = g_Players[0].color;
| 400| 400| 	}
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 4 tabs but found 3.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
| 656| 656| 					"civ": setStringTags(g_CivData[g_Players[g_ViewedPlayer].civ].Name, { "font": "sans-bold-stroke-14" }),
| 657| 657| 					"hotkey_civinfo": colorizeHotkey("%(hotkey)s", "civinfo"),
| 658| 658| 					"hotkey_structree": colorizeHotkey("%(hotkey)s", "structree")
| 659|    |-			});
|    | 659|+				});
| 660| 660| 	}
| 661| 661| 
| 662| 662| 	// Following gaia can be interesting on scripted maps
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1269|1269| 
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|    |-		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|    |1272|+			"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1270|1270| 	let orderHotkeyTooltip = Object.keys(viewablePlayerStates).length <= 1 ? "" :
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|    |-		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|    |1273|+			"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|1274| 	});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 2 tabs but found 1.
|----|    | /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/gui/session/session.js
|1271|1271| 		"\n" + sprintf(translate("%(order)s: %(hotkey)s to change order."), {
|1272|1272| 		"hotkey": setStringTags("\\[Click]", g_HotkeyTags),
|1273|1273| 		"order": tooltipSort == 0 ? translate("Unordered") : tooltipSort == 1 ? translate("Descending") : translate("Ascending")
|1274|    |-	});
|    |1274|+		});
|1275|1275| 
|1276|1276| 	let resCodes = g_ResourceData.GetCodes();
|1277|1277| 	for (let r = 0; r < resCodes.length; ++r)

binaries/data/mods/public/gui/session/session.js
|1123| »   let·getPanelEntNameTooltip·=·panelEntState·=>·"[font=\"sans-bold-16\"]"·+·template.name.specific·+·"[/font]";
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'panelEntState' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1205| »   »   button.onpress·=·(function(i)·{·return·function()·{·performGroup((Engine.HotkeyIsPressed("selection.add")·?·"add"·:·"select"),·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1206| »   »   button.ondoublepress·=·(function(i)·{·return·function()·{·performGroup("snap",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.

binaries/data/mods/public/gui/session/session.js
|1207| »   »   button.onpressright·=·(function(i)·{·return·function()·{·performGroup("breakUp",·i);·};·})(i);
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'i' is already declared in the upper scope.
|    | [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
| 755| 755| 					this.FinishOrder();
| 756| 756| 					return;
| 757| 757| 				}
| 758|    |-				else
| 759|    |-				{
|    | 758|+				
| 760| 759| 					this.SetNextState("GARRISON.APPROACHING");
| 761| 760| 					return;
| 762|    |-				}
|    | 761|+				
| 763| 762| 			}
| 764| 763| 
| 765| 764| 			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
|1023|1023| 			},
|1024|1024| 		},
|1025|1025| 
|1026|    |-		"GARRISON":{
|    |1026|+		"GARRISON": {
|1027|1027| 			"enter": function() {
|1028|1028| 				// If the garrisonholder should pickup, warn it so it can take needed action
|1029|1029| 				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
|1974|1974| 
|1975|1975| 				"Attacked": function(msg) {
|1976|1976| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|1977|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|1978|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |1977|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |1978|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|1979|1979| 						this.RespondToTargetedEntities([msg.data.attacker]);
|1980|1980| 				},
|1981|1981| 			},
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|2702|2702| 					{
|2703|2703| 						// The building was already finished/fully repaired before we arrived;
|2704|2704| 						// let the ConstructionFinished handler handle this.
|2705|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2705|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2706|2706| 						return true;
|2707|2707| 					}
|2708|2708| 
|    | [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
|3215|3215| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3216|3216| 
|3217|3217| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3218|    |-							// only used for domestic animals
|    |3218|+		// only used for domestic animals
|3219|3219| 	},
|3220|3220| };
|3221|3221| 
|    | [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
|3272|3272| 
|3273|3273| UnitAI.prototype.IsAnimal = function()
|3274|3274| {
|3275|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3275|+	return (!!this.template.NaturalBehaviour);
|3276|3276| };
|3277|3277| 
|3278|3278| 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
|3388|3388| 		{
|3389|3389| 			let index = this.GetCurrentState().indexOf(".");
|3390|3390| 			if (index != -1)
|3391|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3391|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3392|3392| 			this.Stop(false);
|3393|3393| 		}
|3394|3394| 
|    | [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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3444|3444| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3445|3445| 			continue;
|3446|3446| 		if (i == 0)
|3447|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3447|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3448|3448| 		else
|3449|3449| 			this.orderQueue.splice(i, 1);
|3450|3450| 		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
|3528|3528| };
|3529|3529| 
|3530|3530| 
|3531|    |-//// FSM linkage functions ////
|    |3531|+// // FSM linkage functions ////
|3532|3532| 
|3533|3533| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3534|3534| 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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3698|3698| 				continue;
|3699|3699| 			if (this.orderQueue[i].type == type)
|3700|3700| 				continue;
|3701|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3701|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3702|3702| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3703|3703| 			return;
|3704|3704| 		}
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3869|3869| 	if (data.timerRepeat === undefined)
|3870|3870| 		this.timer = undefined;
|3871|3871| 
|3872|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |3872|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|3873|3873| };
|3874|3874| 
|3875|3875| /**
|    | [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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3914|3914| 	// TODO: This is a bit inefficient since every unit listens to every
|3915|3915| 	// construction message - ideally we could scope it to only the one we're building
|3916|3916| 
|3917|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |3917|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|3918|3918| };
|3919|3919| 
|3920|3920| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3939|3939| 
|3940|3940| UnitAI.prototype.OnAttacked = function(msg)
|3941|3941| {
|3942|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |3942|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|3943|3943| };
|3944|3944| 
|3945|3945| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3944|3944| 
|3945|3945| UnitAI.prototype.OnGuardedAttacked = function(msg)
|3946|3946| {
|3947|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |3947|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|3948|3948| };
|3949|3949| 
|3950|3950| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3949|3949| 
|3950|3950| UnitAI.prototype.OnHealthChanged = function(msg)
|3951|3951| {
|3952|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |3952|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|3953|3953| };
|3954|3954| 
|3955|3955| 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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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
|3955|3955| UnitAI.prototype.OnRangeUpdate = function(msg)
|3956|3956| {
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |3958|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|3960| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|    | [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| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3957|3957| 	if (msg.tag == this.losRangeQuery)
|3958|3958| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|3959|3959| 	else if (msg.tag == this.losHealRangeQuery)
|3960|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |3960|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|3961|3961| };
|3962|3962| 
|3963|3963| 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3962|3962| 
|3963|3963| UnitAI.prototype.OnPackFinished = function(msg)
|3964|3964| {
|3965|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |3965|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|3966|3966| };
|3967|3967| 
|3968|3968| //// 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
|3965|3965| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|3966|3966| };
|3967|3967| 
|3968|    |-//// Helper functions to be called by the FSM ////
|    |3968|+// // Helper functions to be called by the FSM ////
|3969|3969| 
|3970|3970| UnitAI.prototype.GetWalkSpeed = function()
|3971|3971| {
|    | [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
|4634|4634| UnitAI.prototype.AttackEntityInZone = function(ents)
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|    |-		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4637|+		this.CanAttack(target) &&
|    |4638|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|4639| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	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
|4635|4635| {
|4636|4636| 	var target = ents.find(target =>
|4637|4637| 		this.CanAttack(target)
|4638|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4639|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4638|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4639|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4640|4640| 	);
|4641|4641| 	if (!target)
|4642|4642| 		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
|4699|4699| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4700|4700| 	if (this.isGuardOf)
|4701|4701| 	{
|4702|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4702|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    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
|4703|4703| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4704|4704| 		if (cmpUnitAI && cmpAttack &&
|4705|4705| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4706|    |-				return false;
|    |4706|+			return false;
|4707|4707| 	}
|4708|4708| 
|4709|4709| 	// 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
|4741|4741| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4742|4742| 	if (this.isGuardOf)
|4743|4743| 	{
|4744|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4744|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4745|4745| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4746|4746| 		if (cmpUnitAI && cmpAttack &&
|4747|4747| 		    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
|4754|4754| 	return false;
|4755|4755| };
|4756|4756| 
|4757|    |-//// External interface functions ////
|    |4757|+// // External interface functions ////
|4758|4758| 
|4759|4759| UnitAI.prototype.SetFormationController = function(ent)
|4760|4760| {
|    | [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
|4910|4910| 	{
|4911|4911| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|4912|4912| 			return;
|4913|    |-		else
|4914|    |-			this.RemoveGuard();
|    |4913|+		this.RemoveGuard();
|4915|4914| 	}
|4916|4915| 
|4917|4916| 	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
|5242|5242| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5243|5243| 	{
|5244|5244| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5245|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5245|+		if (cmpTrader.HasBothMarkets() &&
|5246|5246| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5247|5247| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5248|5248| 		{
|    | [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
|5523|5523| 				{
|5524|5524| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5525|5525| 					var targetClasses = this.order.data.targetClasses;
|5526|    |-					if (targetClasses.attack && cmpIdentity
|5527|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5526|+					if (targetClasses.attack && cmpIdentity &&
|    |5527|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|5529| 					if (targetClasses.avoid && cmpIdentity
|5530|5530| 						&& 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
|5526|5526| 					if (targetClasses.attack && cmpIdentity
|5527|5527| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5528|5528| 						continue;
|5529|    |-					if (targetClasses.avoid && cmpIdentity
|5530|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5529|+					if (targetClasses.avoid && cmpIdentity &&
|    |5530|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5531|5531| 						continue;
|5532|5532| 					// Only used by the AIs to prevent some choices of targets
|5533|5533| 					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
|5549|5549| 		{
|5550|5550| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5551|5551| 			var targetClasses = this.order.data.targetClasses;
|5552|    |-			if (cmpIdentity && targetClasses.attack
|5553|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5552|+			if (cmpIdentity && targetClasses.attack &&
|    |5553|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|5555| 			if (cmpIdentity && targetClasses.avoid
|5556|5556| 				&& 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
|5552|5552| 			if (cmpIdentity && targetClasses.attack
|5553|5553| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5554|5554| 				continue;
|5555|    |-			if (cmpIdentity && targetClasses.avoid
|5556|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5555|+			if (cmpIdentity && targetClasses.avoid &&
|    |5556|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5557|5557| 				continue;
|5558|5558| 			// Only used by the AIs to prevent some choices of targets
|5559|5559| 			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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = { "x": x, "z": z};
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5709|5709| 
|5710|5710| UnitAI.prototype.SetHeldPosition = function(x, z)
|5711|5711| {
|5712|    |-	this.heldPosition = {"x": x, "z": z};
|    |5712|+	this.heldPosition = {"x": x, "z": z };
|5713|5713| };
|5714|5714| 
|5715|5715| 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
|5736|5736| 	return false;
|5737|5737| };
|5738|5738| 
|5739|    |-//// Helper functions ////
|    |5739|+// // Helper functions ////
|5740|5740| 
|5741|5741| UnitAI.prototype.CanAttack = function(target)
|5742|5742| {
|    | [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
|5940|5940| 	return cmpPack && cmpPack.IsPacking();
|5941|5941| };
|5942|5942| 
|5943|    |-//// Formation specific functions ////
|    |5943|+// // Formation specific functions ////
|5944|5944| 
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|    | [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
|5945|5945| UnitAI.prototype.IsAttackingAsFormation = function()
|5946|5946| {
|5947|5947| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|5948|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|5949|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |5948|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |5949|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|5952| //// 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
|5949|5949| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|5950|5950| };
|5951|5951| 
|5952|    |-//// Animal specific functions ////
|    |5952|+// // Animal specific functions ////
|5953|5953| 
|5954|5954| UnitAI.prototype.MoveRandomly = function(distance)
|5955|5955| {

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
| 910| »   »   »   "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
| 935| »   »   »   "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
| 985| »   »   »   »   »   return·true;
|    | [NORMAL] ESLintBear (consistent-return):
|    | Method 'enter' expected no return value.

binaries/data/mods/public/simulation/components/UnitAI.js
|1048| »   »   »   »   "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
|1084| »   »   »   "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
|1116| »   »   »   »   "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
|1276| »   »   "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
|1333| »   »   »   "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
|1508| »   »   »   "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
|1530| »   »   »   "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
|1562| »   »   »   "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
|1718| »   »   »   "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
|1768| »   »   »   »   "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
|1846| »   »   »   »   "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
|2023| »   »   »   »   "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
|2139| »   »   »   »   "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
|2414| »   »   »   »   "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
|2447| »   »   »   »   "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
|2553| »   »   »   »   "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
|2619| »   »   »   »   "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
|2658| »   »   »   »   "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
|2869| »   »   »   »   "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
|3050| »   »   »   »   "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
|3774| »   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
|4621| »   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
|4636| »   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
|4682| »   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
|4705| »   »   ····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
|1978| »   »   »   »   »   »   &&·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
|3736| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4638| »   »   &&·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
|4639| »   »   &&·(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
|5527| »   »   »   »   »   »   &&·!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
|5530| »   »   »   »   »   »   &&·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
|5543| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5553| »   »   »   »   &&·!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
|5556| »   »   »   »   &&·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
|5631| »   »   var·cmpVision·=·Engine.QueryInterface(this.entity,·IID_Vision);
|    | [NORMAL] JSHintBear:
|    | 'cmpVision' is already defined.

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

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

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

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

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|5949| »   »   &&·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/954/display/redirect