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 forensics not being applied to held items #30609

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

SlamBamActionman
Copy link
Member

About the PR

This PR fixes characters failing to apply forensics to objects if they weren't the person putting it in their hands. Examples of this would be someone giving the item via the strip menu or the uplink.

This PR also fixes forensics failing to update on held items when gloves are equipped/changed/unequipped.

Why / Balance

The first bug causes held items acquired without being picked up to not have forensics. While most items still require being interacted with (which applies forensics) to be used, this can still cause unintended behavior. Examples of this are the Viper, Python and Syndie Soap, which can be used and then thrown away without interacting with the item (shooting is not an item interaction, but racking the bolt/wielding is). Additionally the bug also makes it harder to do some small tactics that feel like they should be possible, like handing someone an item to get their prints on it.

Forensics not being updated when gloves are swapped also allows one to avoid leaving holographic fibers on held items through carefully equipping and unequipping things in the right order. This PR fixes that.

Technical details

InventorySystem.Equip is given triggerHandContact as an optional argument. If true, it will check if the item slot being equipped to/from is a glove slot, and if so triggers DoContactInteraction. The reason why it doesn't always do this check is because certain system allows for quick equipping, where one pair of gloves get unequipped simultaneously as another pair of gloves are equipped, so triggering DoContactInteraction twice would be incorrect there (as it would incorrectly apply fingerprints after the first pair is unequipped since the code has yet to equip the second pair).

DoContactInteraction is now also triggered upon DoPickup, which covers instances where an item is given to a character without clicking on it to pick it up.

Media

Requirements

  • I have read and I am following the Pull Request Guidelines. I understand that not doing so may get my pr closed at maintainer’s discretion
  • I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

Breaking changes

Changelog

🆑

  • fix: Fingerprints and fibers are now always applied to items being held, regardless of how they got into your hands.
  • fix: Changing gloves now correctly applies new fibers/fingerprints on held items.

@metalgearsloth metalgearsloth added the Status: Awaiting Changes This PR needs its reviews addressed or changes to be made in order to be merged. label Aug 4, 2024
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the Merge Conflict This PR currently has conflicts that need to be addressed. label Sep 27, 2024
# Conflicts:
#	Content.Server/Strip/StrippableSystem.cs
@github-actions github-actions bot removed the Merge Conflict This PR currently has conflicts that need to be addressed. label Oct 8, 2024
@@ -520,4 +532,12 @@ public bool TryGetSlotEntity(EntityUid uid, string slot, [NotNullWhen(true)] out
entityUid = container.ContainedEntity;
return entityUid != null;
}

public void TriggerHandContactInteraction(EntityUid uid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This's only used within this file presently, does it need to be public?

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the Merge Conflict This PR currently has conflicts that need to be addressed. label Oct 14, 2024
# Conflicts:
#	Content.Shared/Hands/EntitySystems/SharedHandsSystem.Pickup.cs
@github-actions github-actions bot removed the Merge Conflict This PR currently has conflicts that need to be addressed. label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Changes This PR needs its reviews addressed or changes to be made in order to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants