Ignore isolated fish resources for fisheries#1925
Ignore isolated fish resources for fisheries#1925DevOpsOfChaos wants to merge 4 commits intoReturn-To-The-Roots:masterfrom
Conversation
|
Updated. I cleaned up the test as requested. The extra Validation:
|
2f16b65 to
58c0217
Compare
|
Thinking about this again: Wouldn't it make more sense to "fix" the map during loading? |
58c0217 to
7e4777e
Compare
I reworked this in the direction you suggested. The isolated/non-water fish cleanup now happens once in Connected water with fish is unchanged; isolated one-node water and non-water fish resources are normalized away during world resource setup. Validation:
|
Flamefire
left a comment
There was a problem hiding this comment.
Please no force-pushes during a review. If necessary a revert works too. This way I have to check more changes.
Doesn't matter much for this small PR though.
With the added method in GameWorld: I think GameWorld::SetupResources() belongs more to MapLoader. Because that is the only context where it makes sense to call it, doesn't it?
So if I'm not missing anything please move those methods. SetupResources can be a public method, and the others can be private.
0fde365 to
5e47234
Compare
Sorry about the force-push. I’ll avoid force-pushing this PR from here on and use normal follow-up commits instead. |
|
I moved the resource setup logic from The fish cleanup behavior is unchanged: fish on non-water and isolated one-node water is removed, while connected/larger water keeps fish. The row-local optimization for consecutive fish water is still in place. Validation:
|
Summary
MapLoaderMotivation
Fisheries could still produce fish from an isolated one-node water pond if that node had a fish resource. In the original behavior described in #1171, such isolated water should be exhausted without producing fish.
This change keeps larger/connected water usable, but removes fish resources from unusable water during map resource setup.
Implementation details
Resource setup is now handled by
MapLoader::SetupResources(GameWorldBase&).The setup step normalizes resources after map loading:
The fisher runtime path remains simple and only checks whether fish resources exist.
The fish cleanup iterates row-by-row and uses a row-local shortcut: if the previous point in the same row was kept as fish-on-water, the current water fish point does not need the full neighbor-water scan. This shortcut is not carried across row boundaries.
Validation
Test_integrationlocally with Visual Studio 2022 / DebugTest_integration.exe --run_test=BuildingSuite/FisherIgnoresIsolatedFishWater --report_level=shortTest_integration.exe --run_test=BuildingSuite --report_level=shortgit diff --check upstream/master...HEADFixes #1171