Skip to content

Commit

Permalink
[PORT] Having a robot chest/legs no longer makes you drop all items u…
Browse files Browse the repository at this point in the history
…pon losing your jumpsuit (#2489)

* Having a robot chest/legs no longer makes you drop all items upon losing your jumpsuit (#80673)

## About The Pull Request

See name, losing your jumpsuit with a robot chest/legs no longer spills
your stuff over the floor

## Why It's Good For The Game

Having a robot chest allows you to use the belt and ID inventory slots,
with legs adding pockets respectively, even when you don't have a
jumpsuit. Losing it probably shouldn't drop all your stuff when the
slots for it are still valid.

## Changelog

No idea if this is a qol, fix, add, or balance change. Feel free to edit
this to whichever one it's supposed to be
:cl:
fix: Having an inorganic chest/legs no longer makes you drop your ID,
belt or pocketed stuff upon losing your jumpsuit
/:cl:

* Futureproofs the nodrop check added in #80673 (#80722)

## About The Pull Request

See #80673 
I took a nap and got an idea how to make it better, so here we are

Less snowflake code, very robust, very good

Technically runs way more checks so it is slower but eh I believe it's
worth it in this case

Fully tested, it works as it should

## Changelog
:cl:
code: The check that prevents your stuff from dropping when you have
robotic parts is now more robust
/:cl:

---------

Co-authored-by: Waterpig <[email protected]>
  • Loading branch information
Absolucy and Majkl-J authored Jul 23, 2024
1 parent a9c0a63 commit 4a1304a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions code/modules/mob/living/carbon/human/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,19 @@
update_worn_undersuit()
update_worn_oversuit()
else if(I == w_uniform)
w_uniform = null
update_suit_sensors()
if(!QDELETED(src))
update_worn_undersuit()
if(invdrop)
if(r_store)
if(r_store && !can_equip(r_store, ITEM_SLOT_RPOCKET, TRUE, ignore_equipped = TRUE))
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store)
if(l_store && !can_equip(l_store, ITEM_SLOT_LPOCKET, TRUE, ignore_equipped = TRUE))
dropItemToGround(l_store, TRUE)
if(wear_id)
if(wear_id && !can_equip(wear_id, ITEM_SLOT_ID, TRUE, ignore_equipped = TRUE))
dropItemToGround(wear_id)
if(belt)
if(belt && !can_equip(belt, ITEM_SLOT_BELT, TRUE, ignore_equipped = TRUE))
dropItemToGround(belt)
w_uniform = null
update_suit_sensors()
if(!QDELETED(src))
update_worn_undersuit()
else if(I == gloves)
gloves = null
if(!QDELETED(src))
Expand Down

0 comments on commit 4a1304a

Please sign in to comment.