Page MenuHomeWildfire Games

Double negate state.garrisonHolder
ClosedPublic

Authored by temple on Feb 23 2018, 8:56 PM.

Details

Summary

If state.garrisonHolder is undefined (e.g. ungarrisoning with a storehouse in the selection) this throws a warning:

WARNING: JavaScript warning: gui/session/selection_panels_helpers.js line 373
reference to undefined property state.garrisonHolder
Test Plan

Agree.

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

temple created this revision.Feb 23 2018, 8:56 PM
Vulcan added a subscriber: Vulcan.Feb 23 2018, 8:58 PM

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

Linter detected issues:
Executing section Default...
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (curly):
|    | Unnecessary { after 'for-of'.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels_helpers.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/public/gui/session/selection_panels_helpers.js
| 414| 414| 	let otherEnts = [];
| 415| 415| 
| 416| 416| 	for (let ent of garrisonHolders)
| 417|    |-	{
|    | 417|+	
| 418| 418| 		if (controlsPlayer(GetEntityState(ent).player))
| 419| 419| 			ownEnts.push(ent);
| 420| 420| 		else
| 421| 421| 			otherEnts.push(ent);
| 422|    |-	}
|    | 422|+	
| 423| 423| 
| 424| 424| 	if (ownEnts.length)
| 425| 425| 		Engine.PostNetworkCommand({

Link to build: https://jenkins.wildfiregames.com/job/differential/79/display/redirect

I guess that was the GetEntityState rework

mimo accepted this revision.Feb 24 2018, 12:03 PM

Thanks for the fix

This revision is now accepted and ready to land.Feb 24 2018, 12:03 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Feb 24 2018, 3:13 PM