Fixes xenos being able to pick up items that they shouldn't by most means, expands itempicky component functionality (#86714)

## About The Pull Request

Xenos can apparently use shenanigans such as
https://github.com/tgstation/tgstation/issues/86703 to put some items in
their hand, and there are likely methods like this dotted around the
codebase. However, the signal to put something in their hand is called
consistently across any process that would cause them to pick up or
otherwise have something to put in their hand, so instead I added
/datum/component/itempicky to xenos.

While I was in there, I expanded the functionality of itempicky; it can
run a callback to determine a condition that needs to be met now.

## Why It's Good For The Game

Fixes https://github.com/tgstation/tgstation/issues/86703
Expands a component's usefulness
## Changelog
🆑 Bisar
fix: Xenomorph restrictions on items they can pick up have had their
determining logic made more _robust_.
code: The itempicky component (restricts what can be picked up via a
whitelist) can now, optionally, have a callback fed to it to determine
cases of bypassing that whitelist.
/🆑

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
This commit is contained in:
Joshua Kidder
2024-09-18 17:38:07 -04:00
committed by GitHub
parent 9af9189615
commit 240e397b95
8 changed files with 26 additions and 11 deletions

View File

@@ -181,7 +181,7 @@
/obj/item/modular_computer/pda/proc/remove_pen(mob/user)
if(issilicon(user) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH)) //TK doesn't work even with this removed but here for readability
if(issilicon(user) || !user.can_perform_action(src, FORBID_TELEKINESIS_REACH | NEED_DEXTERITY)) //TK doesn't work even with this removed but here for readability
return
if(inserted_item)