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
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.


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.

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.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Freagarach edited the summary of this revision. (Show Details)Sep 17 2019, 9:33 AM
  • Fixed UnitAI fleeing bug. Done by not sending Attacked-message, when attacker == -1. I reckon this is safe because AIProxy, UnitAI and Guard components listen to this message and it seems logical that they can't handle attacker == -1 anyways.
  • Force an interval so that when an effect has a duration the progress can still be displayed in the GUI. This has a caveat namely that one can specify Damage and intentionally no Interval but still an Interval will be present. (Which is good because Damage without Interval is nonsense.)
  • Cleaned the ModificationSchema.

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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/730/display/redirect

Angen added inline comments.Sep 17 2019, 9:41 AM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
133

INVALID_ENTITY, INVALID_PLAYER

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

INVALID_ENTITY

Freagarach updated this revision to Diff 9849.EditedSep 19 2019, 8:31 AM
Freagarach marked 4 inline comments as done.
Freagarach edited the summary of this revision. (Show Details)

INVALID_ENTITY, INVALID_PLAYER.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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/752/display/redirect

Freagarach added a child revision: Restricted Differential Revision.Sep 20 2019, 3:00 PM
wraitii added inline comments.Sep 22 2019, 11:43 AM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
54

This should go in a separate patch.
I see 4 ways to handle being hit with the same status effect, which basically boil down to:

  • Ignore (V0/V1 behaviour)
  • Replace (this patch as it stands)
  • Extend (add duration, no other change)
  • Stack (stack effects)

But this is more complex to do correctly and should come later.

104

I realise I did the capitalisation here, but I would downgrade this to lower-case as it doesn't come from the template. In fact, I might write it _timer to make the difference more explicit.

Same for 'timeelapsed' and 'firstTime'

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

separated

103

This shouldn't go in Attacking.js but in a separate 'ModifierTemplate' helper or something, as other code could use it (see promotion diff)

wraitii updated this revision to Diff 9905.Sep 22 2019, 11:44 AM

Did the changes I suggested above because I was going to change the XML schema to handle <Interval> better, but then I discovered D2315.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [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'.
Executing section cli...

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

Freagarach edited the summary of this revision. (Show Details)Sep 22 2019, 12:18 PM
Stan added inline comments.Sep 22 2019, 4:03 PM
binaries/data/mods/public/simulation/components/StatusEffectsReceiver.js
83

oversight :)

wraitii updated this revision to Diff 9916.Sep 22 2019, 4:43 PM

Remove debug code

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/287/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.
Executing section cli...

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

Freagarach marked 6 inline comments as done.Sep 23 2019, 10:51 AM

Stan added a comment.Sep 23 2019, 10:58 AM

Looks crowded. Shouldn't there be an icon in the unit icon ? One could then hover over it to get information.

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

What type of array does it return ?

93

Missing capital O

170

why not

effect.affects = template.Affects ? template.Affects._string.split(/\s/) : [];
173

.map() ?

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

Missing '.' Still not sure whether it's @returns, or @return.

Freagarach updated this revision to Diff 9944.Sep 23 2019, 1:18 PM
Freagarach edited the summary of this revision. (Show Details)

Transfer statusEffect to new entity when transforming.

In D2281#97075, @Stan wrote:

Looks crowded. Shouldn't there be an icon in the unit icon ? One could then hover over it to get information.

Part of it is that the attack tooltip wraps, so we'd need to extend the width further.
Part of it is the text description, which probably shouldn't appear in this hover tooltip.
Part of it is that we need to rethink information entirely.

IMO not a blocker.

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

Array of object?

170

cause I didn't read this properly when moving it.

173

