Page MenuHomeWildfire Games

Move GetRangeOverlays to component and move Heal Range defaults to template
ClosedPublic

Authored by elexis on Dec 8 2017, 3:39 PM.

Details

Summary

Having the art and balancing values in the component should be avoided. This is done for Heal, but not for Auras yet (can be done after auras aren't serialized nor cached in components anymore).
By creating a GetRangeOverlays function in the component, the code becomes more clear and more performant, because the number of function calls is reduced by a factor of 4.

Test Plan

Make sure the hotkeys and config options still work. Select a civic center, female, hero and healer.
See D328, D432, D568

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

elexis created this revision.Dec 8 2017, 3:39 PM
Vulcan added a subscriber: Vulcan.Dec 8 2017, 4:29 PM

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests).ERROR: JavaScript error: simulation/components/tests/test_Heal.js line 56
TypeError: cmpHeal.GetLineTexture is not a function
  @simulation/components/tests/test_Heal.js:56:18

In TestComponentScripts::test_scripts:
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Heal.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
..................................................................................................................................................................................................................................................................................................................
Failed 1 and Skipped 0 of 308 tests
Success rate: 99%
Running debug tests...
Running cxxtest tests (308 tests).ERROR: JavaScript error: simulation/components/tests/test_Heal.js line 56
TypeError: cmpHeal.GetLineTexture is not a function
  @simulation/components/tests/test_Heal.js:56:18

In TestComponentScripts::test_scripts:
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Heal.js"
/mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Assertion failed: scriptInterface.LoadScript(pathname, content)
..................................................................................................................................................................................................................................................................................................................
Failed 1 and Skipped 0 of 308 tests
Success rate: 99%
Checking XML files...
Vulcan added a comment.Dec 8 2017, 4:30 PM
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/components/Heal.js
| 137| »   }]
|    | [NORMAL] JSHintBear:
|    | Missing semicolon.
This revision was automatically updated to reflect the committed changes.