Fix inexhaustible granite mine production#1918
Conversation
Flamefire
left a comment
There was a problem hiding this comment.
Looks good!
How much of that was created by AI? Just curious
In #918 we discussed that the description of the addon would need adjustment as with this change stone mines are not (only) inexhaustible but don't need (explicit) stone resource in the first place and hence could be build anywhere on the mountain, even on e.g. gold or coal deposits
Can you (or Codex) come up with a slightly changed description to avoid confusion of that?
|
|
||
| BOOST_FIXTURE_TEST_CASE(InexhaustibleGraniteMineWorksWithoutResources, WorldWithGCExecution1P) | ||
| { | ||
| ggs.setSelection(AddonId::INEXHAUSTIBLE_GRANITEMINES, 1); |
There was a problem hiding this comment.
Those 2 tests have the same setup, which I'd like to keep in sync and clearly the same.
I see 2 ways:
- Move the common code to a fixture
- Change the setting of
INEXHAUSTIBLE_GRANITEMINESin the test
I'm concerned by a (purely theoretical though) difference:
- RTTR_EXEC_TILL(500, mine->HasWorker());
- RTTR_SKIP_GFS(2000);
+ RTTR_EXEC_TILL(3000, curInventory[GoodType::Stones] > initialStones);In 2nd case
- You don't wait for the worker to arrive
- Time is longer. So it could (theoretically) be possible that after 2501 GFs a stone would arrive making the test wrongly pass
The name GraniteMineWithoutResourcesNeedsAddon would be a great fit for the 2nd approach: Addon disable: No stone, enabling it yields stone being produced.
Currently not sure if the logic of when the worker starts (trying) to work again works with that though in which case the fixture needs to be used.
What do you think?
There was a problem hiding this comment.
70/30 AI i' use RTTR since 2024. now i'am more familiar with programming due to ai,
There was a problem hiding this comment.
i will check on that later.
Summary
INEXHAUSTIBLE_GRANITEMINESis enabledRoot cause
The addon prevented granite resource depletion, but production still required
FindPointWithResource(ResourceType::Granite)to find an existing resource spot. On mountain positions without granite resources, the mine therefore never started producing even with the addon enabled.Validation
Test_integration.exe --run_test=Production --report_level=shortctest --test-dir C:\dev\s25client\build-vs-x64-debug -C Debug --output-on-failureFixes #918