-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Various link up fixes #67376
Merged
Merged
Various link up fixes #67376
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ng their use action
github-actions
bot
added
<Documentation>
Design documents, internal info, guides and help.
[JSON]
Changes (can be) made in JSON
Vehicles
Vehicles, parts, mechanics & interactions
[C++]
Changes (can be) made in C++. Previously named `Code`
[Markdown]
Markdown issues and PRs
Appliance/Power Grid
Anything to do with appliances and power grid
<Bugfix>
This is a fix for a bug (or closes open issue)
astyled
astyled PR, label is assigned by github actions
json-styled
JSON lint passed, label assigned by github actions
labels
Aug 2, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Appliance/Power Grid
Anything to do with appliances and power grid
astyled
astyled PR, label is assigned by github actions
<Bugfix>
This is a fix for a bug (or closes open issue)
[C++]
Changes (can be) made in C++. Previously named `Code`
<Documentation>
Design documents, internal info, guides and help.
Items: Containers
Things that hold other things
[JSON]
Changes (can be) made in JSON
json-styled
JSON lint passed, label assigned by github actions
[Markdown]
Markdown issues and PRs
Vehicles
Vehicles, parts, mechanics & interactions
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
Bugfixes "Remove error when remote_use item is deleted during its use function"
Purpose of change
There were some leftover issues from #66871.
vehicle::connect
wasn't updated to match the code it's copying from.avatar_action::use_item
assumes devices with ALLOWS_REMOTE_USE won't be deleted during the use action, but that can potentially happen during link_up, and the game throws an error if it does.Describe the solution
getabs()
was getting called twice on the attachment point, so it was way off.set_link_traits()
.link_up_actor
now uses thepnt
variable that's fed to iuse functions to properly build the item_locations, and it now works for items outside of an inventory.avatar_action::use_item
before callingupdate_lum
andmake_active
, so it doesn't just assume the item will still exist.get_item_with()
skip over CABLE pockets. This doesn't screw up anything else, it's not a very widely used function. I also had to edit a couple uses ofammo_remaining()
in iuse so they accept linked power. I also did this to the tazer iuse, even though it doesn't have a link_up action right now, because it probably will eventually.As an extra, I gave the multicooker ALLOWS_REMOTE_USE since I was was working with both, and it seemed weird that you had to pick up multicookers to use them.
Describe alternatives you've considered
The change to
avatar_action::use_item
is the only change I would say is more than minor, and thus the only thing I mention in the summary. I wanted to avoid doing any big-ish changes like that, but I don't think there's any other way that isn't extremely complicated. It feels like it's probably for the best that ALLOWS_REMOTE_USE items aren't assumed to always stay intact after use anyway, so I went with it.Testing
5, 6, 9 and 10 were actually added to the list in the first place while testing 3 and 4. After fixing those new issues, went through the list and it all looked good. Followed the steps in #67364 and the errors are gone. Extended the arc welder and it falls out of the camera bag with no errors. Plugged in and extended the arc welder on the ground, works fine. While plugged in its batteries charge and it works as a valid crafting tool, and appropriately draws required power from the battery.
Additional context