-
Notifications
You must be signed in to change notification settings - Fork 481
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Maps::getBiomeType and Maps::getBiomeTypeWithRef #4128
Conversation
* Indent namespaces * Inline getBiomeType
* Update `getBiomeTypeWithRef` and related fns to v50.11 * Bounds checking on region coords via `getRegionBiome` * Utility fn `check_tropicality` removed, handled directly in `getBiomeTypeWithRef` * Utility fn `get_region_parameter` renamed to `basic_wet_dry_effect`
Anybody know why |
For one, the old code was reporting a regional ocean tile as I used a lua script iterating all region tiles to test, but found it too much a hassle to verify what the game UI says (even in a pocket world,) since there's no keyboard support for embark screen and I'd basically have to use trial and error to embark on the right tile to verify region coords. Just going to assume the current disassembled function ( AFAIK, |
do you have a map where I can see the changes in interpretation? I tried to verify on the maps I have, but I'm not sure how to specifically get a biome with |
Using this branch: https://github.com/Bumber64/dfhack/tree/test-biomes
Output should be:
These regions should be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice. thanks!
I've updated the functions
getBiomeType
andgetBiomeTypeWithRef
based on reverse-engineering of v50.11.The only real changes seem to be:
potential_tropical
(rather thantropical
) is sufficient forOCEAN_TROPICAL
region.vegetation
isn't used at all, instead replaced byregion.rainfall
checksgetBiomeType
andgetBiomeTypeWithRef
now do bounds checking on the region coords by callinggetRegionBiome
, then doing aCHECK_NULL_POINTER
on the region. I'd prefer to returnbiome_type::NONE
here instead of throwing an exception, but that doesn't exist so we'd have to add that to structures if appropriate.I indented the
DFHack
andMaps
namespaces inMaps.h
, and inlinedgetBiomeType
there.