If we ever implement unit conversion, we don't want the civ capturing a unit to have access to all structures from the captured one.
See #4870 for more details
Details
Details
- Reviewers
elexis - Commits
- rP20521: Units should only be able to build structures from their owner's civ, and not…
- Trac Tickets
- #4870
Agree with what is said in the summary and check that it was not the case up to now
Diff Detail
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
Comment Actions
I agree with the Builder.js diff.
It can be tested with the "salad bowl" cheat and we notice that we can no more build things of the civ of the unit but buildings of the civ of the player, as advertized.
No clue about the petra one, but I have tested it with the AI and the reported error was gone.
If any mod wants to allow building of converted units, the new boolean property in Builder templates should be easy to implement in the simulation side (1 BuilderAI diff + 3 templates + something in the AI), see ticket.
Edit: Thanks for the patch!
Comment Actions
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). In TestComponentScripts::test_scripts: ../../../source/test_setup.cpp:134: Error: Test failed: Stack trace: @simulation/components/tests/test_Builder.js:18:1 Expected equal, got [] !== ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] ../../../source/test_setup.cpp:134: Error: Test failed: Stack trace: @simulation/components/tests/test_Builder.js:28:1 Expected equal, got [] !== ["structures/iber_barracks", "structures/iber_civil_centre"] ERROR: JavaScript error: simulation/components/Builder.js line 37 TypeError: cmpPlayer.GetCiv is not a function Builder.prototype.GetEntitiesList@simulation/components/Builder.js:37:44 @simulation/components/tests/test_Builder.js:43:25 /mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Builder.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). In TestComponentScripts::test_scripts: ../../../source/test_setup.cpp:134: Error: Test failed: Stack trace: @simulation/components/tests/test_Builder.js:18:1 Expected equal, got [] !== ["structures/{civ}_barracks", "structures/{civ}_civil_centre"] ../../../source/test_setup.cpp:134: Error: Test failed: Stack trace: @simulation/components/tests/test_Builder.js:28:1 Expected equal, got [] !== ["structures/iber_barracks", "structures/iber_civil_centre"] ERROR: JavaScript error: simulation/components/Builder.js line 37 TypeError: cmpPlayer.GetCiv is not a function Builder.prototype.GetEntitiesList@simulation/components/Builder.js:37:44 @simulation/components/tests/test_Builder.js:43:25 /mnt/data/jenkins-phabricator/workspace/phabricator/source/simulation2/components/tests/test_scripts.h:44: Error: Test failed: L"Running script simulation/components/tests/test_Builder.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...