Revert "Fixes for inserting/removing storage items/swapping items between han…" (#27706)

This reverts commit 012e1f1010.
This commit is contained in:
warriorstar-orion
2024-12-21 19:10:33 -05:00
committed by GitHub
parent 012e1f1010
commit 718b5787cb
9 changed files with 45 additions and 82 deletions
+5 -45
View File
@@ -66,34 +66,6 @@
if(ITEM_SLOT_RIGHT_HAND)
return put_in_r_hand(I)
/**
* Swaps items between hands.
*
* A separate implementation is required for this because all of the
* pre-existing equip/unEquip procs perform forceMoves we don't want.
*/
/mob/proc/swap_item_between_hands()
var/obj/item/I = get_inactive_hand()
if(!put_in_hand_check(I))
return FALSE
if(I == r_hand && has_left_hand())
r_hand = null
l_hand = I
update_inv_r_hand()
update_inv_l_hand()
I.equipped(src, ITEM_SLOT_LEFT_HAND)
return TRUE
else if(I == l_hand && has_right_hand())
l_hand = null
r_hand = I
update_inv_l_hand()
update_inv_r_hand()
I.equipped(src, ITEM_SLOT_RIGHT_HAND)
return TRUE
return FALSE
//Puts the item into your l_hand if possible and calls all necessary triggers/updates. returns 1 on success.
/mob/proc/put_in_l_hand(obj/item/W, skip_blocked_hands_check = FALSE)
if(!put_in_hand_check(W, skip_blocked_hands_check))
@@ -194,26 +166,13 @@
return TRUE
/**
* Unequip an item from the hand that the item is found in.
*
* `force` overrides NODROP for things like wizarditis and admin undress.
*
* `destination` allows for items to be unequipped directly into storage and
* should only be used for that.
*
* Horrid stop-gap until we get atom storage or something.
*/
/mob/proc/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/proc/unEquip(obj/item/I, force, silent = FALSE) //Force overrides NODROP for things like wizarditis and admin undress.
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return 1
if(!canUnEquip(I, force))
return 0
if(isnull(destination))
destination = drop_location()
if(I == r_hand)
r_hand = null
update_inv_r_hand()
@@ -222,13 +181,14 @@
update_inv_l_hand()
else if(I in tkgrabbed_objects)
var/obj/item/tk_grab/tkgrab = tkgrabbed_objects[I]
unEquip(tkgrab, force, silent, destination)
unEquip(tkgrab, force)
if(I)
if(client)
client.screen -= I
if(destination)
I.forceMove(destination)
var/turf/drop_loc = drop_location()
if(drop_loc)
I.forceMove(drop_loc)
else
I.moveToNullspace()
I.dropped(src, silent)
@@ -1,3 +1,3 @@
//can't unequip since it can't equip anything // why the fuck is this it's own file
/mob/living/carbon/alien/larva/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/carbon/alien/larva/unEquip(obj/item/I, force, silent = FALSE)
return
@@ -731,7 +731,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
/mob/living/carbon/get_restraining_item()
return handcuffed
/mob/living/carbon/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/carbon/unEquip(obj/item/I, force, silent = FALSE) //THIS PROC DID NOT CALL ..()
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
return
@@ -67,7 +67,7 @@
if(ITEM_SLOT_ACCESSORY)
return TRUE
/mob/living/carbon/human/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/carbon/human/unEquip(obj/item/I, force, silent = FALSE)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
@@ -239,7 +239,7 @@
while(slot_start != slot_num) //If we wrap around without finding any free slots, just give up.
return
/mob/living/silicon/robot/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/silicon/robot/unEquip(obj/item/I, force, silent = FALSE)
if(I == module_active)
uneq_active(I)
return ..()
@@ -504,7 +504,7 @@
if(ITEM_SLOT_COLLAR)
add_collar(W)
/mob/living/simple_animal/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/simple_animal/unEquip(obj/item/I, force, silent = FALSE)
. = ..()
if(!. || !I)
return
@@ -266,7 +266,7 @@
return
return ..()
/mob/living/simple_animal/slime/unEquip(obj/item/I, force = FALSE, silent = FALSE, atom/destination)
/mob/living/simple_animal/slime/unEquip(obj/item/I, force, silent = FALSE)
return
/mob/living/simple_animal/slime/start_pulling(atom/movable/AM, state, force = pull_force, show_message = FALSE)