Page MenuHomeWildfire Games

Status Effects v2 - More cleanup, allow modifiers.
Needs ReviewPublic

Authored by Freagarach on Sep 10 2019, 3:57 PM.

Details

Reviewers
wraitii
Angen
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

This allows modifiers to be used as an effect of status effects.
E.g. slowing a unit down when hit, lowering morale, you name it basically ;)
Also fixes some oversights from D2218/rP22901.


Done:

  • Modifiers.
  • Fix tooltip when not simulating.
  • Allow Capture as an effect.
  • Allow infinite StatusEffects (i.e. no Duration).
  • Fix TimeElapsed not being a number.
  • Transfer statusEffects to promoted entity.
  • Give credit to attacker.
  • GiveStatus -> ApplyStatus.
  • Remove GUI icons on entity death.

ToDo:

  • See whether a nicer tooltip can be made.
    • Only show gives name1, name2 when hovering the shield but elaborate when showing the information window?
Test Plan
  • Test some modifs and verify that they are applied and removed appropriately.
  • Verify that common StatusEffects still apply (one can use the provide example template change for that).

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Freagarach added inline comments.Sep 29 2019, 2:16 PM
binaries/data/mods/public/simulation/helpers/Attacking.js
278

No indeed.

Freagarach updated this revision to Diff 10010.Sep 29 2019, 3:08 PM
Freagarach marked an inline comment as done.

