See #3488
Details
- Reviewers
Freagarach - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Trac Tickets
- #3488
Test that it only change gameplay while activated and does not require anything else.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Lint Skipped - Unit
Unit Tests Skipped - Build Status
Buildable 11245 Build 20193: Vulcan Build Jenkins Build 20192: Vulcan Build (macOS) Jenkins Build 20191: Vulcan Build (Windows) Jenkins
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; | | [NORMAL] ESLintBear (key-spacing): | | Extra space after computed key 'entity'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | 343| 343| | 344| 344| // Needs to be called before the visible garrison points are cleared. | 345| 345| let visible = { | 346| |- [entity] : this.IsVisiblyGarrisoned(entity) | | 346|+ [entity]: this.IsVisiblyGarrisoned(entity) | 347| 347| }; | 348| 348| | 349| 349| for (let vgp of this.visibleGarrisonPoints) Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1540/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1842/display/redirect
- Code looks good, gets unit-tested extensively (segfault unrelated).
- Addresses the ticket, although there are some comments there that are not implemented, about user control, that can be ticketed and handled independently, IMHO.
- I added the option to a wall template and the behaviour is as expected.
- It is a very nice addition, since it allows for visibly garrisoning a catapult on a ship, as suggested by (the tips).
nothing breaking i can find just by reading the code
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
49 | help text should be added and state that if not present, default x+y will be used | |
220 | vgpEntity -> visibleGarrisonPoint !visibleGarrisonPoint -> visibleGarrisonPoint = undefined this is not needed to do | |
344 | maybe Needs to be set ... |
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; | | [NORMAL] ESLintBear (key-spacing): | | Extra space after computed key 'entity'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | 343| 343| | 344| 344| // Needs to be set before the visible garrison points are cleared. | 345| 345| let visible = { | 346| |- [entity] : this.IsVisiblyGarrisoned(entity) | | 346|+ [entity]: this.IsVisiblyGarrisoned(entity) | 347| 347| }; | 348| 348| | 349| 349| for (let vgp of this.visibleGarrisonPoints) Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1845/display/redirect
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
49 | will they ? |
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; | | [NORMAL] ESLintBear (key-spacing): | | Extra space after computed key 'entity'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | 343| 343| | 344| 344| // Needs to be set before the visible garrison points are cleared. | 345| 345| let visible = { | 346| |- [entity] : this.IsVisiblyGarrisoned(entity) | | 346|+ [entity]: this.IsVisiblyGarrisoned(entity) | 347| 347| }; | 348| 348| | 349| 349| for (let vgp of this.visibleGarrisonPoints) Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1846/display/redirect
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
90 | The componetn should be agnostic of identity classes (Infantry+Ranged), make it a error if the template doesn't specify one and manifest it in the schema |
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
90 | Agreed. I think it makes more sense to fallback to everything allowed to garrison by default. Hence the last change just right before your comment :) |
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; | | [NORMAL] ESLintBear (key-spacing): | | Extra space after computed key 'entity'. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/GarrisonHolder.js | 343| 343| | 344| 344| // Needs to be set before the visible garrison points are cleared. | 345| 345| let visible = { | 346| |- [entity] : this.IsVisiblyGarrisoned(entity) | | 346|+ [entity]: this.IsVisiblyGarrisoned(entity) | 347| 347| }; | 348| 348| | 349| 349| for (let vgp of this.visibleGarrisonPoints) Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1847/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1848/display/redirect
Is the fallback redundant and thus useless (same as always allowed if not specified)?
What happens if someone specifies a class in the AllowedClasses that is not part of List, should that description be the following?
If specified, only entities matching these classes and the List classes...
One cannot visibly garrison a unit that cannot be garrisoned non visibly. (Added a test for that)
The fallback is needed for things like walls, because it reduces the changes needed, and doesn't require everything to be specified.
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1849/display/redirect
One cannot visibly garrison a unit that cannot be garrisoned non visibly
The fallback is needed for things like walls
Why is the check needed for walls if thats the case?
because it reduces the changes needed, and doesn't require everything to be specified.
Is that (only) the difference between || template.List and if (!foo) return true;? Because in that case it would be less code executed and more obvious to the reader to not evaluate a function that will always return true.
Simplify code by returning true when there are no allowed classes specified for a VGP. The check is handled by perfom garrison.
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1850/display/redirect
(I didn't check whether the message moving makes sense, or test it in any way, or anything else)
IsVisiblyGarrisoned does loop for each entity checked, perhaps that can be optimized, I didn't check (code only handled for garrisoned entities, so its not as grave as it could be, but there also was some 10s freeze when a ship was destroyed some releases ago, and there could be cases where a player deletes/renames/ownershipchanges 100+ entities with 10+ entities garrisoned each). (Also didn't check whether sending visible entities in the messages instead of having the message handlers call into the function is more performant.)
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
7 | -inside? | |
49 | From https://code.wildfiregames.com/D2308#111472
(also will be used is ambiguous, used for what?)
| |
192 | its not an object if it's falsy | |
201 | It's not a fallback, since template.List is checked also in the case allowedClasses are specified. | |
220 | !!vgpEntity -> vgpEntity | |
220 | !! unneeded |
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1851/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1888/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1894/display/redirect
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
204–207 | return cmpIdentity && ...? | |
219–223 | Perhaps: let visibleGarrisonPoint; if (vgpEntity && this.AllowedToVisibleGarrisoning(entity, vgpEntity)) visibleGarrisonPoint = vgpEntity; Seems more logical than first setting, then resetting. |
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1987/display/redirect
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/567/display/redirect
Take two ;)
- Code looks
goodbetter, gets unit-tested extensively (MacOS build failure unrelated). - Addresses the ticket, although there are some comments there that are not implemented, about user control, that can be ticketed and handled independently, IMHO.
- I added the option to a wall and tower templates and the behaviour is as expected.
- It is a very nice addition, since it allows for visibly garrisoning a catapult on a ship, as suggested by the tips.
binaries/data/mods/public/simulation/components/GarrisonHolder.js | ||
---|---|---|
192 | +. | |
256 | One could make this (whether it was garrisoned visibly) a variable (around L230) and save a function call here, but is not necessary I guess. |
Build failure - The Moirai have given mortals hearts that can endure.
Link to build: https://jenkins.wildfiregames.com/job/macos-differential/573/display/redirect
Successful build - Chance fights ever on the side of the prudent.
Linter detected issues: Executing section Source... Executing section JS... | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 138| 138| | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| |- this.entity, range.min, range.max, range.elevationBonus, | | 141|+ this.entity, range.min, range.max, range.elevationBonus, | 142| 142| enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 139| 139| var range = cmpAttack.GetRange(attackType); | 140| 140| this.enemyUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 141| 141| this.entity, range.min, range.max, range.elevationBonus, | 142| |- enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | | 142|+ enemies, IID_Resistance, cmpRangeManager.GetEntityFlagMask("normal")); | 143| 143| | 144| 144| cmpRangeManager.EnableActiveQuery(this.enemyUnitsQuery); | 145| 145| }; | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 167| 167| | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| |- this.entity, range.min, range.max, range.elevationBonus, | | 170|+ this.entity, range.min, range.max, range.elevationBonus, | 171| 171| [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | | [NORMAL] ESLintBear (indent): | | Expected indentation of 2 tabs but found 3. |----| | /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | |++++| /zpool0/trunk/binaries/data/mods/public/simulation/components/BuildingAI.js | 168| 168| // This query is only interested in Gaia entities that can attack. | 169| 169| this.gaiaUnitsQuery = cmpRangeManager.CreateActiveParabolicQuery( | 170| 170| this.entity, range.min, range.max, range.elevationBonus, | 171| |- [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | | 171|+ [0], IID_Attack, cmpRangeManager.GetEntityFlagMask("normal")); | 172| 172| | 173| 173| cmpRangeManager.EnableActiveQuery(this.gaiaUnitsQuery); | 174| 174| }; Executing section cli...
Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1992/display/redirect