refactors some item transfers to use transfer_item_to() (#28405)

This commit is contained in:
chuga-git
2025-02-18 10:38:09 +00:00
committed by GitHub
parent e72967152b
commit 570b45a903
10 changed files with 10 additions and 20 deletions
+1 -2
View File
@@ -76,9 +76,8 @@
if(ismob(item_to_retrieve.loc)) //If its on someone, properly drop it
var/mob/M = item_to_retrieve.loc
if(issilicon(M) || !M.drop_item_to_ground(item_to_retrieve)) //Items in silicons warp the whole silicon
if(issilicon(M) || !M.transfer_item_to(item_to_retrieve, target.loc)) //Items in silicons warp the whole silicon
M.visible_message("<span class='warning'>[M] suddenly disappears!</span>", "<span class='danger'>A force suddenly pulls you away!</span>")
M.forceMove(target.loc)
M.loc.visible_message("<span class='caution'>[M] suddenly appears!</span>")
item_to_retrieve = null
break
+1 -2
View File
@@ -219,11 +219,10 @@ GLOBAL_VAR(bomb_set)
return ITEM_INTERACT_COMPLETE
if(istype(used, /obj/item/nuke_core/plutonium) && removal_stage == NUKE_CORE_FULLY_EXPOSED)
if(do_after(user, 2 SECONDS, target = src))
if(!user.drop_item_to_ground(used))
if(!user.transfer_item_to(used, src))
to_chat(user, "<span class='notice'>The [used] is stuck to your hand!</span>")
return
user.visible_message("<span class='notice'>[user] puts [used] back in [src].</span>", "<span class='notice'>You put [used] back in [src].</span>")
used.forceMove(src)
core = used
update_icon(UPDATE_OVERLAYS)
@@ -409,11 +409,10 @@
to_chat(user, "The headset can't hold another key!")
return
if(!user.drop_item_to_ground(key))
if(!user.transfer_item_to(key, src, FALSE, FALSE))
to_chat(user, "<span class='warning'>[key] is stuck to your hand, you can't insert it in [src].</span>")
return
key.forceMove(src)
if(!keyslot1)
keyslot1 = key
else
+1 -2
View File
@@ -54,9 +54,8 @@
/obj/item/clothing/suit/armor/vest/security/attackby__legacy__attackchain(obj/item/I, mob/user, params)
if(istype(I, /obj/item/clothing/accessory/holobadge))
if(user.drop_item_to_ground(I))
if(user.transfer_item_to(I, src))
add_fingerprint(user)
I.forceMove(src)
attached_badge = I
var/datum/action/A = new /datum/action/item_action/remove_badge(src)
A.Grant(user)
@@ -165,9 +165,8 @@
return
var/obj/item/queen_bee/qb = I
if(!user.drop_item_to_ground(qb))
if(!user.transfer_item_to(qb, src))
return
qb.queen.forceMove(src)
bees += qb.queen
queen_bee = qb.queen
qb.queen = null
+1 -2
View File
@@ -161,10 +161,9 @@
if(length(stored_plants) >= max_storable_plants)
to_chat(user, "<span class='warning'>[src] can't hold any more plants!</span>")
return ITEM_INTERACT_COMPLETE
if(!user.drop_item_to_ground(used))
if(!user.transfer_item_to(used, src))
return ITEM_INTERACT_COMPLETE
used.forceMove(src)
stored_plants += used
to_chat(user, "<span class='notice'>You put [used] in [src].</span>")
SStgui.update_uis(src)
+1 -2
View File
@@ -107,10 +107,9 @@
if(biomass >= biomass_capacity && potassium >= potassium_capacity)
to_chat(user, "<span class='warning'>[src] can't hold any more biomass, and its contents are saturated with potassium!</span>")
return ITEM_INTERACT_COMPLETE
if(!user.drop_item_to_ground(used))
if(!user.transfer_item_to(used, src))
return ITEM_INTERACT_COMPLETE
used.forceMove(src)
make_biomass(used)
to_chat(user, "<span class='notice'>You put [used] in [src].</span>")
SStgui.update_uis(src)
+1 -2
View File
@@ -386,9 +386,8 @@ GLOBAL_LIST_EMPTY(allNewscasters)
return
if(ishuman(usr))
var/obj/item/photo/P = usr.get_active_hand()
if(istype(P) && usr.drop_item_to_ground(P))
if(istype(P) && usr.transfer_item_to(P, src))
photo = P
P.forceMove(src)
usr.visible_message("<span class='notice'>[usr] inserts [P] into [src]'s photo slot.</span>",\
"<span class='notice'>You insert [P] into [src]'s photo slot.</span>")
playsound(loc, 'sound/machines/terminal_insert_disc.ogg', 30, TRUE)
+1 -2
View File
@@ -41,10 +41,9 @@
/obj/machinery/computer/rnd_backup/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/disk/rnd_backup_disk) && istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(!H.drop_item_to_ground(used))
if(!H.transfer_item_to(used, src))
return ITEM_INTERACT_COMPLETE
used.forceMove(src)
inserted_disk = used
to_chat(user, "<span class='notice'>You insert [used] into [src].</span>")
SStgui.update_uis(src)
+1 -2
View File
@@ -83,13 +83,12 @@ Note: Must be placed within 3 tiles of the R&D Console
to_chat(user, "<span class='warning'>You cannot deconstruct this item!</span>")
return ITEM_INTERACT_COMPLETE
if(!user.drop_item())
if(!user.transfer_item_to(used, src))
to_chat(user, "<span class='warning'>[used] is stuck to your hand, you cannot put it in [src]!</span>")
return ITEM_INTERACT_COMPLETE
busy = TRUE
loaded_item = used
used.loc = src
to_chat(user, "<span class='notice'>You add [used] to [src]!</span>")
SStgui.update_uis(linked_console)
flick("s_analyzer_la", src)