Skip to content
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

Fix inconsistent crafting range #76143

Merged
merged 1 commit into from
Sep 5, 2024
Merged

Conversation

PatrikLundell
Copy link
Contributor

@PatrikLundell PatrikLundell commented Sep 2, 2024

Summary

None

Purpose of change

Address one aspect of #74232 (frequent crafting abortion). I don't think it's the only cause, though.

Describe the solution

  • Change two usages of PICKUP_RANGE -1 to drop the range reduction so the actual crafting uses the same range as the evaluation does.
  • Changed a third instance for deconstruction, as it should suffer from the same problem

Describe alternatives you've considered

Try to figure out which of the PICKUP_RANGE -1 radii are correct and which should be changed to the radius itself.
I've done the obvious one, leaving the ones that need evaluation for someone else.

Testing

  • Made a test setup where I dropped a multitool 6 tiles N of the companion, a primitive lockpick 2 tiles SW of the companion out on a road away from any storage zones.
  • Ordered the companion to craft an improvised lockpick.
  • Got the companion to continue crafting.

With the first change only the error message gotten when crafting was started and then immediately aborted changed from the original without any code change.
With the second change the crafting proceeded.

Additional context

Including these two locations, there are others where PICKUP_RANGE - 1 are used:
activity_item_handling.cpp operation are_requirements_nearby in a !found_welder section. Should it be changed?
activity_item_handling.cpp operation can_do_activity_there in the ACT_VEHICLE_REPAIR section. Should it be changed?
activity_item_handling.cpp operation can_do_activity_there in the ACT_MULTIPLE_CRAFT section (the second one I changed)
activity_item_handling.cpp operation can_do_activity_there in hte ACT_MULTIPLE_DIS section. Should definitely be changed together with the previous entry.
activity_item_handling.cpp operation requirements_map. Should it be changed?
activity_item_handling.cpp operation generic_multi_activity_check_requirement (the one @MikasaTanikawa references in a post in the bug report). Should definitely be changed.
activity_item_handling.cpp operation generic_multiactivity_check_requirement. A bit further down. Should it be changed?

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Sep 2, 2024
@Maleclypse Maleclypse merged commit 94b346a into CleverRaven:master Sep 5, 2024
25 of 29 checks passed
@PatrikLundell PatrikLundell deleted the craft branch September 5, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants