Currently IsAvailable returns true when a resource is exhausted (and placed in the destroy queue).
So if UnitAI (or another code) wants to use it meanwhile, we have some issues.
That situation is hard to trigger but anyway the code should do the expected thing.
Details
Details
- Reviewers
• leper - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) - Commits
- rP20193: Tag exhausted resource as not available in ResourceSupply component. Fix #4507.
- Trac Tickets
- #4507
- attached test do the job
- scenario (refs #4507): open the Treasure islands scenario trigger map and use the I am too busy code. Grab the treasure at the top of the island. The victory is sent (it shouldn't be the case). Check it's fixed with the patch.
- scenario: use P83 and open the Resource demo scenario map. Gather a water treasure on the left near the coast with one foot soldier. Don't use any cheat code. You will see that the treasure is 'gathered' many times. Check it's fixed with the patch.
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
Executing section Default... Executing section Source... Executing section JS... binaries/data/mods/public/simulation/components/ResourceSupply.js | 87| » » » » return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers; | | [NORMAL] JSHintBear: | | A trailing decimal point can be confused with a dot: '1.'. binaries/data/mods/public/simulation/components/ResourceSupply.js | 87| » » » » return·diminishingReturns·==·1·?·1·:·(1.·-·Math.pow(diminishingReturns,·numGatherers))·/·(1.·-·diminishingReturns)·/·numGatherers; | | [NORMAL] JSHintBear: | | A trailing decimal point can be confused with a dot: '1.'. Executing section XML GUI... Executing section Python... Executing section Perl...
http://jenkins-master:8080/job/phabricator_lint/518/ for more details.
Comment Actions
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://jenkins-master:8080/job/phabricator/2018/ for more details.
binaries/data/mods/public/simulation/components/ResourceSupply.js | ||
---|---|---|
126 ↗ | (On Diff #3638) | Why not just return that? Also why not > 0? (not that it would change anything). |
Comment Actions
Build has FAILED
Link to build: http://jenkins-master:8080/job/phabricator/2040/
See console output for more information: http://jenkins-master:8080/job/phabricator/2040/console
Comment Actions
Executing section Default... Executing section Source... Executing section JS... Executing section XML GUI... Executing section Python... Executing section Perl...
http://jenkins-master:8080/job/phabricator_lint/529/ for more details.