Page MenuHomeWildfire Games

Cleanup of damage type related code in cmpDeathDamage
ClosedPublic

Authored by leper on Sep 4 2017, 2:13 AM.

Details

Reviewers
fatherbushido
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP20112: Cleanup of damage type related code in cmpDeathDamage.
Summary

Fixes broken use of a function, removes an unused parameter, fixes the incorrect property name in the gui.

Test Plan

Check that nothing in the gui uses that property so far. Also check that the new code is doing what the previous one was trying to do.

Sort of related to D866.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

leper created this revision.Sep 4 2017, 2:13 AM
Vulcan added a subscriber: Vulcan.Sep 4 2017, 2:59 AM

Build is green

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

http://jenkins-master:8080/job/phabricator/1960/ for more details.

Vulcan added a comment.Sep 4 2017, 3:01 AM
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
| 209| 209| {
| 210| 210| 	if (this.miragedEntities[player])
| 211| 211| 		return this.renamedEntities.concat(this.miragedEntities[player]);
| 212|    |-	else
| 213|    |-		return this.renamedEntities;
|    | 212|+	return this.renamedEntities;
| 214| 213| };
| 215| 214| 
| 216| 215| GuiInterface.prototype.ClearRenamedEntities = function()
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|1236|1236| 
|1237|1237| 		return false;
|1238|1238| 	}
|1239|    |-	else
|1240|    |-	{
|    |1239|+	
|1241|1240| 		// Move all existing cached entities outside of the world and reset their use count
|1242|1241| 		for (let tpl in this.placementWallEntities)
|1243|1242| 		{
|1271|1270| 				}
|1272|1271| 			}
|1273|1272| 		}
|1274|    |-	}
|    |1273|+	
|1275|1274| 
|1276|1275| 	// prevent division by zero errors further on if the start and end positions are the same
|1277|1276| 	if (end.pos && (start.pos.x === end.pos.x && start.pos.z === end.pos.z))
|    | [NORMAL] ESLintBear (no-else-return):
|    | Unnecessary 'else' after 'return'.
|----|    | /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/phabricator_lint/binaries/data/mods/public/simulation/components/GuiInterface.js
|2038|2038| {
|2039|2039| 	if (exposedFunctions[name])
|2040|2040| 		return this[name](player, args);
|2041|    |-	else
|2042|    |-		throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|    |2041|+	throw new Error("Invalid GuiInterface Call name \""+name+"\"");
|2043|2042| };
|2044|2043| 
|2045|2044| Engine.RegisterSystemComponentType(IID_GuiInterface, "GuiInterface", GuiInterface);

binaries/data/mods/public/simulation/components/GuiInterface.js
| 664| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 664| »   for·(let·name·of·auraNames)
|    | [NORMAL] ESLintBear (no-shadow):
|    | 'name' is already declared in the upper scope.

binaries/data/mods/public/simulation/components/GuiInterface.js
| 764| »   if·(notification.players·==·undefined)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'undefined'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1032| »   »   »   »   if·(cmd.queued·==·true)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with 'true'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1094| »   »   if·(cmd.template·==·"")
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with ''.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1515| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1515| »   »   »   »   if·(terrainGroundPrev·!=·null·||·terrainGroundNext·!=·null)
|    | [NORMAL] JSHintBear:
|    | Use '!==' to compare with 'null'.

binaries/data/mods/public/simulation/components/GuiInterface.js
|1637| »   if·(numRequiredPieces·>·0·&&·result.pieces.length·==·0)
|    | [NORMAL] JSHintBear:
|    | Use '===' to compare with '0'.

binaries/data/mods/public/simulatio

http://jenkins-master:8080/job/phabricator_lint/475/ for more details.

fatherbushido accepted this revision.Sep 4 2017, 10:40 PM
fatherbushido added a subscriber: fatherbushido.

(shame on me)
unused param in first file. (ok in the test file)
wrong usage in the second file resulting in a wrong object. Code unused cuurently in the gui so it wasnt noticeable. Returned object consistent with the one in template.js in case a tooltip uses both.

This revision is now accepted and ready to land.Sep 4 2017, 10:40 PM
This revision was automatically updated to reflect the committed changes.

(shame on me)

Well, everything that was used work. And that issue was quite hard to spot tbh.