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

Fixed Intercom Encryption Key Deletion #34542

Conversation

Booblesnoot42
Copy link
Contributor

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

🆑

  • fix: Removing the security plate from an intercom will no longer delete its encryption keys.

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/XS Denotes a PR that changes 0-9 lines. labels Jan 20, 2025
@Booblesnoot42 Booblesnoot42 changed the title fixed abstract parent issue in construction graph code Fixed Intercom Encryption Key Deletion Jan 20, 2025
@ArtisticRoomba ArtisticRoomba added T: Bugfix Type: Bugs and/or bugfixes P3: Standard Priority: Default priority for repository items. D2: Medium Difficulty: A good amount of codebase knowledge required. A: General Interactions Area: General in-game interactions that don't relate to another area. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 21, 2025
@cohanna
Copy link
Contributor

cohanna commented Feb 4, 2025

#33267 seeks to achieve a similar thing (linked for visibility)

@Booblesnoot42
Copy link
Contributor Author

Closed: found a better solution -> #34911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: General Interactions Area: General in-game interactions that don't relate to another area. D2: Medium Difficulty: A good amount of codebase knowledge required. P3: Standard Priority: Default priority for repository items. size/XS Denotes a PR that changes 0-9 lines. T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
3 participants