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
None
Purpose of change
Break recursive death spiral revealed by #74287.
Describe the solution
Clear the cache dirty flag at the call rather than at the end so calls from rebuild_aim_cache won't call it down the line.
Describe alternatives you've considered
Understand why the code for setting the cache even involves checking for the cache being dirty in the first place.
Testing
Loaded save, spawned m16, wielded it, walked over to zombie miners, aimed. I was able to fire at a miner after aiming one step at a time to full aiming.
Additional context
Note that #74287 didn't cause the bug, just revealed the bug when another one was corrected (the bug can can probably be repeated with the pre #74287 correction code if you're at OMT (0, 0, 0) and the target is in the reality bubble at a position that leaves it with positive absolute coordinate members (x and y above zero)).