We don't use the return type so forEach is more correct, however this should be written { y; }

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

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

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

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

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|   8|   8| var fired = [];
|   9|   9| 
|  10|  10| AddMock(10, IID_Test, {
|  11|    |-	Callback: function(data, lateness) {
|    |  11|+	"Callback": function(data, lateness) {
|  12|  12| 		fired.push([data, lateness]);
|  13|  13| 	}
|  14|  14| });
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  15|  15| 
|  16|  16| var cancelId;
|  17|  17| AddMock(20, IID_Test, {
|  18|    |-	Callback: function(data, lateness) {
|    |  18|+	"Callback": function(data, lateness) {
|  19|  19| 		fired.push([data, lateness]);
|  20|  20| 		cmpTimer.CancelTimer(cancelId);
|  21|  21| 	}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  34|  34| TS_ASSERT_UNEVAL_EQUALS(fired, []);
|  35|  35| 
|  36|  36| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  37|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|    |  37|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c", 0], ["e",0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e", 0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  56|  56| var r = cmpTimer.SetInterval(10, IID_Test, "Callback", 500, 1000, "r");
|  57|  57| 
|  58|  58| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  59|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  59|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  59|  59| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  62|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  77|  77| cancelId = cmpTimer.SetInterval(20, IID_Test, "Callback", 500, 1000, "s");
|  78|  78| 
|  79|  79| cmpTimer.OnUpdate({ "turnLength": 3.0 });
|  80|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["s",2500]]);
|    |  80|+TS_ASSERT_UNEVAL_EQUALS(fired, [["s", 2500]]);
|  81|  81| 
|  82|  82| fired = [];
|  83|  83| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  84|  84| var t = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "t");
|  85|  85| cmpTimer.TransferTimer(t, 20);
|  86|  86| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  87|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["t",0]]);
|    |  87|+TS_ASSERT_UNEVAL_EQUALS(fired, [["t", 0]]);
|    | [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
| 216| »   »   »   »   for·(let·ent·of·cmpNewObstruction.GetEntitiesDeletedUponConstruction())
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'ent' is already declared in the upper scope.
|    | [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/Timer.js
|  88| »   if·(typeof·repeattime·!=·"number"·||·!(repeattime·>·0))
|    | [NORMAL] JSHintBear:
|    | Confusing use of '!'.

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.
Executing section cli...

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

Stan added inline comments.Sep 23 2019, 2:30 PM
binaries/data/mods/public/simulation/components/Timer.js
24 ↗(On Diff #9945)

Aren't you returning an object here ?

You could use Array.Filter

binaries/data/mods/public/simulation/helpers/Transform.js
281

I didn't know one could get an iid that way ^^

Freagarach updated this revision to Diff 9946.Sep 23 2019, 2:30 PM
Freagarach marked 6 inline comments as done.
  • JSDOC.
  • Some cleanup.
  • Inlines from @Stan.

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

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

Freagarach added inline comments.Sep 23 2019, 2:35 PM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
51

Improve.

93

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

\n
Further down the file as well.

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/Timer.js
|  88| »   if·(typeof·repeattime·!=·"number"·||·!(repeattime·>·0))
|    | [NORMAL] JSHintBear:
|    | Confusing use of '!'.
|    | [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 (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|   8|   8| var fired = [];
|   9|   9| 
|  10|  10| AddMock(10, IID_Test, {
|  11|    |-	Callback: function(data, lateness) {
|    |  11|+	"Callback": function(data, lateness) {
|  12|  12| 		fired.push([data, lateness]);
|  13|  13| 	}
|  14|  14| });
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  15|  15| 
|  16|  16| var cancelId;
|  17|  17| AddMock(20, IID_Test, {
|  18|    |-	Callback: function(data, lateness) {
|    |  18|+	"Callback": function(data, lateness) {
|  19|  19| 		fired.push([data, lateness]);
|  20|  20| 		cmpTimer.CancelTimer(cancelId);
|  21|  21| 	}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  34|  34| TS_ASSERT_UNEVAL_EQUALS(fired, []);
|  35|  35| 
|  36|  36| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  37|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|    |  37|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c", 0], ["e",0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e", 0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  56|  56| var r = cmpTimer.SetInterval(10, IID_Test, "Callback", 500, 1000, "r");
|  57|  57| 
|  58|  58| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  59|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  59|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  59|  59| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  62|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  77|  77| cancelId = cmpTimer.SetInterval(20, IID_Test, "Callback", 500, 1000, "s");
|  78|  78| 
|  79|  79| cmpTimer.OnUpdate({ "turnLength": 3.0 });
|  80|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["s",2500]]);
|    |  80|+TS_ASSERT_UNEVAL_EQUALS(fired, [["s", 2500]]);
|  81|  81| 
|  82|  82| fired = [];
|  83|  83| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  84|  84| var t = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "t");
|  85|  85| cmpTimer.TransferTimer(t, 20);
|  86|  86| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  87|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["t",0]]);
|    |  87|+TS_ASSERT_UNEVAL_EQUALS(fired, [["t", 0]]);
|    | [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/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
| 216| »   »   »   »   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/820/display/redirect

Stan added inline comments.Sep 23 2019, 2:38 PM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
61

Maybe use map seems to be faster https://codeburst.io/javascript-map-vs-foreach-f38111822c0f (Might be nice to test if true.

173

Well the idea would be to inline all that ^^"

wraitii added inline comments.Sep 24 2019, 9:47 AM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
61

It's faster from my testing for such use cases too.

Freagarach updated this revision to Diff 9972.Sep 27 2019, 10:13 AM
Freagarach marked 5 inline comments as done.

JSDOC.

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

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

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

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|   8|   8| var fired = [];
|   9|   9| 
|  10|  10| AddMock(10, IID_Test, {
|  11|    |-	Callback: function(data, lateness) {
|    |  11|+	"Callback": function(data, lateness) {
|  12|  12| 		fired.push([data, lateness]);
|  13|  13| 	}
|  14|  14| });
|    | [NORMAL] ESLintBear (quote-props):
|    | Unquoted property 'Callback' found.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  15|  15| 
|  16|  16| var cancelId;
|  17|  17| AddMock(20, IID_Test, {
|  18|    |-	Callback: function(data, lateness) {
|    |  18|+	"Callback": function(data, lateness) {
|  19|  19| 		fired.push([data, lateness]);
|  20|  20| 		cmpTimer.CancelTimer(cancelId);
|  21|  21| 	}
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  34|  34| TS_ASSERT_UNEVAL_EQUALS(fired, []);
|  35|  35| 
|  36|  36| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  37|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|    |  37|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  37|  37| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0]]);
|  38|  38| 
|  39|  39| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  40|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  40|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|  43| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a", 0], ["b",300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  40|  40| TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|  41|  41| 
|  42|  42| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  43|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b",300]]);
|    |  43|+TS_ASSERT_UNEVAL_EQUALS(fired, [["a",0], ["b", 300]]);
|  44|  44| 
|  45|  45| fired = [];
|  46|  46| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c", 0], ["e",0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  49|  49| var e = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "e");
|  50|  50| cmpTimer.CancelTimer(d);
|  51|  51| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  52|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e",0]]);
|    |  52|+TS_ASSERT_UNEVAL_EQUALS(fired, [["c",0], ["e", 0]]);
|  53|  53| 
|  54|  54| fired = [];
|  55|  55| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  56|  56| var r = cmpTimer.SetInterval(10, IID_Test, "Callback", 500, 1000, "r");
|  57|  57| 
|  58|  58| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  59|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  59|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  59|  59| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  60|  60| 
|  61|  61| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  62|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|    |  62|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  62|  62| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0]]);
|  63|  63| 
|  64|  64| cmpTimer.OnUpdate({ "turnLength": 0.5 });
|  65|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|    |  65|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|  68| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  65|  65| TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0]]);
|  66|  66| 
|  67|  67| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  68|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  68|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  69|  69| 
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r", 0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r", 0], ["r",2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r", 2500], ["r",1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r", 1500], ["r",500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  70|  70| cmpTimer.CancelTimer(r);
|  71|  71| 
|  72|  72| cmpTimer.OnUpdate({ "turnLength": 3.5 });
|  73|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r",500]]);
|    |  73|+TS_ASSERT_UNEVAL_EQUALS(fired, [["r",0], ["r",0], ["r",2500], ["r",1500], ["r", 500]]);
|  74|  74| 
|  75|  75| fired = [];
|  76|  76| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  77|  77| cancelId = cmpTimer.SetInterval(20, IID_Test, "Callback", 500, 1000, "s");
|  78|  78| 
|  79|  79| cmpTimer.OnUpdate({ "turnLength": 3.0 });
|  80|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["s",2500]]);
|    |  80|+TS_ASSERT_UNEVAL_EQUALS(fired, [["s", 2500]]);
|  81|  81| 
|  82|  82| fired = [];
|  83|  83| 
|    | [NORMAL] ESLintBear (comma-spacing):
|    | A space is required after ','.
|----|    | /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|    |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/tests/test_Timer.js
|  84|  84| var t = cmpTimer.SetTimeout(10, IID_Test, "Callback", 1000, "t");
|  85|  85| cmpTimer.TransferTimer(t, 20);
|  86|  86| cmpTimer.OnUpdate({ "turnLength": 1.0 });
|  87|    |-TS_ASSERT_UNEVAL_EQUALS(fired, [["t",0]]);
|    |  87|+TS_ASSERT_UNEVAL_EQUALS(fired, [["t", 0]]);
|    | [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/Timer.js
|  92| »   if·(typeof·repeattime·!=·"number"·||·!(repeattime·>·0))
|    | [NORMAL] JSHintBear:
|    | Confusing use of '!'.

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-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
| 216| »   »   »   »   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/837/display/redirect

Stan added inline comments.Sep 27 2019, 10:27 AM
binaries/data/mods/public/globalscripts/ModificationTemplates.js
97

early return if it's null/empty ?

binaries/data/mods/public/simulation/components/Timer.js
31 ↗(On Diff #9972)

Why not array then ?

Freagarach planned changes to this revision.Sep 27 2019, 10:30 AM
Freagarach marked an inline comment as done.

Remove transfer part.

Freagarach updated this revision to Diff 9978.Sep 27 2019, 1:41 PM
Freagarach edited the summary of this revision. (Show Details)

Properly transfer status effects by re-applying them with shortned duration.

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

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/328/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/843/display/redirect

Freagarach retitled this revision from [WIP] - Status Effects v2 - More cleanup, allow modifiers. to Status Effects v2 - More cleanup, allow modifiers..Sep 27 2019, 5:32 PM

Think this looks good now, see inline and I'll commit this.

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

This is unrelated, no?

See also IRC today -> some changes for i18n needed.

Freagarach marked 2 inline comments as done.Sep 29 2019, 2:16 PM

Aren't the changes for i18n only correctly possible after D2337?

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