Fixed Intercom Encryption Key Deletion #34542
Closed
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.
About the PR
Fixed an issue wherein using a welding tool on any intercom which inherited from BaseIntercomSecure, which should remove the security plate and allow access to the encryption keys, would delete all the encryption keys within it.
Why / Balance
Fixes #32590
Fixes #34054
(Duplicate Issues)
Technical details
Change:
Changes the construction system to check abstract parents when checking if an entity inherits from a construction node's desired prototype.
Explanation:
The problem is in how the "doNotReplaceInheritingEntities" code works. When an entity changes nodes on a construction graph, it is supposed to change to match the new node's prototype unless it is already that type. If "doNotReplaceInheritingEntities" is set to true, however, than it only needs to change if it doesn't inherit from the node's prototype rather than needing to match the type exactly. The function currently used to find the entity's parents doesn't check abstract parents or their grandparents, however, resulting in the error.
For example, the CommandIntercom inherits from BaseIntercomSecure (an abstract prototype) which itself inherits from IntercomConstructed. The BaseIntercomSecure prototype sets the construction node to "intercomReinforced." When a player uses the welding tool on the command intercom, it changes from the "intercomReinforced" node to the "intercom" node. The "intercom" node has its prototype set as "IntercomConstructed", and the doNotReplaceInheritingEntities field set to true; as a result, the intercom shouldn't change prototypes because the construction system should recognize that it inherits from IntercomConstructed through BaseIntercomSecure. Because BaseIntercomSecure is abstract, however, the system won't realize that the intercom inherits from IntercomConstructed and will change the CommandIntercom into an IntercomConstructed, deleting the keys in the process.
Media
intercom.encryption.fix.mp4
Requirements
Breaking changes
None that I'm aware of.
Changelog
🆑