Skip to content

Commit

Permalink
Futureproofs the nodrop check added in tgstation#80673 (tgstation#80722)
Browse files Browse the repository at this point in the history
## About The Pull Request

See tgstation#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:
  • Loading branch information
Majkl-J authored Jan 12, 2024
1 parent 6fddd51 commit 3e1575b
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions code/modules/mob/living/carbon/human/inventory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,20 +251,19 @@
update_worn_undersuit()
update_worn_oversuit()
else if(I == w_uniform)
if(invdrop)
if(r_store && IS_ORGANIC_LIMB(src.get_bodypart(BODY_ZONE_R_LEG)))
dropItemToGround(r_store, TRUE) //Again, makes sense for pockets to drop.
if(l_store && IS_ORGANIC_LIMB(src.get_bodypart(BODY_ZONE_L_LEG)))
dropItemToGround(l_store, TRUE)
if(IS_ORGANIC_LIMB(src.get_bodypart(BODY_ZONE_CHEST)))
if(wear_id)
dropItemToGround(wear_id)
if(belt)
dropItemToGround(belt)
w_uniform = null
update_suit_sensors()
if(!QDELETED(src))
update_worn_undersuit()
if(invdrop)
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 && !can_equip(l_store, ITEM_SLOT_LPOCKET, TRUE, ignore_equipped = TRUE))
dropItemToGround(l_store, TRUE)
if(wear_id && !can_equip(wear_id, ITEM_SLOT_ID, TRUE, ignore_equipped = TRUE))
dropItemToGround(wear_id)
if(belt && !can_equip(belt, ITEM_SLOT_BELT, TRUE, ignore_equipped = TRUE))
dropItemToGround(belt)
else if(I == gloves)
gloves = null
if(!QDELETED(src))
Expand Down

0 comments on commit 3e1575b

Please sign in to comment.