Better localisation support?

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Transform.js
| 222| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [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/870/display/redirect

Angen added a reviewer: Angen.Mon, Dec 23, 4:21 PM
Angen added a comment.Wed, Dec 25, 7:30 PM

So, i tested it it looks good at first sight, I had quick look through code, i did not find some obvious problem.
One thing I think is not correct. If unit A poisons unit B and B dies because of that poison, unit A and its owner should get credit for that.

Angen requested changes to this revision.Fri, Dec 27, 11:14 AM
This revision now requires changes to proceed.Fri, Dec 27, 11:14 AM
Freagarach planned changes to this revision.Fri, Dec 27, 5:51 PM

I discussed that earlier with @wraitii, it may have some side effects, I need to investigate.
(Besides, without an owner a capturing status effect would not work.)

Freagarach updated this revision to Diff 10804.Fri, Dec 27, 8:52 PM
Freagarach edited the summary of this revision. (Show Details)

Give credit to attacker and its owner.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
|  31|  31| StatusEffectsReceiver.prototype.GiveStatus = function(effectData, attacker, attackerOwner, bonusMultiplier)
|  32|  32| {
|  33|  33| 	for (let effect in effectData)
|  34|    |-		this.AddStatus(effect, effectData[effect], { "entity": attacker, "owner": attackerOwner } );
|    |  34|+		this.AddStatus(effect, effectData[effect], { "entity": attacker, "owner": attackerOwner });
|  35|  35| 
|  36|  36| 	// TODO: implement loot / resistance.
|  37|  37| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/simulation/helpers/Transform.js
| 224| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
Executing section cli...

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

Freagarach added inline comments.Sat, Dec 28, 1:02 PM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
37

Should be a variable defined earlier to prevent unnecessary object creation.

Angen added a comment.Sat, Dec 28, 4:00 PM

yes, unit gets messages that is attacked when applying poison. That need to be fixed, but that cannot be reason why player killing target with poison is not getting loot.

Freagarach updated this revision to Diff 10878.Sat, Jan 4, 9:44 PM

We have to sent messages to update other stuff, but in UnitAI we can ignore "attacks" from StatusEffects?

Vulcan added a comment.Sat, Jan 4, 9:45 PM

Build failure - The Moirai have given mortals hearts that can endure.

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

Vulcan added a comment.Sat, Jan 4, 9:45 PM

Build failure - The Moirai have given mortals hearts that can endure.

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

Vulcan added a comment.Sat, Jan 4, 9:47 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/44/display/redirect

Freagarach updated this revision to Diff 10879.Sat, Jan 4, 9:50 PM

Fix test.

Vulcan added a comment.Sat, Jan 4, 9:52 PM

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

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

Vulcan added a comment.Sat, Jan 4, 9:52 PM

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/45/display/redirect

Vulcan added a comment.Sat, Jan 4, 9:54 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Transform.js
| 224| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (space-in-parens):
|    | There should be no spaces inside this paren.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
|  31|  31| StatusEffectsReceiver.prototype.GiveStatus = function(effectData, attacker, attackerOwner, bonusMultiplier)
|  32|  32| {
|  33|  33| 	for (let effect in effectData)
|  34|    |-		this.AddStatus(effect, effectData[effect], { "entity": attacker, "owner": attackerOwner } );
|    |  34|+		this.AddStatus(effect, effectData[effect], { "entity": attacker, "owner": attackerOwner });
|  35|  35| 
|  36|  36| 	// TODO: implement loot / resistance.
|  37|  37| 
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1052|1052| 			},
|1053|1053| 		},
|1054|1054| 
|1055|    |-		"GARRISON":{
|    |1055|+		"GARRISON": {
|1056|1056| 			"APPROACHING": {
|1057|1057| 				"enter": function() {
|1058|1058| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2023|2023| 
|2024|2024| 				"Attacked": function(msg) {
|2025|2025| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2026|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2027|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2026|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2027|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2028|2028| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2029|2029| 				},
|2030|2030| 			},
|    | [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
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [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
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [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
|3278|3278| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3279|3279| 
|3280|3280| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3281|    |-							// only used for domestic animals
|    |3281|+		// only used for domestic animals
|3282|3282| 	},
|3283|3283| };
|3284|3284| 
|    | [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
|3335|3335| 
|3336|3336| UnitAI.prototype.IsAnimal = function()
|3337|3337| {
|3338|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3338|+	return (!!this.template.NaturalBehaviour);
|3339|3339| };
|3340|3340| 
|3341|3341| 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
|3451|3451| 		{
|3452|3452| 			let index = this.GetCurrentState().indexOf(".");
|3453|3453| 			if (index != -1)
|3454|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3454|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3455|3455| 			this.Stop(false);
|3456|3456| 		}
|3457|3457| 
|    | [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
|3507|3507| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3508|3508| 			continue;
|3509|3509| 		if (i == 0)
|3510|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3510|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3511|3511| 		else
|3512|3512| 			this.orderQueue.splice(i, 1);
|3513|3513| 		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
|3507|3507| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3508|3508| 			continue;
|3509|3509| 		if (i == 0)
|3510|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3510|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3511|3511| 		else
|3512|3512| 			this.orderQueue.splice(i, 1);
|3513|3513| 		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
|3591|3591| };
|3592|3592| 
|3593|3593| 
|3594|    |-//// FSM linkage functions ////
|    |3594|+// // FSM linkage functions ////
|3595|3595| 
|3596|3596| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3597|3597| 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
|3761|3761| 				continue;
|3762|3762| 			if (this.orderQueue[i].type == type)
|3763|3763| 				continue;
|3764|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3764|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3765|3765| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3766|3766| 			return;
|3767|3767| 		}
|    | [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
|3761|3761| 				continue;
|3762|3762| 			if (this.orderQueue[i].type == type)
|3763|3763| 				continue;
|3764|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3764|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3765|3765| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3766|3766| 			return;
|3767|3767| 		}
|    | [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
|4003|4003| 	if (data.timerRepeat === undefined)
|4004|4004| 		this.timer = undefined;
|4005|4005| 
|4006|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4006|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4007|4007| };
|4008|4008| 
|4009|4009| /**
|    | [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
|4003|4003| 	if (data.timerRepeat === undefined)
|4004|4004| 		this.timer = undefined;
|4005|4005| 
|4006|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4006|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4007|4007| };
|4008|4008| 
|4009|4009| /**
|    | [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
|4048|4048| 	// TODO: This is a bit inefficient since every unit listens to every
|4049|4049| 	// construction message - ideally we could scope it to only the one we're building
|4050|4050| 
|4051|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4051|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4052|4052| };
|4053|4053| 
|4054|4054| 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
|4048|4048| 	// TODO: This is a bit inefficient since every unit listens to every
|4049|4049| 	// construction message - ideally we could scope it to only the one we're building
|4050|4050| 
|4051|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4051|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4052|4052| };
|4053|4053| 
|4054|4054| 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
|4076|4076| 	if (msg.fromStatusEffect)
|4077|4077| 		return;
|4078|4078| 
|4079|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4079|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4080|4080| };
|4081|4081| 
|4082|4082| 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
|4076|4076| 	if (msg.fromStatusEffect)
|4077|4077| 		return;
|4078|4078| 
|4079|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4079|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4080|4080| };
|4081|4081| 
|4082|4082| 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
|4081|4081| 
|4082|4082| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4083|4083| {
|4084|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4084|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4085|4085| };
|4086|4086| 
|4087|4087| 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
|4081|4081| 
|4082|4082| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4083|4083| {
|4084|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4084|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4085|4085| };
|4086|4086| 
|4087|4087| 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
|4086|4086| 
|4087|4087| UnitAI.prototype.OnHealthChanged = function(msg)
|4088|4088| {
|4089|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4089|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4090|4090| };
|4091|4091| 
|4092|4092| 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
|4086|4086| 
|4087|4087| UnitAI.prototype.OnHealthChanged = function(msg)
|4088|4088| {
|4089|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4089|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4090|4090| };
|4091|4091| 
|4092|4092| 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
|4092|4092| UnitAI.prototype.OnRangeUpdate = function(msg)
|4093|4093| {
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4095|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|4097| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|    | [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
|4092|4092| UnitAI.prototype.OnRangeUpdate = function(msg)
|4093|4093| {
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4095|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|4097| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|    | [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
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|4095| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4097|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|4099|4099| 
|4100|4100| 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
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|4095| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4097|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4098|4098| };
|4099|4099| 
|4100|4100| 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
|4099|4099| 
|4100|4100| UnitAI.prototype.OnPackFinished = function(msg)
|4101|4101| {
|4102|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4102|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4103|4103| };
|4104|4104| 
|4105|4105| //// 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
|4099|4099| 
|4100|4100| UnitAI.prototype.OnPackFinished = function(msg)
|4101|4101| {
|4102|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4102|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4103|4103| };
|4104|4104| 
|4105|4105| //// 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
|4102|4102| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4103|4103| };
|4104|4104| 
|4105|    |-//// Helper functions to be called by the FSM ////
|    |4105|+// // Helper functions to be called by the FSM ////
|4106|4106| 
|4107|4107| UnitAI.prototype.GetWalkSpeed = function()
|4108|4108| {
|    | [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
|4770|4770| UnitAI.prototype.AttackEntityInZone = function(ents)
|4771|4771| {
|4772|4772| 	var target = ents.find(target =>
|4773|    |-		this.CanAttack(target)
|4774|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4773|+		this.CanAttack(target) &&
|    |4774|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4775|4775| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4776|4776| 	);
|4777|4777| 	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
|4771|4771| {
|4772|4772| 	var target = ents.find(target =>
|4773|4773| 		this.CanAttack(target)
|4774|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4775|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4774|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4775|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4776|4776| 	);
|4777|4777| 	if (!target)
|4778|4778| 		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
|4835|4835| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4836|4836| 	if (this.isGuardOf)
|4837|4837| 	{
|4838|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4838|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4839|4839| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4840|4840| 		if (cmpUnitAI && cmpAttack &&
|4841|4841| 		    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
|4839|4839| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4840|4840| 		if (cmpUnitAI && cmpAttack &&
|4841|4841| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4842|    |-				return false;
|    |4842|+			return false;
|4843|4843| 	}
|4844|4844| 
|4845|4845| 	// 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
|4877|4877| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4878|4878| 	if (this.isGuardOf)
|4879|4879| 	{
|4880|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4880|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4881|4881| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4882|4882| 		if (cmpUnitAI && cmpAttack &&
|4883|4883| 		    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
|4890|4890| 	return false;
|4891|4891| };
|4892|4892| 
|4893|    |-//// External interface functions ////
|    |4893|+// // External interface functions ////
|4894|4894| 
|4895|4895| UnitAI.prototype.SetFormationController = function(ent)
|4896|4896| {
|    | [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
|5046|5046| 	{
|5047|5047| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5048|5048| 			return;
|5049|    |-		else
|5050|    |-			this.RemoveGuard();
|    |5049|+		this.RemoveGuard();
|5051|5050| 	}
|5052|5051| 
|5053|5052| 	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
|5388|5388| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5389|5389| 	{
|5390|5390| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5391|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5391|+		if (cmpTrader.HasBothMarkets() &&
|5392|5392| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5393|5393| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5394|5394| 		{
|    | [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
|5669|5669| 				{
|5670|5670| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5671|5671| 					var targetClasses = this.order.data.targetClasses;
|5672|    |-					if (targetClasses.attack && cmpIdentity
|5673|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5672|+					if (targetClasses.attack && cmpIdentity &&
|    |5673|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5674|5674| 						continue;
|5675|5675| 					if (targetClasses.avoid && cmpIdentity
|5676|5676| 						&& 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
|5672|5672| 					if (targetClasses.attack && cmpIdentity
|5673|5673| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5674|5674| 						continue;
|5675|    |-					if (targetClasses.avoid && cmpIdentity
|5676|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5675|+					if (targetClasses.avoid && cmpIdentity &&
|    |5676|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5677|5677| 						continue;
|5678|5678| 					// Only used by the AIs to prevent some choices of targets
|5679|5679| 					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
|5695|5695| 		{
|5696|5696| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5697|5697| 			var targetClasses = this.order.data.targetClasses;
|5698|    |-			if (cmpIdentity && targetClasses.attack
|5699|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5698|+			if (cmpIdentity && targetClasses.attack &&
|    |5699|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5700|5700| 				continue;
|5701|5701| 			if (cmpIdentity && targetClasses.avoid
|5702|5702| 				&& 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
|5698|5698| 			if (cmpIdentity && targetClasses.attack
|5699|5699| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5700|5700| 				continue;
|5701|    |-			if (cmpIdentity && targetClasses.avoid
|5702|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5701|+			if (cmpIdentity && targetClasses.avoid &&
|    |5702|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5703|5703| 				continue;
|5704|5704| 			// Only used by the AIs to prevent some choices of targets
|5705|5705| 			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
|5855|5855| 
|5856|5856| UnitAI.prototype.SetHeldPosition = function(x, z)
|5857|5857| {
|5858|    |-	this.heldPosition = {"x": x, "z": z};
|    |5858|+	this.heldPosition = { "x": x, "z": z};
|5859|5859| };
|5860|5860| 
|5861|5861| 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
|5855|5855| 
|5856|5856| UnitAI.prototype.SetHeldPosition = function(x, z)
|5857|5857| {
|5858|    |-	this.heldPosition = {"x": x, "z": z};
|    |5858|+	this.heldPosition = {"x": x, "z": z };
|5859|5859| };
|5860|5860| 
|5861|5861| 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
|5882|5882| 	return false;
|5883|5883| };
|5884|5884| 
|5885|    |-//// Helper functions ////
|    |5885|+// // Helper functions ////
|5886|5886| 
|5887|5887| UnitAI.prototype.CanAttack = function(target)
|5888|5888| {
|    | [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
|6086|6086| 	return cmpPack && cmpPack.IsPacking();
|6087|6087| };
|6088|6088| 
|6089|    |-//// Formation specific functions ////
|    |6089|+// // Formation specific functions ////
|6090|6090| 
|6091|6091| UnitAI.prototype.IsAttackingAsFormation = function()
|6092|6092| {
|    | [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
|6091|6091| UnitAI.prototype.IsAttackingAsFormation = function()
|6092|6092| {
|6093|6093| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6094|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6095|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6094|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6095|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6096|6096| };
|6097|6097| 
|6098|6098| //// 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
|6095|6095| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6096|6096| };
|6097|6097| 
|6098|    |-//// Animal specific functions ////
|    |6098|+// // Animal specific functions ////
|6099|6099| 
|6100|6100| UnitAI.prototype.MoveRandomly = function(distance)
|6101|6101| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3908| »   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
|4757| »   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
|4772| »   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
|4818| »   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
|4841| »   »   ····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
|2027| »   »   »   »   »   »   &&·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
|3855| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4774| »   »   &&·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
|4775| »   »   &&·(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
|5673| »   »   »   »   »   »   &&·!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
|5676| »   »   »   »   »   »   &&·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
|5689| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

Stan added inline comments.Sun, Jan 5, 12:46 AM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
91

Worth a comment?

116

Any reason why separate/not in prototype?

binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
75

What if 0 ?

Angen added inline comments.Sun, Jan 5, 11:57 AM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
75

interval = 0 does not work for timer

if (typeof repeattime != "number" || !(repeattime > 0))
		error("Invalid repeattime to SetInterval of "+funcname);
Stan added inline comments.Sun, Jan 5, 12:02 PM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
75

Ah yeah that famous warning :D

Angen requested changes to this revision.Sun, Jan 5, 12:55 PM

Unit gets experiences through status effect timer. Unit should get experiences only when it hits with attack not just through status effect.

Here is why: Hit target with poisoned arrow, you get exp because you landed hit. But you do not get exp, you do not improve your fighting skills sitting somewhere safe (chopping trees, ...) and do not attacking while poison is doing its job.
Hunted animal keeps status effects after dead. (Should not be there)
I noticed player does not get always loot when unit dies.

There are tree main things that need to be done correctly and the way they reflect common sense.

  1. entity killed by status effect gets to correct statistics (this works)
  2. unit gets experience by landing hits not by duration of status effect.
  3. player gets loot after killing the unit (this sometimes works)
This revision now requires changes to proceed.Sun, Jan 5, 12:55 PM
In D2281#106005, @Angen wrote:

Unit gets experiences through status effect timer. Unit should get experiences only when it hits with attack not just through status effect.
Here is why: Hit target with poisoned arrow, you get exp because you landed hit. But you do not get exp, you do not improve your fighting skills sitting somewhere safe (chopping trees, ...) and do not attacking while poison is doing its job.

Okay, but edge case: what if a unit only inflicts status effects (and damage with that), than it cannot gain XP, although it does hit and kill stuff?

In D2281#106005, @Angen wrote:

I noticed player does not get always loot when unit dies.

This is actually unrelated to StatusEffects, though shown clearly by that. The problem is that when a unit promotes while the timer is running cmpLooter will be undefined.

Deer keeping SE needs some thought. For we want this specific corpse to be able to receive status effects, just not the same as was when killed. Also we generally do want SE to be transferred on rename.

Angen added a comment.Sun, Jan 5, 3:28 PM

Okay, but edge case: what if a unit only inflicts status effects (and damage with that), than it cannot gain XP, although it does hit and kill stuff?

If it hits it gets xp, thats ok. But no if it does not hit. How would you apply status effect to unit without damaging it first with attack ?

Stan added a comment.Sun, Jan 5, 3:31 PM
In D2281#106012, @Angen wrote:

Okay, but edge case: what if a unit only inflicts status effects (and damage with that), than it cannot gain XP, although it does hit and kill stuff?

If it hits it gets xp, thats ok. But no if it does not hit. How would you apply status effect to unit without damaging it first with attack ?

Healing?

Angen added a comment.Sun, Jan 5, 3:50 PM

Do you want to damage units you want to heal ?

My point is, any other way one will apply status effect to unit another way than current attack will have its own exp handling.
Maybe it should differentiate between handle attack and handle damage. When attack is when attack is actually performed directly by unit and damage is anything else done over time as result of the attack.

and healing cant apply status effects

Freagarach updated this revision to Diff 10888.Sun, Jan 5, 7:46 PM
Freagarach marked 3 inline comments as done.
  • No XP from Status Effects.
  • Less object creation when applying multiple Status Effects at once.

@Angen when I test the deer corpse does not get a status effect?

In D2281#106014, @Angen wrote:

Maybe it should differentiate between handle attack and handle damage. When attack is when attack is actually performed directly by unit and damage is anything else done over time as result of the attack.

Yeah, the respective components should perhaps send the messages.

Vulcan added a comment.Sun, Jan 5, 7:48 PM

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

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

Vulcan added a comment.Sun, Jan 5, 7:51 PM

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Transform.js
| 224| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' 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
| 780| 780| 					this.FinishOrder();
| 781| 781| 					return;
| 782| 782| 				}
| 783|    |-				else
| 784|    |-				{
|    | 783|+				
| 785| 784| 					this.SetNextState("GARRISON.APPROACHING");
| 786| 785| 					return;
| 787|    |-				}
|    | 786|+				
| 788| 787| 			}
| 789| 788| 
| 790| 789| 			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
|1052|1052| 			},
|1053|1053| 		},
|1054|1054| 
|1055|    |-		"GARRISON":{
|    |1055|+		"GARRISON": {
|1056|1056| 			"APPROACHING": {
|1057|1057| 				"enter": function() {
|1058|1058| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2023|2023| 
|2024|2024| 				"Attacked": function(msg) {
|2025|2025| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2026|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2027|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2026|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2027|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2028|2028| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2029|2029| 				},
|2030|2030| 			},
|    | [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
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [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
|2758|2758| 					{
|2759|2759| 						// The building was already finished/fully repaired before we arrived;
|2760|2760| 						// let the ConstructionFinished handler handle this.
|2761|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2761|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2762|2762| 						return true;
|2763|2763| 					}
|2764|2764| 
|    | [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
|3278|3278| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3279|3279| 
|3280|3280| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3281|    |-							// only used for domestic animals
|    |3281|+		// only used for domestic animals
|3282|3282| 	},
|3283|3283| };
|3284|3284| 
|    | [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
|3335|3335| 
|3336|3336| UnitAI.prototype.IsAnimal = function()
|3337|3337| {
|3338|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3338|+	return (!!this.template.NaturalBehaviour);
|3339|3339| };
|3340|3340| 
|3341|3341| 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
|3451|3451| 		{
|3452|3452| 			let index = this.GetCurrentState().indexOf(".");
|3453|3453| 			if (index != -1)
|3454|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3454|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3455|3455| 			this.Stop(false);
|3456|3456| 		}
|3457|3457| 
|    | [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
|3507|3507| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3508|3508| 			continue;
|3509|3509| 		if (i == 0)
|3510|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3510|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3511|3511| 		else
|3512|3512| 			this.orderQueue.splice(i, 1);
|3513|3513| 		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
|3507|3507| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3508|3508| 			continue;
|3509|3509| 		if (i == 0)
|3510|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3510|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3511|3511| 		else
|3512|3512| 			this.orderQueue.splice(i, 1);
|3513|3513| 		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
|3591|3591| };
|3592|3592| 
|3593|3593| 
|3594|    |-//// FSM linkage functions ////
|    |3594|+// // FSM linkage functions ////
|3595|3595| 
|3596|3596| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3597|3597| 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
|3761|3761| 				continue;
|3762|3762| 			if (this.orderQueue[i].type == type)
|3763|3763| 				continue;
|3764|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3764|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3765|3765| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3766|3766| 			return;
|3767|3767| 		}
|    | [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
|3761|3761| 				continue;
|3762|3762| 			if (this.orderQueue[i].type == type)
|3763|3763| 				continue;
|3764|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3764|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3765|3765| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3766|3766| 			return;
|3767|3767| 		}
|    | [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
|4003|4003| 	if (data.timerRepeat === undefined)
|4004|4004| 		this.timer = undefined;
|4005|4005| 
|4006|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4006|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4007|4007| };
|4008|4008| 
|4009|4009| /**
|    | [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
|4003|4003| 	if (data.timerRepeat === undefined)
|4004|4004| 		this.timer = undefined;
|4005|4005| 
|4006|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4006|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4007|4007| };
|4008|4008| 
|4009|4009| /**
|    | [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
|4048|4048| 	// TODO: This is a bit inefficient since every unit listens to every
|4049|4049| 	// construction message - ideally we could scope it to only the one we're building
|4050|4050| 
|4051|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4051|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4052|4052| };
|4053|4053| 
|4054|4054| 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
|4048|4048| 	// TODO: This is a bit inefficient since every unit listens to every
|4049|4049| 	// construction message - ideally we could scope it to only the one we're building
|4050|4050| 
|4051|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4051|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4052|4052| };
|4053|4053| 
|4054|4054| 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
|4076|4076| 	if (msg.fromStatusEffect)
|4077|4077| 		return;
|4078|4078| 
|4079|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4079|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4080|4080| };
|4081|4081| 
|4082|4082| 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
|4076|4076| 	if (msg.fromStatusEffect)
|4077|4077| 		return;
|4078|4078| 
|4079|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4079|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4080|4080| };
|4081|4081| 
|4082|4082| 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
|4081|4081| 
|4082|4082| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4083|4083| {
|4084|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4084|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4085|4085| };
|4086|4086| 
|4087|4087| 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
|4081|4081| 
|4082|4082| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4083|4083| {
|4084|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4084|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4085|4085| };
|4086|4086| 
|4087|4087| 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
|4086|4086| 
|4087|4087| UnitAI.prototype.OnHealthChanged = function(msg)
|4088|4088| {
|4089|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4089|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4090|4090| };
|4091|4091| 
|4092|4092| 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
|4086|4086| 
|4087|4087| UnitAI.prototype.OnHealthChanged = function(msg)
|4088|4088| {
|4089|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4089|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4090|4090| };
|4091|4091| 
|4092|4092| 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
|4092|4092| UnitAI.prototype.OnRangeUpdate = function(msg)
|4093|4093| {
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4095|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|4097| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|    | [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
|4092|4092| UnitAI.prototype.OnRangeUpdate = function(msg)
|4093|4093| {
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4095|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|4097| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|    | [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
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|4095| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4097|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4098|4098| };
|4099|4099| 
|4100|4100| 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
|4094|4094| 	if (msg.tag == this.losRangeQuery)
|4095|4095| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4096|4096| 	else if (msg.tag == this.losHealRangeQuery)
|4097|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4097|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4098|4098| };
|4099|4099| 
|4100|4100| 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
|4099|4099| 
|4100|4100| UnitAI.prototype.OnPackFinished = function(msg)
|4101|4101| {
|4102|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4102|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4103|4103| };
|4104|4104| 
|4105|4105| //// 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
|4099|4099| 
|4100|4100| UnitAI.prototype.OnPackFinished = function(msg)
|4101|4101| {
|4102|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4102|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4103|4103| };
|4104|4104| 
|4105|4105| //// 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
|4102|4102| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4103|4103| };
|4104|4104| 
|4105|    |-//// Helper functions to be called by the FSM ////
|    |4105|+// // Helper functions to be called by the FSM ////
|4106|4106| 
|4107|4107| UnitAI.prototype.GetWalkSpeed = function()
|4108|4108| {
|    | [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
|4770|4770| UnitAI.prototype.AttackEntityInZone = function(ents)
|4771|4771| {
|4772|4772| 	var target = ents.find(target =>
|4773|    |-		this.CanAttack(target)
|4774|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4773|+		this.CanAttack(target) &&
|    |4774|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4775|4775| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4776|4776| 	);
|4777|4777| 	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
|4771|4771| {
|4772|4772| 	var target = ents.find(target =>
|4773|4773| 		this.CanAttack(target)
|4774|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4775|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4774|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4775|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4776|4776| 	);
|4777|4777| 	if (!target)
|4778|4778| 		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
|4835|4835| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4836|4836| 	if (this.isGuardOf)
|4837|4837| 	{
|4838|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4838|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4839|4839| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4840|4840| 		if (cmpUnitAI && cmpAttack &&
|4841|4841| 		    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
|4839|4839| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4840|4840| 		if (cmpUnitAI && cmpAttack &&
|4841|4841| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4842|    |-				return false;
|    |4842|+			return false;
|4843|4843| 	}
|4844|4844| 
|4845|4845| 	// 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
|4877|4877| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4878|4878| 	if (this.isGuardOf)
|4879|4879| 	{
|4880|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4880|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4881|4881| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4882|4882| 		if (cmpUnitAI && cmpAttack &&
|4883|4883| 		    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
|4890|4890| 	return false;
|4891|4891| };
|4892|4892| 
|4893|    |-//// External interface functions ////
|    |4893|+// // External interface functions ////
|4894|4894| 
|4895|4895| UnitAI.prototype.SetFormationController = function(ent)
|4896|4896| {
|    | [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
|5046|5046| 	{
|5047|5047| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5048|5048| 			return;
|5049|    |-		else
|5050|    |-			this.RemoveGuard();
|    |5049|+		this.RemoveGuard();
|5051|5050| 	}
|5052|5051| 
|5053|5052| 	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
|5388|5388| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5389|5389| 	{
|5390|5390| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5391|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5391|+		if (cmpTrader.HasBothMarkets() &&
|5392|5392| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5393|5393| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5394|5394| 		{
|    | [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
|5669|5669| 				{
|5670|5670| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5671|5671| 					var targetClasses = this.order.data.targetClasses;
|5672|    |-					if (targetClasses.attack && cmpIdentity
|5673|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5672|+					if (targetClasses.attack && cmpIdentity &&
|    |5673|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5674|5674| 						continue;
|5675|5675| 					if (targetClasses.avoid && cmpIdentity
|5676|5676| 						&& 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
|5672|5672| 					if (targetClasses.attack && cmpIdentity
|5673|5673| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5674|5674| 						continue;
|5675|    |-					if (targetClasses.avoid && cmpIdentity
|5676|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5675|+					if (targetClasses.avoid && cmpIdentity &&
|    |5676|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5677|5677| 						continue;
|5678|5678| 					// Only used by the AIs to prevent some choices of targets
|5679|5679| 					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
|5695|5695| 		{
|5696|5696| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5697|5697| 			var targetClasses = this.order.data.targetClasses;
|5698|    |-			if (cmpIdentity && targetClasses.attack
|5699|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5698|+			if (cmpIdentity && targetClasses.attack &&
|    |5699|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5700|5700| 				continue;
|5701|5701| 			if (cmpIdentity && targetClasses.avoid
|5702|5702| 				&& 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
|5698|5698| 			if (cmpIdentity && targetClasses.attack
|5699|5699| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5700|5700| 				continue;
|5701|    |-			if (cmpIdentity && targetClasses.avoid
|5702|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5701|+			if (cmpIdentity && targetClasses.avoid &&
|    |5702|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5703|5703| 				continue;
|5704|5704| 			// Only used by the AIs to prevent some choices of targets
|5705|5705| 			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
|5855|5855| 
|5856|5856| UnitAI.prototype.SetHeldPosition = function(x, z)
|5857|5857| {
|5858|    |-	this.heldPosition = {"x": x, "z": z};
|    |5858|+	this.heldPosition = { "x": x, "z": z};
|5859|5859| };
|5860|5860| 
|5861|5861| 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
|5855|5855| 
|5856|5856| UnitAI.prototype.SetHeldPosition = function(x, z)
|5857|5857| {
|5858|    |-	this.heldPosition = {"x": x, "z": z};
|    |5858|+	this.heldPosition = {"x": x, "z": z };
|5859|5859| };
|5860|5860| 
|5861|5861| 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
|5882|5882| 	return false;
|5883|5883| };
|5884|5884| 
|5885|    |-//// Helper functions ////
|    |5885|+// // Helper functions ////
|5886|5886| 
|5887|5887| UnitAI.prototype.CanAttack = function(target)
|5888|5888| {
|    | [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
|6086|6086| 	return cmpPack && cmpPack.IsPacking();
|6087|6087| };
|6088|6088| 
|6089|    |-//// Formation specific functions ////
|    |6089|+// // Formation specific functions ////
|6090|6090| 
|6091|6091| UnitAI.prototype.IsAttackingAsFormation = function()
|6092|6092| {
|    | [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
|6091|6091| UnitAI.prototype.IsAttackingAsFormation = function()
|6092|6092| {
|6093|6093| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6094|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6095|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6094|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6095|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6096|6096| };
|6097|6097| 
|6098|6098| //// 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
|6095|6095| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6096|6096| };
|6097|6097| 
|6098|    |-//// Animal specific functions ////
|    |6098|+// // Animal specific functions ////
|6099|6099| 
|6100|6100| UnitAI.prototype.MoveRandomly = function(distance)
|6101|6101| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3908| »   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
|4757| »   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
|4772| »   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
|4818| »   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
|4841| »   »   ····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
|2027| »   »   »   »   »   »   &&·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
|3855| »   »   var·order·=·{·"type":·type,·"data":·data·};
|    | [NORMAL] JSHintBear:
|    | 'order' is already defined.

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4774| »   »   &&·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
|4775| »   »   &&·(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
|5673| »   »   »   »   »   »   &&·!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
|5676| »   »   »   »   »   »   &&·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
|5689| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

Vulcan added a comment.Sun, Jan 5, 7:51 PM

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/52/display/redirect

Angen added a comment.EditedMon, Jan 6, 11:02 AM


(After short irc discussion with Stan, it is fine to keep status effects on corpses)

Ah, so the GUI is not properly updater perhaps? If you select something else and then come back to the corpse, does it still have the Status Effect signs?
Or better: if does the selection state show status effects?

Stan added a comment.Mon, Jan 6, 5:20 PM

Ah, so the GUI is not properly updater perhaps? If you select something else and then come back to the corpse, does it still have the Status Effect signs?
Or better: if does the selection state show status effects?

As I said on IRC it should keep status effects if it makes sense, as in disease, curse when turning to a resource or whatever. So it's okay.

elexis added a subscriber: elexis.Mon, Jan 6, 5:56 PM
elexis added inline comments.
binaries/data/mods/public/globalscripts/ModificationTemplates.js
171

(for...of unless one uses both value and index)

194

(concat creates a new object, splice and push insert into the existing one, not sure if it makes a measurable difference. I didn't check but sometimes one can also pass the result array/object as an argument and have the called function insert. Also dont know if one wants a uniqueness test somewhere.)

binaries/data/mods/public/globalscripts/Templates.js
184

(perhaps Apply)

binaries/data/mods/public/gui/common/tooltips.js
284

(Object.keys().map() creates an array that for...in doesn't create, I think that was my fault, same for using join to comma separate requiring an object that += doesnt need)

binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
77

(StatusEffectsReceiver.prototype.Interval = 1000)

binaries/data/mods/public/simulation/helpers/Attacking.js
289

(It seems like indirection to test for a property of statuseffects (has interval or not) rather than test some isStatusEffect or type=Statuseffect, not sure what's happening with the code however, and also inserting that type information may be less performant and more memory consumptive)

Stan added inline comments.Mon, Jan 6, 6:12 PM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
194

I did notice a difference when looking at D2404

Freagarach updated this revision to Diff 10966.Fri, Jan 10, 9:41 PM
Freagarach marked 4 inline comments as done.
Freagarach edited the summary of this revision. (Show Details)
  • Inlines.
  • GiveStatus -> ApplyStatus.
In D2281#106137, @Stan wrote:

As I said on IRC it should keep status effects if it makes sense, as in disease, curse when turning to a resource or whatever. So it's okay.

Dead stuff doesn't keep StatusEffects.

binaries/data/mods/public/globalscripts/ModificationTemplates.js
116

I don't know, maybe @wraitii knows?
I tried it in the prototype but it won't take it ;)

binaries/data/mods/public/simulation/helpers/Attacking.js
289

Agreed, I was thinking about that. Indeed the only right way would be to insert a new property.

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/99/display/redirect

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/helpers/Transform.js
| 225| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' 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
| 782| 782| 					this.FinishOrder();
| 783| 783| 					return;
| 784| 784| 				}
| 785|    |-				else
| 786|    |-				{
|    | 785|+				
| 787| 786| 					this.SetNextState("GARRISON.APPROACHING");
| 788| 787| 					return;
| 789|    |-				}
|    | 788|+				
| 790| 789| 			}
| 791| 790| 
| 792| 791| 			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
|1054|1054| 			},
|1055|1055| 		},
|1056|1056| 
|1057|    |-		"GARRISON":{
|    |1057|+		"GARRISON": {
|1058|1058| 			"APPROACHING": {
|1059|1059| 				"enter": function() {
|1060|1060| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2032|2032| 
|2033|2033| 				"Attacked": function(msg) {
|2034|2034| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2035|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2036|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2035|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2036|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2037|2037| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2038|2038| 				},
|2039|2039| 			},
|    | [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
|2765|2765| 					{
|2766|2766| 						// The building was already finished/fully repaired before we arrived;
|2767|2767| 						// let the ConstructionFinished handler handle this.
|2768|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2768|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2769|2769| 						return true;
|2770|2770| 					}
|2771|2771| 
|    | [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
|2765|2765| 					{
|2766|2766| 						// The building was already finished/fully repaired before we arrived;
|2767|2767| 						// let the ConstructionFinished handler handle this.
|2768|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2768|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2769|2769| 						return true;
|2770|2770| 					}
|2771|2771| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3063|3063| 				this.StopTimer();
|3064|3064| 				this.ResetAnimation();
|3065|3065| 				if (this.formationAnimationVariant)
|3066|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3066|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3067|3067| 				else
|3068|3068| 					this.SetDefaultAnimationVariant();
|3069|3069| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3289|3289| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3290|3290| 
|3291|3291| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3292|    |-							// only used for domestic animals
|    |3292|+		// only used for domestic animals
|3293|3293| 	},
|3294|3294| };
|3295|3295| 
|    | [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
|3348|3348| 
|3349|3349| UnitAI.prototype.IsAnimal = function()
|3350|3350| {
|3351|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3351|+	return (!!this.template.NaturalBehaviour);
|3352|3352| };
|3353|3353| 
|3354|3354| 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
|3464|3464| 		{
|3465|3465| 			let index = this.GetCurrentState().indexOf(".");
|3466|3466| 			if (index != -1)
|3467|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3467|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3468|3468| 			this.Stop(false);
|3469|3469| 		}
|3470|3470| 
|    | [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
|3520|3520| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3521|3521| 			continue;
|3522|3522| 		if (i == 0)
|3523|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3523|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3524|3524| 		else
|3525|3525| 			this.orderQueue.splice(i, 1);
|3526|3526| 		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
|3520|3520| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3521|3521| 			continue;
|3522|3522| 		if (i == 0)
|3523|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3523|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3524|3524| 		else
|3525|3525| 			this.orderQueue.splice(i, 1);
|3526|3526| 		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
|3604|3604| };
|3605|3605| 
|3606|3606| 
|3607|    |-//// FSM linkage functions ////
|    |3607|+// // FSM linkage functions ////
|3608|3608| 
|3609|3609| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3610|3610| 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
|3775|3775| 				continue;
|3776|3776| 			if (this.orderQueue[i].type == type)
|3777|3777| 				continue;
|3778|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3778|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3779|3779| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3780|3780| 			return;
|3781|3781| 		}
|    | [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
|3775|3775| 				continue;
|3776|3776| 			if (this.orderQueue[i].type == type)
|3777|3777| 				continue;
|3778|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3778|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3779|3779| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3780|3780| 			return;
|3781|3781| 		}
|    | [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
|4017|4017| 	if (data.timerRepeat === undefined)
|4018|4018| 		this.timer = undefined;
|4019|4019| 
|4020|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4020|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4021|4021| };
|4022|4022| 
|4023|4023| /**
|    | [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
|4017|4017| 	if (data.timerRepeat === undefined)
|4018|4018| 		this.timer = undefined;
|4019|4019| 
|4020|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4020|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4021|4021| };
|4022|4022| 
|4023|4023| /**
|    | [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
|4062|4062| 	// TODO: This is a bit inefficient since every unit listens to every
|4063|4063| 	// construction message - ideally we could scope it to only the one we're building
|4064|4064| 
|4065|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4065|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4066|4066| };
|4067|4067| 
|4068|4068| 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
|4062|4062| 	// TODO: This is a bit inefficient since every unit listens to every
|4063|4063| 	// construction message - ideally we could scope it to only the one we're building
|4064|4064| 
|4065|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4065|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4066|4066| };
|4067|4067| 
|4068|4068| 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
|4090|4090| 	if (msg.fromStatusEffect)
|4091|4091| 		return;
|4092|4092| 
|4093|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4093|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4094|4094| };
|4095|4095| 
|4096|4096| 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
|4090|4090| 	if (msg.fromStatusEffect)
|4091|4091| 		return;
|4092|4092| 
|4093|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4093|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4094|4094| };
|4095|4095| 
|4096|4096| 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
|4095|4095| 
|4096|4096| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4097|4097| {
|4098|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4098|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4099|4099| };
|4100|4100| 
|4101|4101| 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
|4095|4095| 
|4096|4096| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4097|4097| {
|4098|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4098|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4099|4099| };
|4100|4100| 
|4101|4101| 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
|4100|4100| 
|4101|4101| UnitAI.prototype.OnHealthChanged = function(msg)
|4102|4102| {
|4103|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4103|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4104|4104| };
|4105|4105| 
|4106|4106| 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
|4100|4100| 
|4101|4101| UnitAI.prototype.OnHealthChanged = function(msg)
|4102|4102| {
|4103|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4103|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4104|4104| };
|4105|4105| 
|4106|4106| 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
|4106|4106| UnitAI.prototype.OnRangeUpdate = function(msg)
|4107|4107| {
|4108|4108| 	if (msg.tag == this.losRangeQuery)
|4109|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4109|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4110|4110| 	else if (msg.tag == this.losHealRangeQuery)
|4111|4111| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4112|4112| };
|    | [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
|4106|4106| UnitAI.prototype.OnRangeUpdate = function(msg)
|4107|4107| {
|4108|4108| 	if (msg.tag == this.losRangeQuery)
|4109|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4109|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4110|4110| 	else if (msg.tag == this.losHealRangeQuery)
|4111|4111| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4112|4112| };
|    | [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
|4108|4108| 	if (msg.tag == this.losRangeQuery)
|4109|4109| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4110|4110| 	else if (msg.tag == this.losHealRangeQuery)
|4111|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4111|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4112|4112| };
|4113|4113| 
|4114|4114| 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
|4108|4108| 	if (msg.tag == this.losRangeQuery)
|4109|4109| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4110|4110| 	else if (msg.tag == this.losHealRangeQuery)
|4111|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4111|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4112|4112| };
|4113|4113| 
|4114|4114| 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
|4113|4113| 
|4114|4114| UnitAI.prototype.OnPackFinished = function(msg)
|4115|4115| {
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4116|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4117|4117| };
|4118|4118| 
|4119|4119| //// 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
|4113|4113| 
|4114|4114| UnitAI.prototype.OnPackFinished = function(msg)
|4115|4115| {
|4116|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4116|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4117|4117| };
|4118|4118| 
|4119|4119| //// 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
|4116|4116| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4117|4117| };
|4118|4118| 
|4119|    |-//// Helper functions to be called by the FSM ////
|    |4119|+// // Helper functions to be called by the FSM ////
|4120|4120| 
|4121|4121| UnitAI.prototype.GetWalkSpeed = function()
|4122|4122| {
|    | [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
|4781|4781| UnitAI.prototype.AttackEntityInZone = function(ents)
|4782|4782| {
|4783|4783| 	var target = ents.find(target =>
|4784|    |-		this.CanAttack(target)
|4785|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4784|+		this.CanAttack(target) &&
|    |4785|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4786|4786| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4787|4787| 	);
|4788|4788| 	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
|4782|4782| {
|4783|4783| 	var target = ents.find(target =>
|4784|4784| 		this.CanAttack(target)
|4785|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4786|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4785|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4786|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4787|4787| 	);
|4788|4788| 	if (!target)
|4789|4789| 		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
|4846|4846| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4847|4847| 	if (this.isGuardOf)
|4848|4848| 	{
|4849|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4849|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4850|4850| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4851|4851| 		if (cmpUnitAI && cmpAttack &&
|4852|4852| 		    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
|4850|4850| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4851|4851| 		if (cmpUnitAI && cmpAttack &&
|4852|4852| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4853|    |-				return false;
|    |4853|+			return false;
|4854|4854| 	}
|4855|4855| 
|4856|4856| 	// 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
|4888|4888| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4889|4889| 	if (this.isGuardOf)
|4890|4890| 	{
|4891|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4891|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4892|4892| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4893|4893| 		if (cmpUnitAI && cmpAttack &&
|4894|4894| 		    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
|4901|4901| 	return false;
|4902|4902| };
|4903|4903| 
|4904|    |-//// External interface functions ////
|    |4904|+// // External interface functions ////
|4905|4905| 
|4906|4906| UnitAI.prototype.SetFormationController = function(ent)
|4907|4907| {
|    | [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
|5057|5057| 	{
|5058|5058| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5059|5059| 			return;
|5060|    |-		else
|5061|    |-			this.RemoveGuard();
|    |5060|+		this.RemoveGuard();
|5062|5061| 	}
|5063|5062| 
|5064|5063| 	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
|5399|5399| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5400|5400| 	{
|5401|5401| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5402|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5402|+		if (cmpTrader.HasBothMarkets() &&
|5403|5403| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5404|5404| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5405|5405| 		{
|    | [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
|5680|5680| 				{
|5681|5681| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5682|5682| 					var targetClasses = this.order.data.targetClasses;
|5683|    |-					if (targetClasses.attack && cmpIdentity
|5684|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5683|+					if (targetClasses.attack && cmpIdentity &&
|    |5684|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5685|5685| 						continue;
|5686|5686| 					if (targetClasses.avoid && cmpIdentity
|5687|5687| 						&& 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
|5683|5683| 					if (targetClasses.attack && cmpIdentity
|5684|5684| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5685|5685| 						continue;
|5686|    |-					if (targetClasses.avoid && cmpIdentity
|5687|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5686|+					if (targetClasses.avoid && cmpIdentity &&
|    |5687|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5688|5688| 						continue;
|5689|5689| 					// Only used by the AIs to prevent some choices of targets
|5690|5690| 					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
|5706|5706| 		{
|5707|5707| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5708|5708| 			var targetClasses = this.order.data.targetClasses;
|5709|    |-			if (cmpIdentity && targetClasses.attack
|5710|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5709|+			if (cmpIdentity && targetClasses.attack &&
|    |5710|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5711|5711| 				continue;
|5712|5712| 			if (cmpIdentity && targetClasses.avoid
|5713|5713| 				&& 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
|5709|5709| 			if (cmpIdentity && targetClasses.attack
|5710|5710| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5711|5711| 				continue;
|5712|    |-			if (cmpIdentity && targetClasses.avoid
|5713|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5712|+			if (cmpIdentity && targetClasses.avoid &&
|    |5713|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5714|5714| 				continue;
|5715|5715| 			// Only used by the AIs to prevent some choices of targets
|5716|5716| 			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
|5866|5866| 
|5867|5867| UnitAI.prototype.SetHeldPosition = function(x, z)
|5868|5868| {
|5869|    |-	this.heldPosition = {"x": x, "z": z};
|    |5869|+	this.heldPosition = { "x": x, "z": z};
|5870|5870| };
|5871|5871| 
|5872|5872| 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
|5866|5866| 
|5867|5867| UnitAI.prototype.SetHeldPosition = function(x, z)
|5868|5868| {
|5869|    |-	this.heldPosition = {"x": x, "z": z};
|    |5869|+	this.heldPosition = {"x": x, "z": z };
|5870|5870| };
|5871|5871| 
|5872|5872| 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
|5893|5893| 	return false;
|5894|5894| };
|5895|5895| 
|5896|    |-//// Helper functions ////
|    |5896|+// // Helper functions ////
|5897|5897| 
|5898|5898| UnitAI.prototype.CanAttack = function(target)
|5899|5899| {
|    | [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
|6097|6097| 	return cmpPack && cmpPack.IsPacking();
|6098|6098| };
|6099|6099| 
|6100|    |-//// Formation specific functions ////
|    |6100|+// // Formation specific functions ////
|6101|6101| 
|6102|6102| UnitAI.prototype.IsAttackingAsFormation = function()
|6103|6103| {
|    | [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
|6102|6102| UnitAI.prototype.IsAttackingAsFormation = function()
|6103|6103| {
|6104|6104| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6105|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6106|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6105|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6106|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6107|6107| };
|6108|6108| 
|6109|6109| //// 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
|6106|6106| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6107|6107| };
|6108|6108| 
|6109|    |-//// Animal specific functions ////
|    |6109|+// // Animal specific functions ////
|6110|6110| 
|6111|6111| UnitAI.prototype.MoveRandomly = function(distance)
|6112|6112| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3922| »   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
|4768| »   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
|4783| »   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
|4829| »   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
|4852| »   »   ····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
|2036| »   »   »   »   »   »   &&·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
|3066| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4785| »   »   &&·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
|4786| »   »   &&·(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
|5684| »   »   »   »   »   »   &&·!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
|5687| »   »   »   »   »   »   &&·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
|5700| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

Freagarach added inline comments.Sun, Jan 12, 1:08 PM
binaries/data/mods/public/simulation/helpers/Attacking.js
289

I will add a new property for correctness.

Freagarach updated this revision to Diff 11009.Mon, Jan 13, 8:39 PM
Freagarach marked an inline comment as done.

Add new property for StatusEffects to disallow XP gain by SE.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.

binaries/data/mods/public/simulation/helpers/Transform.js
| 225| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' 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
| 782| 782| 					this.FinishOrder();
| 783| 783| 					return;
| 784| 784| 				}
| 785|    |-				else
| 786|    |-				{
|    | 785|+				
| 787| 786| 					this.SetNextState("GARRISON.APPROACHING");
| 788| 787| 					return;
| 789|    |-				}
|    | 788|+				
| 790| 789| 			}
| 791| 790| 
| 792| 791| 			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
|1054|1054| 			},
|1055|1055| 		},
|1056|1056| 
|1057|    |-		"GARRISON":{
|    |1057|+		"GARRISON": {
|1058|1058| 			"APPROACHING": {
|1059|1059| 				"enter": function() {
|1060|1060| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2032|2032| 
|2033|2033| 				"Attacked": function(msg) {
|2034|2034| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2035|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2036|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2035|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2036|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2037|2037| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2038|2038| 				},
|2039|2039| 			},
|    | [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
|2768|2768| 					{
|2769|2769| 						// The building was already finished/fully repaired before we arrived;
|2770|2770| 						// let the ConstructionFinished handler handle this.
|2771|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2771|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2772|2772| 						return true;
|2773|2773| 					}
|2774|2774| 
|    | [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
|2768|2768| 					{
|2769|2769| 						// The building was already finished/fully repaired before we arrived;
|2770|2770| 						// let the ConstructionFinished handler handle this.
|2771|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2771|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2772|2772| 						return true;
|2773|2773| 					}
|2774|2774| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3066|3066| 				this.StopTimer();
|3067|3067| 				this.ResetAnimation();
|3068|3068| 				if (this.formationAnimationVariant)
|3069|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3069|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3070|3070| 				else
|3071|3071| 					this.SetDefaultAnimationVariant();
|3072|3072| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3292|3292| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3293|3293| 
|3294|3294| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3295|    |-							// only used for domestic animals
|    |3295|+		// only used for domestic animals
|3296|3296| 	},
|3297|3297| };
|3298|3298| 
|    | [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
|3351|3351| 
|3352|3352| UnitAI.prototype.IsAnimal = function()
|3353|3353| {
|3354|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3354|+	return (!!this.template.NaturalBehaviour);
|3355|3355| };
|3356|3356| 
|3357|3357| 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
|3467|3467| 		{
|3468|3468| 			let index = this.GetCurrentState().indexOf(".");
|3469|3469| 			if (index != -1)
|3470|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3470|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3471|3471| 			this.Stop(false);
|3472|3472| 		}
|3473|3473| 
|    | [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
|3523|3523| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3524|3524| 			continue;
|3525|3525| 		if (i == 0)
|3526|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3526|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3527|3527| 		else
|3528|3528| 			this.orderQueue.splice(i, 1);
|3529|3529| 		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
|3523|3523| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3524|3524| 			continue;
|3525|3525| 		if (i == 0)
|3526|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3526|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3527|3527| 		else
|3528|3528| 			this.orderQueue.splice(i, 1);
|3529|3529| 		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
|3607|3607| };
|3608|3608| 
|3609|3609| 
|3610|    |-//// FSM linkage functions ////
|    |3610|+// // FSM linkage functions ////
|3611|3611| 
|3612|3612| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3613|3613| 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
|3778|3778| 				continue;
|3779|3779| 			if (this.orderQueue[i].type == type)
|3780|3780| 				continue;
|3781|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3781|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3782|3782| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3783|3783| 			return;
|3784|3784| 		}
|    | [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
|3778|3778| 				continue;
|3779|3779| 			if (this.orderQueue[i].type == type)
|3780|3780| 				continue;
|3781|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3781|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3782|3782| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3783|3783| 			return;
|3784|3784| 		}
|    | [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
|4020|4020| 	if (data.timerRepeat === undefined)
|4021|4021| 		this.timer = undefined;
|4022|4022| 
|4023|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4023|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4024|4024| };
|4025|4025| 
|4026|4026| /**
|    | [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
|4020|4020| 	if (data.timerRepeat === undefined)
|4021|4021| 		this.timer = undefined;
|4022|4022| 
|4023|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4023|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4024|4024| };
|4025|4025| 
|4026|4026| /**
|    | [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
|4065|4065| 	// TODO: This is a bit inefficient since every unit listens to every
|4066|4066| 	// construction message - ideally we could scope it to only the one we're building
|4067|4067| 
|4068|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4068|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4069|4069| };
|4070|4070| 
|4071|4071| 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
|4065|4065| 	// TODO: This is a bit inefficient since every unit listens to every
|4066|4066| 	// construction message - ideally we could scope it to only the one we're building
|4067|4067| 
|4068|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4068|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4069|4069| };
|4070|4070| 
|4071|4071| 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
|4093|4093| 	if (msg.fromStatusEffect)
|4094|4094| 		return;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4096|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4097|4097| };
|4098|4098| 
|4099|4099| 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
|4093|4093| 	if (msg.fromStatusEffect)
|4094|4094| 		return;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4096|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4097|4097| };
|4098|4098| 
|4099|4099| 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
|4098|4098| 
|4099|4099| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4100|4100| {
|4101|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4101|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4102|4102| };
|4103|4103| 
|4104|4104| 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
|4098|4098| 
|4099|4099| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4100|4100| {
|4101|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4101|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4102|4102| };
|4103|4103| 
|4104|4104| 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
|4103|4103| 
|4104|4104| UnitAI.prototype.OnHealthChanged = function(msg)
|4105|4105| {
|4106|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4106|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4107|4107| };
|4108|4108| 
|4109|4109| 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
|4103|4103| 
|4104|4104| UnitAI.prototype.OnHealthChanged = function(msg)
|4105|4105| {
|4106|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4106|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4107|4107| };
|4108|4108| 
|4109|4109| 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
|4109|4109| UnitAI.prototype.OnRangeUpdate = function(msg)
|4110|4110| {
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4112|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|4114| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|    | [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
|4109|4109| UnitAI.prototype.OnRangeUpdate = function(msg)
|4110|4110| {
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4112|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|4114| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|    | [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
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|4112| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4114|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|4116|4116| 
|4117|4117| 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
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|4112| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4114|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4115|4115| };
|4116|4116| 
|4117|4117| 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
|4116|4116| 
|4117|4117| UnitAI.prototype.OnPackFinished = function(msg)
|4118|4118| {
|4119|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4119|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4120|4120| };
|4121|4121| 
|4122|4122| //// 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
|4116|4116| 
|4117|4117| UnitAI.prototype.OnPackFinished = function(msg)
|4118|4118| {
|4119|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4119|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4120|4120| };
|4121|4121| 
|4122|4122| //// 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
|4119|4119| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4120|4120| };
|4121|4121| 
|4122|    |-//// Helper functions to be called by the FSM ////
|    |4122|+// // Helper functions to be called by the FSM ////
|4123|4123| 
|4124|4124| UnitAI.prototype.GetWalkSpeed = function()
|4125|4125| {
|    | [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
|4784|4784| UnitAI.prototype.AttackEntityInZone = function(ents)
|4785|4785| {
|4786|4786| 	var target = ents.find(target =>
|4787|    |-		this.CanAttack(target)
|4788|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4787|+		this.CanAttack(target) &&
|    |4788|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4789|4789| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4790|4790| 	);
|4791|4791| 	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
|4785|4785| {
|4786|4786| 	var target = ents.find(target =>
|4787|4787| 		this.CanAttack(target)
|4788|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4789|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4788|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4789|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4790|4790| 	);
|4791|4791| 	if (!target)
|4792|4792| 		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
|4849|4849| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4850|4850| 	if (this.isGuardOf)
|4851|4851| 	{
|4852|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4852|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4853|4853| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4854|4854| 		if (cmpUnitAI && cmpAttack &&
|4855|4855| 		    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
|4853|4853| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4854|4854| 		if (cmpUnitAI && cmpAttack &&
|4855|4855| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4856|    |-				return false;
|    |4856|+			return false;
|4857|4857| 	}
|4858|4858| 
|4859|4859| 	// 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
|4891|4891| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4892|4892| 	if (this.isGuardOf)
|4893|4893| 	{
|4894|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4894|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4895|4895| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4896|4896| 		if (cmpUnitAI && cmpAttack &&
|4897|4897| 		    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
|4904|4904| 	return false;
|4905|4905| };
|4906|4906| 
|4907|    |-//// External interface functions ////
|    |4907|+// // External interface functions ////
|4908|4908| 
|4909|4909| UnitAI.prototype.SetFormationController = function(ent)
|4910|4910| {
|    | [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
|5060|5060| 	{
|5061|5061| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5062|5062| 			return;
|5063|    |-		else
|5064|    |-			this.RemoveGuard();
|    |5063|+		this.RemoveGuard();
|5065|5064| 	}
|5066|5065| 
|5067|5066| 	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
|5402|5402| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5403|5403| 	{
|5404|5404| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5405|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5405|+		if (cmpTrader.HasBothMarkets() &&
|5406|5406| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5407|5407| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5408|5408| 		{
|    | [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
|5683|5683| 				{
|5684|5684| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5685|5685| 					var targetClasses = this.order.data.targetClasses;
|5686|    |-					if (targetClasses.attack && cmpIdentity
|5687|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5686|+					if (targetClasses.attack && cmpIdentity &&
|    |5687|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5688|5688| 						continue;
|5689|5689| 					if (targetClasses.avoid && cmpIdentity
|5690|5690| 						&& 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
|5686|5686| 					if (targetClasses.attack && cmpIdentity
|5687|5687| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5688|5688| 						continue;
|5689|    |-					if (targetClasses.avoid && cmpIdentity
|5690|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5689|+					if (targetClasses.avoid && cmpIdentity &&
|    |5690|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5691|5691| 						continue;
|5692|5692| 					// Only used by the AIs to prevent some choices of targets
|5693|5693| 					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
|5709|5709| 		{
|5710|5710| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5711|5711| 			var targetClasses = this.order.data.targetClasses;
|5712|    |-			if (cmpIdentity && targetClasses.attack
|5713|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5712|+			if (cmpIdentity && targetClasses.attack &&
|    |5713|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5714|5714| 				continue;
|5715|5715| 			if (cmpIdentity && targetClasses.avoid
|5716|5716| 				&& 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
|5712|5712| 			if (cmpIdentity && targetClasses.attack
|5713|5713| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5714|5714| 				continue;
|5715|    |-			if (cmpIdentity && targetClasses.avoid
|5716|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5715|+			if (cmpIdentity && targetClasses.avoid &&
|    |5716|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5717|5717| 				continue;
|5718|5718| 			// Only used by the AIs to prevent some choices of targets
|5719|5719| 			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
|5869|5869| 
|5870|5870| UnitAI.prototype.SetHeldPosition = function(x, z)
|5871|5871| {
|5872|    |-	this.heldPosition = {"x": x, "z": z};
|    |5872|+	this.heldPosition = { "x": x, "z": z};
|5873|5873| };
|5874|5874| 
|5875|5875| 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
|5869|5869| 
|5870|5870| UnitAI.prototype.SetHeldPosition = function(x, z)
|5871|5871| {
|5872|    |-	this.heldPosition = {"x": x, "z": z};
|    |5872|+	this.heldPosition = {"x": x, "z": z };
|5873|5873| };
|5874|5874| 
|5875|5875| 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
|5896|5896| 	return false;
|5897|5897| };
|5898|5898| 
|5899|    |-//// Helper functions ////
|    |5899|+// // Helper functions ////
|5900|5900| 
|5901|5901| UnitAI.prototype.CanAttack = function(target)
|5902|5902| {
|    | [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
|6100|6100| 	return cmpPack && cmpPack.IsPacking();
|6101|6101| };
|6102|6102| 
|6103|    |-//// Formation specific functions ////
|    |6103|+// // Formation specific functions ////
|6104|6104| 
|6105|6105| UnitAI.prototype.IsAttackingAsFormation = function()
|6106|6106| {
|    | [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
|6105|6105| UnitAI.prototype.IsAttackingAsFormation = function()
|6106|6106| {
|6107|6107| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6108|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6109|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6108|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6109|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6110|6110| };
|6111|6111| 
|6112|6112| //// 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
|6109|6109| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6110|6110| };
|6111|6111| 
|6112|    |-//// Animal specific functions ////
|    |6112|+// // Animal specific functions ////
|6113|6113| 
|6114|6114| UnitAI.prototype.MoveRandomly = function(distance)
|6115|6115| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3925| »   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
|4771| »   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
|4786| »   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
|4832| »   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
|4855| »   »   ····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
|2036| »   »   »   »   »   »   &&·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
|3069| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4788| »   »   &&·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
|4789| »   »   &&·(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
|5687| »   »   »   »   »   »   &&·!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
|5690| »   »   »   »   »   »   &&·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
|5703| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/129/display/redirect

Freagarach updated this revision to Diff 11055.Thu, Jan 16, 8:09 PM
Freagarach edited the summary of this revision. (Show Details)
Freagarach edited the test plan for this revision. (Show Details)

Remove GUI-icons when an entity dies.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/tests/test_Pack.js
|  43| »   "SetInterval":·(ent,·iid,·funcname,·time,·repeattime,·data)·=>·{·timerActivated·=·true;·return·7;·}
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.

binaries/data/mods/public/simulation/helpers/Transform.js
| 225| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [NORMAL] ESLintBear (no-undef-init):
|    | It's not necessary to initialize 'civPermitted' to undefined.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Technologies.js
| 151| 151| 
| 152| 152| 	case "all":
| 153| 153| 	{
| 154|    |-		let civPermitted = undefined; // tri-state (undefined, false, or true)
|    | 154|+		let civPermitted; // tri-state (undefined, false, or true)
| 155| 155| 		for (let subvalue of value)
| 156| 156| 		{
| 157| 157| 			let newOper = Object.keys(subvalue)[0];

binaries/data/mods/public/globalscripts/Technologies.js
| 161| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 235| »   »   »   switch·(newOper)
|    | [NORMAL] ESLintBear (default-case):
|    | Expected a default case.

binaries/data/mods/public/globalscripts/Technologies.js
| 154| »   »   let·civPermitted·=·undefined;·//·tri-state·(undefined,·false,·or·true)
|    | [NORMAL] JSHintBear:
|    | It's not necessary to initialize 'civPermitted' to 'undefined'.

binaries/data/mods/public/globalscripts/Technologies.js
| 177| »   »   »   »   »   return·false;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 187| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 256| »   »   »   »   }
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.

binaries/data/mods/public/globalscripts/Technologies.js
| 262| »   »   »   »   civPermitted·=·true;
|    | [NORMAL] JSHintBear:
|    | Expected a 'break' statement before 'case'.
|    | [NORMAL] ESLintBear (operator-linebreak):
|    | '||' should be placed at the end of the line.
|----|    | /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/globalscripts/Templates.js
|  87|  87| 		// If the elements are still strings, split them by space or by '+'
|  88|  88| 		if (typeof sublist == "string")
|  89|  89| 			sublist = sublist.split(/[+\s]+/);
|  90|    |-		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1)
|  91|    |-		                    || (c[0] != "!" && classes.indexOf(c) != -1)))
|    |  90|+		if (sublist.every(c => (c[0] == "!" && classes.indexOf(c.substr(1)) == -1) ||
|    |  91|+		                    (c[0] != "!" && classes.indexOf(c) != -1)))
|  92|  92| 			return true;
|  93|  93| 	}
|  94|  94| 

binaries/data/mods/public/globalscripts/Templates.js
|  91| »   »   ····················||·(c[0]·!=·"!"·&&·classes.indexOf(c)·!=·-1)))
|    | [NORMAL] JSHintBear:
|    | Misleading line break before '||'; readers may interpret this as an expression boundary.
|    | [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
| 782| 782| 					this.FinishOrder();
| 783| 783| 					return;
| 784| 784| 				}
| 785|    |-				else
| 786|    |-				{
|    | 785|+				
| 787| 786| 					this.SetNextState("GARRISON.APPROACHING");
| 788| 787| 					return;
| 789|    |-				}
|    | 788|+				
| 790| 789| 			}
| 791| 790| 
| 792| 791| 			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
|1054|1054| 			},
|1055|1055| 		},
|1056|1056| 
|1057|    |-		"GARRISON":{
|    |1057|+		"GARRISON": {
|1058|1058| 			"APPROACHING": {
|1059|1059| 				"enter": function() {
|1060|1060| 					if (!this.MoveToGarrisonRange(this.order.data.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
|2032|2032| 
|2033|2033| 				"Attacked": function(msg) {
|2034|2034| 					// If we are capturing and are attacked by something that we would not capture, attack that entity instead
|2035|    |-					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force)
|2036|    |-						&& this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|    |2035|+					if (this.order.data.attackType == "Capture" && (this.GetStance().targetAttackersAlways || !this.order.data.force) &&
|    |2036|+						this.order.data.target != msg.data.attacker && this.GetBestAttackAgainst(msg.data.attacker, true) != "Capture")
|2037|2037| 						this.RespondToTargetedEntities([msg.data.attacker]);
|2038|2038| 				},
|2039|2039| 			},
|    | [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
|2768|2768| 					{
|2769|2769| 						// The building was already finished/fully repaired before we arrived;
|2770|2770| 						// let the ConstructionFinished handler handle this.
|2771|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2771|+						this.OnGlobalConstructionFinished({ "entity": this.repairTarget, "newentity": this.repairTarget});
|2772|2772| 						return true;
|2773|2773| 					}
|2774|2774| 
|    | [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
|2768|2768| 					{
|2769|2769| 						// The building was already finished/fully repaired before we arrived;
|2770|2770| 						// let the ConstructionFinished handler handle this.
|2771|    |-						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget});
|    |2771|+						this.OnGlobalConstructionFinished({"entity": this.repairTarget, "newentity": this.repairTarget });
|2772|2772| 						return true;
|2773|2773| 					}
|2774|2774| 
|    | [NORMAL] ESLintBear (semi):
|    | Missing semicolon.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/UnitAI.js
|3066|3066| 				this.StopTimer();
|3067|3067| 				this.ResetAnimation();
|3068|3068| 				if (this.formationAnimationVariant)
|3069|    |-					this.SetAnimationVariant(this.formationAnimationVariant)
|    |3069|+					this.SetAnimationVariant(this.formationAnimationVariant);
|3070|3070| 				else
|3071|3071| 					this.SetDefaultAnimationVariant();
|3072|3072| 				var cmpResistance = Engine.QueryInterface(this.entity, IID_Resistance);
|    | [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
|3292|3292| 		"COMBAT": "INDIVIDUAL.COMBAT", // reuse the same combat behaviour for animals
|3293|3293| 
|3294|3294| 		"WALKING": "INDIVIDUAL.WALKING",	// reuse the same walking behaviour for animals
|3295|    |-							// only used for domestic animals
|    |3295|+		// only used for domestic animals
|3296|3296| 	},
|3297|3297| };
|3298|3298| 
|    | [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
|3351|3351| 
|3352|3352| UnitAI.prototype.IsAnimal = function()
|3353|3353| {
|3354|    |-	return (this.template.NaturalBehaviour ? true : false);
|    |3354|+	return (!!this.template.NaturalBehaviour);
|3355|3355| };
|3356|3356| 
|3357|3357| 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
|3467|3467| 		{
|3468|3468| 			let index = this.GetCurrentState().indexOf(".");
|3469|3469| 			if (index != -1)
|3470|    |-				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0,index));
|    |3470|+				this.UnitFsm.SwitchToNextState(this, this.GetCurrentState().slice(0, index));
|3471|3471| 			this.Stop(false);
|3472|3472| 		}
|3473|3473| 
|    | [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
|3523|3523| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3524|3524| 			continue;
|3525|3525| 		if (i == 0)
|3526|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3526|+			this.UnitFsm.ProcessMessage(this, { "type": "PickupCanceled", "data": msg});
|3527|3527| 		else
|3528|3528| 			this.orderQueue.splice(i, 1);
|3529|3529| 		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
|3523|3523| 		if (this.orderQueue[i].type != "PickupUnit" || this.orderQueue[i].data.target != msg.entity)
|3524|3524| 			continue;
|3525|3525| 		if (i == 0)
|3526|    |-			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg});
|    |3526|+			this.UnitFsm.ProcessMessage(this, {"type": "PickupCanceled", "data": msg });
|3527|3527| 		else
|3528|3528| 			this.orderQueue.splice(i, 1);
|3529|3529| 		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
|3607|3607| };
|3608|3608| 
|3609|3609| 
|3610|    |-//// FSM linkage functions ////
|    |3610|+// // FSM linkage functions ////
|3611|3611| 
|3612|3612| // Setting the next state to the current state will leave/re-enter the top-most substate.
|3613|3613| 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
|3778|3778| 				continue;
|3779|3779| 			if (this.orderQueue[i].type == type)
|3780|3780| 				continue;
|3781|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3781|+			this.orderQueue.splice(i, 0, { "type": type, "data": data});
|3782|3782| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3783|3783| 			return;
|3784|3784| 		}
|    | [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
|3778|3778| 				continue;
|3779|3779| 			if (this.orderQueue[i].type == type)
|3780|3780| 				continue;
|3781|    |-			this.orderQueue.splice(i, 0, {"type": type, "data": data});
|    |3781|+			this.orderQueue.splice(i, 0, {"type": type, "data": data });
|3782|3782| 			Engine.PostMessage(this.entity, MT_UnitAIOrderDataChanged, { "to": this.GetOrderData() });
|3783|3783| 			return;
|3784|3784| 		}
|    | [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
|4020|4020| 	if (data.timerRepeat === undefined)
|4021|4021| 		this.timer = undefined;
|4022|4022| 
|4023|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4023|+	this.UnitFsm.ProcessMessage(this, { "type": "Timer", "data": data, "lateness": lateness});
|4024|4024| };
|4025|4025| 
|4026|4026| /**
|    | [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
|4020|4020| 	if (data.timerRepeat === undefined)
|4021|4021| 		this.timer = undefined;
|4022|4022| 
|4023|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness});
|    |4023|+	this.UnitFsm.ProcessMessage(this, {"type": "Timer", "data": data, "lateness": lateness });
|4024|4024| };
|4025|4025| 
|4026|4026| /**
|    | [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
|4065|4065| 	// TODO: This is a bit inefficient since every unit listens to every
|4066|4066| 	// construction message - ideally we could scope it to only the one we're building
|4067|4067| 
|4068|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4068|+	this.UnitFsm.ProcessMessage(this, { "type": "ConstructionFinished", "data": msg});
|4069|4069| };
|4070|4070| 
|4071|4071| 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
|4065|4065| 	// TODO: This is a bit inefficient since every unit listens to every
|4066|4066| 	// construction message - ideally we could scope it to only the one we're building
|4067|4067| 
|4068|    |-	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg});
|    |4068|+	this.UnitFsm.ProcessMessage(this, {"type": "ConstructionFinished", "data": msg });
|4069|4069| };
|4070|4070| 
|4071|4071| 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
|4093|4093| 	if (msg.fromStatusEffect)
|4094|4094| 		return;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4096|+	this.UnitFsm.ProcessMessage(this, { "type": "Attacked", "data": msg});
|4097|4097| };
|4098|4098| 
|4099|4099| 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
|4093|4093| 	if (msg.fromStatusEffect)
|4094|4094| 		return;
|4095|4095| 
|4096|    |-	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg});
|    |4096|+	this.UnitFsm.ProcessMessage(this, {"type": "Attacked", "data": msg });
|4097|4097| };
|4098|4098| 
|4099|4099| 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
|4098|4098| 
|4099|4099| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4100|4100| {
|4101|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4101|+	this.UnitFsm.ProcessMessage(this, { "type": "GuardedAttacked", "data": msg.data});
|4102|4102| };
|4103|4103| 
|4104|4104| 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
|4098|4098| 
|4099|4099| UnitAI.prototype.OnGuardedAttacked = function(msg)
|4100|4100| {
|4101|    |-	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data});
|    |4101|+	this.UnitFsm.ProcessMessage(this, {"type": "GuardedAttacked", "data": msg.data });
|4102|4102| };
|4103|4103| 
|4104|4104| 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
|4103|4103| 
|4104|4104| UnitAI.prototype.OnHealthChanged = function(msg)
|4105|4105| {
|4106|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4106|+	this.UnitFsm.ProcessMessage(this, { "type": "HealthChanged", "from": msg.from, "to": msg.to});
|4107|4107| };
|4108|4108| 
|4109|4109| 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
|4103|4103| 
|4104|4104| UnitAI.prototype.OnHealthChanged = function(msg)
|4105|4105| {
|4106|    |-	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to});
|    |4106|+	this.UnitFsm.ProcessMessage(this, {"type": "HealthChanged", "from": msg.from, "to": msg.to });
|4107|4107| };
|4108|4108| 
|4109|4109| 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
|4109|4109| UnitAI.prototype.OnRangeUpdate = function(msg)
|4110|4110| {
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4112|+		this.UnitFsm.ProcessMessage(this, { "type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|4114| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|    | [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
|4109|4109| UnitAI.prototype.OnRangeUpdate = function(msg)
|4110|4110| {
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|    |4112|+		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg });
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|4114| 		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|    | [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
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|4112| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4114|+		this.UnitFsm.ProcessMessage(this, { "type": "LosHealRangeUpdate", "data": msg});
|4115|4115| };
|4116|4116| 
|4117|4117| 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
|4111|4111| 	if (msg.tag == this.losRangeQuery)
|4112|4112| 		this.UnitFsm.ProcessMessage(this, {"type": "LosRangeUpdate", "data": msg});
|4113|4113| 	else if (msg.tag == this.losHealRangeQuery)
|4114|    |-		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg});
|    |4114|+		this.UnitFsm.ProcessMessage(this, {"type": "LosHealRangeUpdate", "data": msg });
|4115|4115| };
|4116|4116| 
|4117|4117| 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
|4116|4116| 
|4117|4117| UnitAI.prototype.OnPackFinished = function(msg)
|4118|4118| {
|4119|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4119|+	this.UnitFsm.ProcessMessage(this, { "type": "PackFinished", "packed": msg.packed});
|4120|4120| };
|4121|4121| 
|4122|4122| //// 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
|4116|4116| 
|4117|4117| UnitAI.prototype.OnPackFinished = function(msg)
|4118|4118| {
|4119|    |-	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|    |4119|+	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed });
|4120|4120| };
|4121|4121| 
|4122|4122| //// 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
|4119|4119| 	this.UnitFsm.ProcessMessage(this, {"type": "PackFinished", "packed": msg.packed});
|4120|4120| };
|4121|4121| 
|4122|    |-//// Helper functions to be called by the FSM ////
|    |4122|+// // Helper functions to be called by the FSM ////
|4123|4123| 
|4124|4124| UnitAI.prototype.GetWalkSpeed = function()
|4125|4125| {
|    | [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
|4784|4784| UnitAI.prototype.AttackEntityInZone = function(ents)
|4785|4785| {
|4786|4786| 	var target = ents.find(target =>
|4787|    |-		this.CanAttack(target)
|4788|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|    |4787|+		this.CanAttack(target) &&
|    |4788|+		this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4789|4789| 		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4790|4790| 	);
|4791|4791| 	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
|4785|4785| {
|4786|4786| 	var target = ents.find(target =>
|4787|4787| 		this.CanAttack(target)
|4788|    |-		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true))
|4789|    |-		&& (this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|    |4788|+		&& this.CheckTargetDistanceFromHeldPosition(target, IID_Attack, this.GetBestAttackAgainst(target, true)) &&
|    |4789|+		(this.GetStance().respondChaseBeyondVision || this.CheckTargetIsInVisionRange(target))
|4790|4790| 	);
|4791|4791| 	if (!target)
|4792|4792| 		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
|4849|4849| 	// If we are guarding/escorting, don't abandon as long as the guarded unit is in target range of the attacker
|4850|4850| 	if (this.isGuardOf)
|4851|4851| 	{
|4852|    |-		var cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4852|+		var cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4853|4853| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4854|4854| 		if (cmpUnitAI && cmpAttack &&
|4855|4855| 		    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
|4853|4853| 		var cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4854|4854| 		if (cmpUnitAI && cmpAttack &&
|4855|4855| 		    cmpAttack.GetAttackTypes().some(type => cmpUnitAI.CheckTargetAttackRange(this.isGuardOf, type)))
|4856|    |-				return false;
|    |4856|+			return false;
|4857|4857| 	}
|4858|4858| 
|4859|4859| 	// 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
|4891|4891| 	// If we are guarding/escorting, chase at least as long as the guarded unit is in target range of the attacker
|4892|4892| 	if (this.isGuardOf)
|4893|4893| 	{
|4894|    |-		let cmpUnitAI =  Engine.QueryInterface(target, IID_UnitAI);
|    |4894|+		let cmpUnitAI = Engine.QueryInterface(target, IID_UnitAI);
|4895|4895| 		let cmpAttack = Engine.QueryInterface(target, IID_Attack);
|4896|4896| 		if (cmpUnitAI && cmpAttack &&
|4897|4897| 		    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
|4904|4904| 	return false;
|4905|4905| };
|4906|4906| 
|4907|    |-//// External interface functions ////
|    |4907|+// // External interface functions ////
|4908|4908| 
|4909|4909| UnitAI.prototype.SetFormationController = function(ent)
|4910|4910| {
|    | [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
|5060|5060| 	{
|5061|5061| 		if (this.isGuardOf == target && this.order && this.order.type == "Guard")
|5062|5062| 			return;
|5063|    |-		else
|5064|    |-			this.RemoveGuard();
|    |5063|+		this.RemoveGuard();
|5065|5064| 	}
|5066|5065| 
|5067|5066| 	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
|5402|5402| 	    this.workOrders.length && this.workOrders[0].type == "Trade")
|5403|5403| 	{
|5404|5404| 		let cmpTrader = Engine.QueryInterface(this.entity, IID_Trader);
|5405|    |-		if (cmpTrader.HasBothMarkets() && 
|    |5405|+		if (cmpTrader.HasBothMarkets() &&
|5406|5406| 		   (cmpTrader.GetFirstMarket() == target && cmpTrader.GetSecondMarket() == source ||
|5407|5407| 		    cmpTrader.GetFirstMarket() == source && cmpTrader.GetSecondMarket() == target))
|5408|5408| 		{
|    | [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
|5683|5683| 				{
|5684|5684| 					var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5685|5685| 					var targetClasses = this.order.data.targetClasses;
|5686|    |-					if (targetClasses.attack && cmpIdentity
|5687|    |-						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5686|+					if (targetClasses.attack && cmpIdentity &&
|    |5687|+						!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5688|5688| 						continue;
|5689|5689| 					if (targetClasses.avoid && cmpIdentity
|5690|5690| 						&& 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
|5686|5686| 					if (targetClasses.attack && cmpIdentity
|5687|5687| 						&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5688|5688| 						continue;
|5689|    |-					if (targetClasses.avoid && cmpIdentity
|5690|    |-						&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5689|+					if (targetClasses.avoid && cmpIdentity &&
|    |5690|+						MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5691|5691| 						continue;
|5692|5692| 					// Only used by the AIs to prevent some choices of targets
|5693|5693| 					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
|5709|5709| 		{
|5710|5710| 			var cmpIdentity = Engine.QueryInterface(targ, IID_Identity);
|5711|5711| 			var targetClasses = this.order.data.targetClasses;
|5712|    |-			if (cmpIdentity && targetClasses.attack
|5713|    |-				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|    |5712|+			if (cmpIdentity && targetClasses.attack &&
|    |5713|+				!MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5714|5714| 				continue;
|5715|5715| 			if (cmpIdentity && targetClasses.avoid
|5716|5716| 				&& 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
|5712|5712| 			if (cmpIdentity && targetClasses.attack
|5713|5713| 				&& !MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.attack))
|5714|5714| 				continue;
|5715|    |-			if (cmpIdentity && targetClasses.avoid
|5716|    |-				&& MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|    |5715|+			if (cmpIdentity && targetClasses.avoid &&
|    |5716|+				MatchesClassList(cmpIdentity.GetClassesList(), targetClasses.avoid))
|5717|5717| 				continue;
|5718|5718| 			// Only used by the AIs to prevent some choices of targets
|5719|5719| 			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
|5869|5869| 
|5870|5870| UnitAI.prototype.SetHeldPosition = function(x, z)
|5871|5871| {
|5872|    |-	this.heldPosition = {"x": x, "z": z};
|    |5872|+	this.heldPosition = { "x": x, "z": z};
|5873|5873| };
|5874|5874| 
|5875|5875| 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
|5869|5869| 
|5870|5870| UnitAI.prototype.SetHeldPosition = function(x, z)
|5871|5871| {
|5872|    |-	this.heldPosition = {"x": x, "z": z};
|    |5872|+	this.heldPosition = {"x": x, "z": z };
|5873|5873| };
|5874|5874| 
|5875|5875| 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
|5896|5896| 	return false;
|5897|5897| };
|5898|5898| 
|5899|    |-//// Helper functions ////
|    |5899|+// // Helper functions ////
|5900|5900| 
|5901|5901| UnitAI.prototype.CanAttack = function(target)
|5902|5902| {
|    | [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
|6100|6100| 	return cmpPack && cmpPack.IsPacking();
|6101|6101| };
|6102|6102| 
|6103|    |-//// Formation specific functions ////
|    |6103|+// // Formation specific functions ////
|6104|6104| 
|6105|6105| UnitAI.prototype.IsAttackingAsFormation = function()
|6106|6106| {
|    | [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
|6105|6105| UnitAI.prototype.IsAttackingAsFormation = function()
|6106|6106| {
|6107|6107| 	var cmpAttack = Engine.QueryInterface(this.entity, IID_Attack);
|6108|    |-	return cmpAttack && cmpAttack.CanAttackAsFormation()
|6109|    |-		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|    |6108|+	return cmpAttack && cmpAttack.CanAttackAsFormation() &&
|    |6109|+		this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6110|6110| };
|6111|6111| 
|6112|6112| //// 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
|6109|6109| 		&& this.GetCurrentState() == "FORMATIONCONTROLLER.COMBAT.ATTACKING";
|6110|6110| };
|6111|6111| 
|6112|    |-//// Animal specific functions ////
|    |6112|+// // Animal specific functions ////
|6113|6113| 
|6114|6114| UnitAI.prototype.MoveRandomly = function(distance)
|6115|6115| {

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|3925| »   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
|4771| »   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
|4786| »   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
|4832| »   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
|4855| »   »   ····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
|2036| »   »   »   »   »   »   &&·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
|3069| »   »   »   »   »   this.SetAnimationVariant(this.formationAnimationVariant)
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.

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

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

binaries/data/mods/public/simulation/components/UnitAI.js
|4788| »   »   &&·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
|4789| »   »   &&·(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
|5687| »   »   »   »   »   »   &&·!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
|5690| »   »   »   »   »   »   &&·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
|5703| »   var·targets·=·this.GetTargetsFromUnit();
|    | [NORMAL] JSHintBear:
|    | 'targets' is already defined.

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

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

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

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

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

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

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

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

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

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/161/display/redirect

Freagarach updated this revision to Diff 11073.Fri, Jan 17, 8:12 PM

Revert template change.

Build failure - The Moirai have given mortals hearts that can endure.

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

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

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

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

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/168/display/redirect