some cleanup following rP19681: code cleanup + distant berries gatherer are reallowed in maps with disabled field and corrals.
Details
mainly code cleanup. The hash value must be identical (except in maps without field and corral)
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
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/72/ for more details.
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://jw:8080/job/phabricator/1396/ for more details.
binaries/data/mods/public/simulation/ai/petra/worker.js | ||
---|---|---|
44 ↗ | (On Diff #2274) | Perhaps it would be better to include "worker" in this variable name, in order to make it clear what this var is for, as it can be accessed from outside of worker. But I'm also not sure if this var is needed, as it is only used in the one check at the end of the function, and this whole check here on turnCache.allowDistantFood could be moved below, so it is only done if needed. |
481 ↗ | (On Diff #2274) | Maybe it is time to rework some of this function to remove these assignments in selection statements, which are bad practice (perhaps not in this diff). |
binaries/data/mods/public/simulation/ai/petra/worker.js | ||
---|---|---|
558 ↗ | (On Diff #2305) | I was rather thinking of doing (after updating turnCache.allowDistantFood): if (resource !== "food" || gameState.ai.HQ.turnCache.allowDistantFood) What do you think? |
binaries/data/mods/public/simulation/ai/petra/worker.js | ||
---|---|---|
558 ↗ | (On Diff #2305) | Wouldn't that force us to update allowDistantFood in the cache even if no food gatherer at this turn? which does not happen with the current code (although that would be irrelevant for performance, better avoid useless computations). |
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://jw:8080/job/phabricator/1409/ for more details.
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jw:8080/job/phabricator_lint/82/ for more details.
Okay, I think it is good.
binaries/data/mods/public/simulation/ai/petra/worker.js | ||
---|---|---|
558 ↗ | (On Diff #2305) | Okay. |