Check transforming items for consistency wrt cables #78556
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
None
Purpose of change
Check that transformed-into items have plug_in action when the transformed-from item does, and complain if that's not the case.
Prevents #78535-like issues from reoccuring
Describe the solution
Add the aforementioned check to
iuse_transform::finalize
Describe alternatives you've considered
Make transform logic smarter and do (handwave) something meaningful when a plugged-in item transforms into unpluggable one. But i don't have a use case to support, and that's more work so maybe some other day.
Testing
Compiled, loaded game, no errors.
Reverted #78537 loaded game, got error, as explected.
Changed the transform target of a cell phone into
"asdfsdfsfda"
, loaded the game, got a bunch of errors as expected, and no segfaultsAdditional context
N/A