Spawn regular ants under regular anthills #39601
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Bugfixes "Spawn regular ants under regular anthills"
Purpose of change
Fixes #38229
Describe the solution
The existing
i.pos
in this loop has no z-level, so the check for whethertripoint_above
was an anthill was looking at z+1, and there are no anthills in the sky, therefore all underground ants were spawning as acid ants. This commit uses the correct z-level, allowing normal ants to spawn in normal anthills.This commit also stores the calculated tripoint with correct z-level in a variable
p_loc
, then re-uses that in the three places that need it.Describe alternatives you've considered
Considered and began a
git bisect
from known good/bad versions but learned of a solution before completing the process, and did not need to continue.Testing
Used debug mode to reveal map and teleport to these locations:
Confirmed that the "normal" anthills had normal (non-acid ants) underground (under the anthill itself, in the nearby lab, or in nearby house basements), while the sulfurous anthill has acid ants and soldier ants underground.
Additional context
Thanks to @ralreegorganon for seeing the solution more quickly than I could have