Refactor /mob/unEquip. (#27720)

* Refactor /mob/unEquip.

* fix things found in testing

* more fixes from testing

* fix removal of hooded suits

* fix flayers inability to deploy swarmprod

* fix changeling blade activation

* unnecessary parens

* pass default unequip args to proc overrides

* fix belts being able to forceMove into full hands
This commit is contained in:
warriorstar-orion
2025-01-09 20:58:35 -05:00
committed by GitHub
parent 17602326bc
commit 0eafad8475
213 changed files with 587 additions and 585 deletions
@@ -257,7 +257,7 @@
if(istype(T, denied_type) || istype(src, T.denied_type))
to_chat(user, "<span class='warning'>You can't seem to attach [src] to [H]. Maybe remove a few trophies?</span>")
return FALSE
if(!user.unEquip(src))
if(!user.unequip(src))
return
forceMove(H)
H.trophies += src
@@ -45,7 +45,7 @@
to_chat(user, "<span class='notice'>You start planting [src].</span>")
if(!do_after(user, (2.5 SECONDS) * toolspeed, target = AM))
return
if(!user.unEquip(src))
if(!user.unequip(src))
return
target = AM
forceMove(AM)
@@ -52,7 +52,7 @@
to_chat(user, "<span class='notice'>There's an ID inserted already.</span>")
return
if(!user.unEquip(I))
if(!user.drop_item_to_ground(I))
return
I.forceMove(src)
@@ -108,7 +108,7 @@
var/obj/item/I = ui.user.get_active_hand()
if(istype(I, /obj/item/card/id/prisoner))
if(!ui.user.unEquip(I))
if(!ui.user.drop_item_to_ground(I))
return
I.forceMove(src)
inserted_id_uid = I.UID()
@@ -39,11 +39,11 @@
user.visible_message("<span class='hierophant_warning'>[user] fades out, leaving [user.p_their()] belongings behind!</span>")
for(var/obj/item/I in user)
if(I != src)
user.unEquip(I)
user.drop_item_to_ground(I)
for(var/turf/T in RANGE_TURFS(1, user))
var/obj/effect/temp_visual/hierophant/blast/B = new(T, user, TRUE)
B.damage = 0
user.unEquip(src) //Drop us last, so it goes on top of their stuff
user.drop_item_to_ground(src) //Drop us last, so it goes on top of their stuff
qdel(user)
return OBLITERATION
@@ -91,7 +91,7 @@
playsound(loc, "rustle", 50, TRUE, -5)
if(istype(over_object, /atom/movable/screen/inventory/hand))
if(!M.unEquip(src))
if(!M.unequip(src))
return
M.put_in_active_hand(src)
else
@@ -379,7 +379,7 @@
if(ishuman(owner) && !QDELETED(owner))
if(ishuman(loc))
var/mob/living/carbon/human/thief = loc
thief.unEquip(src, TRUE, TRUE) // You're not my owner!
thief.drop_item_to_ground(src, force = TRUE, silent = TRUE) // You're not my owner!
if(owner.stat == DEAD)
qdel(src) // Oh no! Oh well a new rod will be made from the STATUS_EFFECT_HIPPOCRATIC_OATH
return