From 0eafad84755fc699d563bcccce64215ff0e6be92 Mon Sep 17 00:00:00 2001 From: warriorstar-orion Date: Thu, 9 Jan 2025 20:58:35 -0500 Subject: [PATCH] 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 --- code/_onclick/telekinesis.dm | 2 +- code/datums/components/ducttape.dm | 2 +- code/datums/components/sticky.dm | 2 +- code/datums/components/two_handed.dm | 10 +- code/datums/diseases/pierrot_throat.dm | 2 +- code/datums/diseases/wizarditis.dm | 2 +- code/datums/elements/strippable.dm | 4 +- code/datums/mind.dm | 2 +- code/datums/spells/banana_touch.dm | 8 +- code/datums/spells/cluwne.dm | 25 ++-- code/datums/spells/horsemask.dm | 2 +- code/datums/spells/lichdom.dm | 10 +- code/datums/spells/magnet.dm | 2 +- code/datums/spells/mime_malaise.dm | 6 +- code/datums/spells/sentient_sword_lunge.dm | 2 +- code/datums/spells/summonitem.dm | 2 +- code/game/atoms.dm | 2 +- code/game/dna/mutations/monkey_mutation.dm | 4 +- code/game/dna/mutations/mutation_powers.dm | 2 +- code/game/gamemodes/cult/cult_actions.dm | 2 +- code/game/gamemodes/cult/cult_items.dm | 16 +-- code/game/gamemodes/cult/runes.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 2 +- code/game/gamemodes/wizard/artefact.dm | 2 +- code/game/gamemodes/wizard/magic_tarot.dm | 2 +- code/game/gamemodes/wizard/soulstone.dm | 2 +- code/game/gamemodes/wizard/spellbook.dm | 2 +- code/game/gamemodes/wizard/wizloadouts.dm | 12 +- code/game/machinery/camera/camera_assembly.dm | 2 +- code/game/machinery/clonepod.dm | 4 +- .../machinery/computer/HolodeckControl.dm | 3 +- code/game/machinery/cryopod.dm | 3 +- code/game/machinery/doors/airlock.dm | 3 +- code/game/machinery/portable_turret.dm | 4 +- code/game/machinery/recycler.dm | 2 +- code/game/machinery/teleporter.dm | 3 +- code/game/mecha/equipment/weapons/weapons.dm | 2 +- code/game/mecha/mecha.dm | 4 +- code/game/objects/items.dm | 21 ++- code/game/objects/items/ashtray.dm | 2 +- code/game/objects/items/candle.dm | 2 +- code/game/objects/items/crayons.dm | 2 +- .../objects/items/devices/lightreplacer.dm | 4 +- .../items/devices/radio/electropack.dm | 7 +- .../objects/items/devices/radio/headset.dm | 2 +- code/game/objects/items/devices/scanners.dm | 2 +- .../objects/items/devices/transfer_valve.dm | 10 +- code/game/objects/items/robot/robot_parts.dm | 2 +- code/game/objects/items/sport.dm | 2 +- code/game/objects/items/stacks/rods.dm | 2 +- code/game/objects/items/tools/crowbar.dm | 2 +- code/game/objects/items/tools/multitool.dm | 2 +- code/game/objects/items/tools/wirecutters.dm | 2 +- code/game/objects/items/tools/wrench.dm | 2 +- code/game/objects/items/toys.dm | 9 +- code/game/objects/items/weapons/RCD.dm | 2 +- .../items/weapons/bio_chips/bio_chip_pad.dm | 2 +- code/game/objects/items/weapons/cards_ids.dm | 3 +- .../chemical_flamethrower.dm | 11 +- code/game/objects/items/weapons/cigs.dm | 12 +- code/game/objects/items/weapons/defib.dm | 4 +- code/game/objects/items/weapons/dice.dm | 2 +- code/game/objects/items/weapons/explosives.dm | 6 +- .../objects/items/weapons/gift_wrappaper.dm | 2 +- .../items/weapons/grenades/bananade.dm | 2 +- .../objects/items/weapons/grenades/grenade.dm | 2 +- code/game/objects/items/weapons/handcuffs.dm | 8 +- .../objects/items/weapons/holy_weapons.dm | 2 +- .../weapons/melee/energy_melee_weapons.dm | 2 - code/game/objects/items/weapons/misc_items.dm | 2 +- .../objects/items/weapons/pneumaticCannon.dm | 4 +- code/game/objects/items/weapons/powerfist.dm | 2 +- code/game/objects/items/weapons/staff.dm | 2 +- .../objects/items/weapons/storage/belt.dm | 14 +- .../objects/items/weapons/storage/internal.dm | 4 +- .../items/weapons/storage/storage_base.dm | 6 +- code/game/objects/items/weapons/stunbaton.dm | 2 +- .../objects/items/weapons/tanks/tank_types.dm | 3 +- .../objects/items/weapons/tanks/watertank.dm | 6 +- code/game/objects/items/weapons/twohanded.dm | 4 +- code/game/objects/items/weapons/weaponry.dm | 8 +- code/game/objects/mail.dm | 2 +- .../crates_lockers/closets/fireaxe.dm | 2 +- code/game/objects/structures/janicart.dm | 2 +- code/game/objects/structures/mop_bucket.dm | 2 +- .../structures/stool_bed_chair_nest/bed.dm | 2 +- .../structures/stool_bed_chair_nest/chairs.dm | 2 +- code/game/objects/structures/watercloset.dm | 2 +- code/modules/admin/topic.dm | 12 +- code/modules/admin/verbs/onlyone.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 4 +- .../changeling/powers/biodegrade.dm | 2 - .../changeling/powers/mutations.dm | 25 ++-- .../modules/antagonists/cult/datum_cultist.dm | 2 +- .../powers/flayer_weapon_powers.dm | 5 +- .../contractor/datums/syndicate_contract.dm | 6 +- code/modules/arcade/arcade_prize.dm | 2 +- code/modules/arcade/prize_counter.dm | 2 +- code/modules/assembly/assembly_holder.dm | 12 +- code/modules/assembly/bomb.dm | 2 +- code/modules/clothing/clothing.dm | 26 ++-- code/modules/clothing/glasses/glasses.dm | 2 +- code/modules/clothing/shoes/magboots.dm | 2 +- code/modules/clothing/spacesuits/hardsuit.dm | 2 +- code/modules/clothing/suits/armor_suits.dm | 2 +- code/modules/clothing/suits/hood.dm | 5 +- code/modules/clothing/suits/misc_suits.dm | 2 +- code/modules/clothing/suits/toggles.dm | 3 +- .../clothing/under/accessories/holster.dm | 4 +- code/modules/crafting/guncrafting.dm | 12 +- code/modules/customitems/item_defines.dm | 2 +- code/modules/detective_work/evidence.dm | 2 +- .../food_and_drinks/drinks/bottler/bottler.dm | 10 +- .../food_and_drinks/food/customizables.dm | 2 +- .../food_and_drinks/food/foods/junkfood.dm | 4 +- .../food_and_drinks/food/foods/pizza.dm | 2 +- code/modules/food_and_drinks/food_base.dm | 3 +- .../kitchen_machinery/gibber.dm | 6 +- .../kitchen_machinery/smartfridge.dm | 10 +- code/modules/games/cards.dm | 6 +- code/modules/hydroponics/beekeeping/beebox.dm | 4 +- code/modules/hydroponics/biogenerator.dm | 2 +- code/modules/hydroponics/compost_bin.dm | 2 +- code/modules/hydroponics/grown.dm | 2 +- code/modules/hydroponics/grown/citrus.dm | 2 +- code/modules/hydroponics/grown/corn.dm | 1 - code/modules/hydroponics/grown/flowers.dm | 1 - code/modules/hydroponics/grown/nettle.dm | 2 +- code/modules/hydroponics/grown/potato.dm | 2 +- code/modules/hydroponics/grown/root.dm | 2 +- code/modules/hydroponics/grown/tomato.dm | 2 +- code/modules/hydroponics/grown/towercap.dm | 2 +- code/modules/hydroponics/hydroponics_tray.dm | 2 +- code/modules/hydroponics/seed_extractor.dm | 2 +- code/modules/martial_arts/krav_maga.dm | 2 +- .../mining/equipment/kinetic_crusher.dm | 2 +- .../mining/equipment/mining_charges.dm | 2 +- code/modules/mining/laborcamp/laborshuttle.dm | 4 +- .../mining/lavaland/loot/hierophant_loot.dm | 4 +- .../mining/lavaland/loot/tendril_loot.dm | 2 +- .../mining/lavaland/necropolis_chests.dm | 2 +- code/modules/mob/inventory_procs.dm | 120 ++++++++++++------ .../carbon/alien/larva/larva_inventory.dm | 2 +- .../living/carbon/alien/special/facehugger.dm | 4 +- .../modules/mob/living/carbon/carbon_procs.dm | 21 +-- code/modules/mob/living/carbon/give.dm | 2 +- .../carbon/human/human_deadchat_control.dm | 2 +- .../mob/living/carbon/human/human_death.dm | 3 +- .../mob/living/carbon/human/human_emote.dm | 2 +- .../living/carbon/human/human_inventory.dm | 91 ++++++------- .../mob/living/carbon/human/human_mob.dm | 2 +- .../mob/living/carbon/human/human_organs.dm | 8 +- .../living/carbon/human/human_update_icons.dm | 2 +- .../living/carbon/human/species/_species.dm | 2 +- .../mob/living/carbon/human/species/golem.dm | 4 +- .../living/carbon/human/species/plasmaman.dm | 4 +- .../mob/living/carbon/human/species/vox.dm | 4 +- code/modules/mob/living/carbon/superheroes.dm | 4 +- code/modules/mob/living/living.dm | 4 +- code/modules/mob/living/silicon/pai/pai.dm | 4 +- .../living/silicon/robot/robot_inventory.dm | 6 +- .../modules/mob/living/silicon/silicon_mob.dm | 5 +- .../simple_animal/bot/bot_construction.dm | 54 ++++---- .../simple_animal/friendly/diona_nymph.dm | 2 +- .../mob/living/simple_animal/friendly/dog.dm | 2 +- .../simple_animal/friendly/farm_animals.dm | 2 +- .../friendly/nian_caterpillar.dm | 2 +- .../hostile/megafauna/hierophant.dm | 2 +- .../mob/living/simple_animal/parrot.dm | 2 +- .../mob/living/simple_animal/simple_animal.dm | 10 +- .../living/simple_animal/slime/slime_mob.dm | 2 +- code/modules/mob/mob_holder.dm | 2 +- code/modules/mob/transform_procs.dm | 16 +-- code/modules/mod/mod_activation.dm | 5 +- code/modules/mod/mod_control.dm | 2 +- code/modules/mod/modules/_modules.dm | 3 +- code/modules/mod/modules/module_pathfinder.dm | 2 +- code/modules/mod/modules/modules_security.dm | 2 +- code/modules/newscaster/obj/newscaster.dm | 2 +- code/modules/paperwork/clipboard.dm | 5 +- code/modules/paperwork/desk_bell.dm | 5 +- code/modules/paperwork/filingcabinet.dm | 2 +- code/modules/paperwork/paper.dm | 18 +-- code/modules/paperwork/paper_bundle.dm | 12 +- code/modules/paperwork/paperbin.dm | 6 +- code/modules/paperwork/paperplane.dm | 6 +- code/modules/paperwork/photography.dm | 6 +- .../projectiles/ammunition/ammo_casings.dm | 2 +- code/modules/projectiles/gun.dm | 3 +- code/modules/projectiles/guns/chaos_bolt.dm | 2 +- .../guns/energy/kinetic_accelerator.dm | 2 +- .../projectiles/guns/energy/special_eguns.dm | 2 +- .../projectiles/guns/grenade_launcher.dm | 4 +- .../projectiles/guns/projectile/automatic.dm | 2 +- .../projectiles/guns/projectile_gun.dm | 5 +- code/modules/projectiles/guns/rocket.dm | 3 +- code/modules/projectiles/guns/syringe_gun.dm | 14 +- .../projectile/magic_projectiles.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 3 +- .../chemistry/reagents/misc_reagents.dm | 2 +- .../reagent_containers/glass_containers.dm | 2 +- code/modules/recycling/sortingmachinery.dm | 7 +- code/modules/research/backup_console.dm | 2 +- .../ruins/lavalandruin_code/ash_walker_den.dm | 2 +- code/modules/surgery/limb_reattach.dm | 2 +- code/modules/surgery/organs/augments_arms.dm | 5 +- code/modules/surgery/organs/organ_external.dm | 6 +- .../modules/surgery/organs/organ_extractor.dm | 2 +- code/modules/surgery/organs/organ_internal.dm | 2 +- .../surgery/organs/subtypes/skrell_organs.dm | 2 +- .../organs/subtypes/standard_organs.dm | 23 ++-- code/modules/surgery/robotics.dm | 2 +- code/modules/telesci/telesci_computer.dm | 3 +- 213 files changed, 587 insertions(+), 585 deletions(-) diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 4bd96084e78..90ef75e9d92 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -177,7 +177,7 @@ if(isitem(target)) if(target in user.tkgrabbed_objects) // Release the old grab first - user.unEquip(user.tkgrabbed_objects[target]) + user.drop_item_to_ground(user.tkgrabbed_objects[target]) user.tkgrabbed_objects[target] = src /obj/item/tk_grab/proc/release_object() diff --git a/code/datums/components/ducttape.dm b/code/datums/components/ducttape.dm index fa749cbbc50..230e16edf81 100644 --- a/code/datums/components/ducttape.dm +++ b/code/datums/components/ducttape.dm @@ -71,7 +71,7 @@ else if(target_direction & SOUTH) x_offset = rand(-12, 12) y_offset = -16 - if(!user.unEquip(I)) + if(!user.drop_item_to_ground(I)) return to_chat(user, "You stick [I] to [target_turf].") I.pixel_x = x_offset diff --git a/code/datums/components/sticky.dm b/code/datums/components/sticky.dm index 9b1c625903f..dcfeed36aa3 100644 --- a/code/datums/components/sticky.dm +++ b/code/datums/components/sticky.dm @@ -45,7 +45,7 @@ if(!user.canUnEquip(I)) return - INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, unEquip), I) + INVOKE_ASYNC(user, TYPE_PROC_REF(/mob, drop_item_to_ground), I) var/list/click_params = params2list(params) //Center the icon where the user clicked. diff --git a/code/datums/components/two_handed.dm b/code/datums/components/two_handed.dm index c5d8143341a..df36672ac54 100644 --- a/code/datums/components/two_handed.dm +++ b/code/datums/components/two_handed.dm @@ -178,20 +178,20 @@ if(ismonkeybasic(user)) if(require_twohands) to_chat(user, "[parent] is too heavy and cumbersome for you to carry!") - user.unEquip(parent, force = TRUE) + user.drop_item_to_ground(parent, force = TRUE) else to_chat(user, "[parent] too heavy for you to wield fully.") return if(user.get_inactive_hand()) if(require_twohands) to_chat(user, "[parent] is too cumbersome to carry in one hand!") - user.unEquip(parent, force = TRUE) + user.drop_item_to_ground(parent, force = TRUE) else to_chat(user, "You need your other hand to be empty!") return if(!user.has_both_hands()) if(require_twohands) - user.unEquip(parent, force = TRUE) + user.drop_item_to_ground(parent, force = TRUE) to_chat(user, "You don't have enough intact hands.") return @@ -285,7 +285,7 @@ // if the item requires two handed drop the item on unwield if(require_twohands && can_drop) - user.unEquip(parent, force = TRUE) + user.drop_item_to_ground(parent, force = TRUE) // Show message if requested if(show_message) @@ -393,7 +393,7 @@ INVOKE_ASYNC(src, PROC_REF(unwield), user) /datum/component/two_handed/proc/try_drop_item(mob/user) - if(user.unEquip(parent)) + if(user.drop_item_to_ground(parent)) user.visible_message("[user] loses [user.p_their()] grip on [parent]!") /** diff --git a/code/datums/diseases/pierrot_throat.dm b/code/datums/diseases/pierrot_throat.dm index 0f8a1cdf896..dd2c7580924 100644 --- a/code/datums/diseases/pierrot_throat.dm +++ b/code/datums/diseases/pierrot_throat.dm @@ -50,7 +50,7 @@ var/saved_internals = H.internal - H.unEquip(H.get_item_by_slot(ITEM_SLOT_MASK)) + H.drop_item_to_ground(H.get_item_by_slot(ITEM_SLOT_MASK)) var/obj/item/clothing/mask/gas/clown_hat/peak_comedy = new peak_comedy.flags |= DROPDEL H.equip_to_slot_or_del(peak_comedy, ITEM_SLOT_MASK) diff --git a/code/datums/diseases/wizarditis.dm b/code/datums/diseases/wizarditis.dm index bb81d0de9e2..2dd23b8734a 100644 --- a/code/datums/diseases/wizarditis.dm +++ b/code/datums/diseases/wizarditis.dm @@ -82,7 +82,7 @@ var/chosen_slot_ID = pick(eligible_slot_IDs) var/chosen_fashion = magic_fashion[num2text(chosen_slot_ID)] - H.unEquip(H.get_item_by_slot(chosen_slot_ID)) + H.drop_item_to_ground(H.get_item_by_slot(chosen_slot_ID)) var/obj/item/magic_attire = new chosen_fashion magic_attire.flags |= DROPDEL H.equip_to_slot_or_del(magic_attire, chosen_slot_ID) diff --git a/code/datums/elements/strippable.dm b/code/datums/elements/strippable.dm index 416facf8aea..d30135dcf2a 100644 --- a/code/datums/elements/strippable.dm +++ b/code/datums/elements/strippable.dm @@ -263,7 +263,7 @@ /// A utility function for `/datum/strippable_item`s to finish unequipping an item from a mob. /proc/finish_unequip_mob(obj/item/item, mob/source, mob/user) - if(!source.unEquip(item)) + if(!source.drop_item_to_ground(item)) return add_attack_logs(user, source, "Stripping of [item]") @@ -427,7 +427,7 @@ return // make sure to drop the item - if(!user.unEquip(held_item)) + if(!user.drop_item_to_ground(held_item)) return strippable_item.finish_equip(owner, held_item, user) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 63d5401e225..b84e06b7b4e 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -1521,7 +1521,7 @@ switch(href_list["common"]) if("undress") for(var/obj/item/I in current) - current.unEquip(I, TRUE) + current.drop_item_to_ground(I, force = TRUE) log_admin("[key_name(usr)] has unequipped [key_name(current)]") message_admins("[key_name_admin(usr)] has unequipped [key_name_admin(current)]") if("takeuplink") diff --git a/code/datums/spells/banana_touch.dm b/code/datums/spells/banana_touch.dm index 9dc684f061a..165ba07208e 100644 --- a/code/datums/spells/banana_touch.dm +++ b/code/datums/spells/banana_touch.dm @@ -50,10 +50,10 @@ do_jitter_animation(30 SECONDS) if(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)) //Wizards get non-cursed clown robes and magical mask. - unEquip(shoes, TRUE) - unEquip(wear_mask, TRUE) - unEquip(head, TRUE) - unEquip(wear_suit, TRUE) + drop_item_to_ground(shoes, force = TRUE) + drop_item_to_ground(wear_mask, force = TRUE) + drop_item_to_ground(head, force = TRUE) + drop_item_to_ground(wear_suit, force = TRUE) equip_to_slot_if_possible(new /obj/item/clothing/head/wizard/clown, ITEM_SLOT_HEAD, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/suit/wizrobe/clown, ITEM_SLOT_OUTER_SUIT, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/shoes/clown_shoes/magical, ITEM_SLOT_SHOES, TRUE, TRUE) diff --git a/code/datums/spells/cluwne.dm b/code/datums/spells/cluwne.dm index d2d81b67288..68e48c108eb 100644 --- a/code/datums/spells/cluwne.dm +++ b/code/datums/spells/cluwne.dm @@ -32,13 +32,13 @@ singlemutcheck(src, GLOB.nervousblock, MUTCHK_FORCED) rename_character(real_name, "cluwne") - unEquip(w_uniform, 1) - unEquip(shoes, 1) - unEquip(gloves, 1) + drop_item_to_ground(w_uniform, force = TRUE) + drop_item_to_ground(shoes, force = TRUE) + drop_item_to_ground(gloves, force = TRUE) var/obj/item/organ/internal/honktumor/cursed/tumor = new tumor.insert(src) if(!istype(wear_mask, /obj/item/clothing/mask/cursedclown)) //Infinite loops otherwise - unEquip(wear_mask, 1) + drop_item_to_ground(wear_mask, force = TRUE) equip_to_slot_if_possible(new /obj/item/clothing/under/cursedclown, ITEM_SLOT_JUMPSUIT, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/gloves/cursedclown, ITEM_SLOT_GLOVES, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/mask/cursedclown, ITEM_SLOT_MASK, TRUE, TRUE) @@ -65,23 +65,14 @@ dna.SetSEState(GLOB.nervousblock, FALSE) singlemutcheck(src, GLOB.nervousblock, MUTCHK_FORCED) - var/obj/item/clothing/under/U = w_uniform - unEquip(w_uniform, 1) - if(U) - qdel(U) - - var/obj/item/clothing/shoes/S = shoes - unEquip(shoes, 1) - if(S) - qdel(S) + qdel(w_uniform) + qdel(shoes) if(istype(wear_mask, /obj/item/clothing/mask/cursedclown)) - unEquip(wear_mask, 1) + qdel(wear_mask) if(istype(gloves, /obj/item/clothing/gloves/cursedclown)) - var/obj/item/clothing/gloves/G = gloves - unEquip(gloves, 1) - qdel(G) + qdel(gloves) equip_to_slot_if_possible(new /obj/item/clothing/under/rank/procedure/iaa/formal/black, ITEM_SLOT_JUMPSUIT, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/shoes/black, ITEM_SLOT_SHOES, TRUE, TRUE) diff --git a/code/datums/spells/horsemask.dm b/code/datums/spells/horsemask.dm index 32d5cab3dcb..4e5e5e26ca1 100644 --- a/code/datums/spells/horsemask.dm +++ b/code/datums/spells/horsemask.dm @@ -40,7 +40,7 @@ magichead.voicechange = TRUE //NEEEEIIGHH target.visible_message( "[target]'s face lights up in fire, and after the event a horse's head takes its place!", \ "Your face burns up, and shortly after the fire you realise you have the face of a horse!") - if(!target.unEquip(target.wear_mask)) + if(!target.drop_item_to_ground(target.wear_mask)) qdel(target.wear_mask) target.equip_to_slot_if_possible(magichead, ITEM_SLOT_MASK, TRUE, TRUE) diff --git a/code/datums/spells/lichdom.dm b/code/datums/spells/lichdom.dm index 8440e17efa0..4df3537367f 100644 --- a/code/datums/spells/lichdom.dm +++ b/code/datums/spells/lichdom.dm @@ -59,7 +59,7 @@ if(iscarbon(current_body)) var/mob/living/carbon/C = current_body for(var/obj/item/W in C) - C.unEquip(W) + C.drop_item_to_ground(W) // Give a hint as to where the body is var/wheres_wizdo = dir2text(get_dir(body_turf, item_turf)) @@ -116,10 +116,10 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user H.set_species(/datum/species/skeleton/lich) - H.unEquip(H.wear_suit) - H.unEquip(H.head) - H.unEquip(H.shoes) - H.unEquip(H.head) + H.drop_item_to_ground(H.wear_suit) + H.drop_item_to_ground(H.head) + H.drop_item_to_ground(H.shoes) + H.drop_item_to_ground(H.head) equip_lich(H) to_chat(user, "With a hideous feeling of emptiness you watch in horrified fascination as skin sloughs off bone! Blood boils, nerves disintegrate, eyes boil in their sockets! As your organs crumble to dust in your fleshless chest you come to terms with your choice. You're a lich!") diff --git a/code/datums/spells/magnet.dm b/code/datums/spells/magnet.dm index a559b1062c0..55b03e5c7b1 100644 --- a/code/datums/spells/magnet.dm +++ b/code/datums/spells/magnet.dm @@ -48,7 +48,7 @@ try_throw_object(user, target, I) /datum/spell/charge_up/bounce/magnet/proc/try_throw_object(mob/user, mob/thrower, obj/item/to_throw) - if(!(to_throw.flags & CONDUCT) || !thrower.unEquip(to_throw, silent = TRUE)) + if(!(to_throw.flags & CONDUCT) || !thrower.drop_item_to_ground(to_throw, silent = TRUE)) return FALSE thrower.visible_message("[to_throw] gets thrown out of [thrower] [thrower.p_their()] hands!", "[to_throw] suddenly gets thrown out of your hands!") diff --git a/code/datums/spells/mime_malaise.dm b/code/datums/spells/mime_malaise.dm index 67de6301334..48ea74fda89 100644 --- a/code/datums/spells/mime_malaise.dm +++ b/code/datums/spells/mime_malaise.dm @@ -35,9 +35,9 @@ /mob/living/carbon/human/proc/mimetouched() Weaken(14 SECONDS) if(iswizard(src) || (mind && mind.special_role == SPECIAL_ROLE_WIZARD_APPRENTICE)) //Wizards get non-cursed mime outfit. Replace with mime robes if we add those. - unEquip(wear_mask, TRUE) - unEquip(w_uniform, TRUE) - unEquip(wear_suit, TRUE) + drop_item_to_ground(wear_mask, force = TRUE) + drop_item_to_ground(w_uniform, force = TRUE) + drop_item_to_ground(wear_suit, force = TRUE) equip_to_slot_if_possible(new /obj/item/clothing/mask/gas/mime, ITEM_SLOT_MASK, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/under/rank/civilian/mime, ITEM_SLOT_JUMPSUIT, TRUE, TRUE) equip_to_slot_if_possible(new /obj/item/clothing/suit/suspenders, ITEM_SLOT_OUTER_SUIT, TRUE, TRUE) diff --git a/code/datums/spells/sentient_sword_lunge.dm b/code/datums/spells/sentient_sword_lunge.dm index 2053a75a87e..630ffd1b6ba 100644 --- a/code/datums/spells/sentient_sword_lunge.dm +++ b/code/datums/spells/sentient_sword_lunge.dm @@ -18,7 +18,7 @@ var/obj/item/nullrod/scythe/talking/user_sword = user.loc if(ishuman(user_sword.loc)) var/mob/living/carbon/holder = user_sword.loc - holder.unEquip(user_sword) + holder.drop_item_to_ground(user_sword) else if(isstorage(user_sword.loc)) if(prob(50)) to_chat(user, "You fail to break out of [user_sword.loc]!") diff --git a/code/datums/spells/summonitem.dm b/code/datums/spells/summonitem.dm index 53fad3cca44..2c4bd719ff3 100644 --- a/code/datums/spells/summonitem.dm +++ b/code/datums/spells/summonitem.dm @@ -76,7 +76,7 @@ if(ismob(item_to_retrieve.loc)) //If its on someone, properly drop it var/mob/M = item_to_retrieve.loc - if(issilicon(M) || !M.unEquip(item_to_retrieve)) //Items in silicons warp the whole silicon + if(issilicon(M) || !M.drop_item_to_ground(item_to_retrieve)) //Items in silicons warp the whole silicon M.visible_message("[M] suddenly disappears!", "A force suddenly pulls you away!") M.forceMove(target.loc) M.loc.visible_message("[M] suddenly appears!") diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 95735505f54..afc7519b673 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -300,7 +300,7 @@ var/atom/movable/M = A if(isliving(M.loc)) var/mob/living/L = M.loc - L.unEquip(M) + L.drop_item_to_ground(M) M.forceMove(src) ///Return the air if we can analyze it diff --git a/code/game/dna/mutations/monkey_mutation.dm b/code/game/dna/mutations/monkey_mutation.dm index d1c4d7f960b..e731abe19fe 100644 --- a/code/game/dna/mutations/monkey_mutation.dm +++ b/code/game/dna/mutations/monkey_mutation.dm @@ -17,7 +17,7 @@ for(var/obj/item/W in H) if(istype(W, /obj/item/bio_chip)) continue - H.unEquip(W) + H.drop_item_to_ground(W) H.regenerate_icons() ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRANSFORMING_TRAIT) @@ -51,7 +51,7 @@ continue if(istype(W, /obj/item/bio_chip)) continue - H.unEquip(W) + H.drop_item_to_ground(W) H.regenerate_icons() ADD_TRAIT(H, TRAIT_IMMOBILIZED, TRANSFORMING_TRAIT) ADD_TRAIT(H, TRAIT_HANDS_BLOCKED, TRANSFORMING_TRAIT) diff --git a/code/game/dna/mutations/mutation_powers.dm b/code/game/dna/mutations/mutation_powers.dm index 078633409f4..e13572621a0 100644 --- a/code/game/dna/mutations/mutation_powers.dm +++ b/code/game/dna/mutations/mutation_powers.dm @@ -472,7 +472,7 @@ if(ismob(the_item.loc) && isitem(the_item)) var/obj/item/eaten = the_item var/mob/the_owner = the_item.loc - if(!the_owner.unEquip(eaten, FALSE, TRUE)) + if(!the_owner.drop_item_to_ground(eaten, silent = TRUE)) to_chat(user, "You can't eat [the_item], it won't go down your throat!") return user.visible_message("[user] eats [the_item].") diff --git a/code/game/gamemodes/cult/cult_actions.dm b/code/game/gamemodes/cult/cult_actions.dm index 83c1b3155bb..0fc42ddf9fe 100644 --- a/code/game/gamemodes/cult/cult_actions.dm +++ b/code/game/gamemodes/cult/cult_actions.dm @@ -121,7 +121,7 @@ /datum/action/innate/cult/use_dagger/Activate() var/obj/item/melee/cultblade/dagger/D = owner.find_item(/obj/item/melee/cultblade/dagger) if(D) - owner.remove_from_mob(D) + owner.unequip(D) owner.put_in_hands(D) D.activate_self(owner) else diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 053ecf814bf..a6b2e8ae567 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -40,7 +40,7 @@ if(!IS_CULTIST(user)) user.Weaken(10 SECONDS) - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.visible_message("A powerful force shoves [user] away from [target]!", "\"You shouldn't play with sharp things. You'll poke someone's eye out.\"") if(ishuman(user)) @@ -70,7 +70,7 @@ if(HAS_TRAIT(user, TRAIT_HULK)) to_chat(user, "You can't seem to hold the blade properly!") - user.unEquip(src, TRUE) + user.drop_item_to_ground(src, force = TRUE) /obj/item/restraints/legcuffs/bola/cult name = "runed bola" @@ -175,7 +175,7 @@ if(!IS_CULTIST(user)) // Todo: Make this only happen when actually equipped to the correct slot. (For all cult items) to_chat(user, "\"I wouldn't advise that.\"") to_chat(user, "An overwhelming sense of nausea overpowers you!") - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.Confused(20 SECONDS) user.Weaken(10 SECONDS) @@ -212,7 +212,7 @@ if(!IS_CULTIST(user)) to_chat(user, "\"I wouldn't advise that.\"") to_chat(user, "An overwhelming sense of nausea overpowers you!") - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.Confused(20 SECONDS) user.Weaken(10 SECONDS) else if(slot == ITEM_SLOT_OUTER_SUIT) @@ -278,7 +278,7 @@ ..() if(!IS_CULTIST(user)) to_chat(user, "\"You want to be blind, do you?\"") - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.Confused(60 SECONDS) user.Weaken(10 SECONDS) user.EyeBlind(60 SECONDS) @@ -292,7 +292,7 @@ /obj/item/shuttle_curse/attack_self__legacy__attackchain(mob/living/user) if(!IS_CULTIST(user)) - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.Weaken(10 SECONDS) to_chat(user, "A powerful force shoves you away from [src]!") return @@ -345,7 +345,7 @@ to_chat(user, "[src] is dull and unmoving in your hands.") return if(!IS_CULTIST(user)) - user.unEquip(src, TRUE) + user.drop_item_to_ground(src, force = TRUE) step(src, pick(GLOB.alldirs)) to_chat(user, "[src] flickers out of your hands, too eager to move!") return @@ -664,7 +664,7 @@ cooldown = world.time + 20 if(isliving(spear.loc)) var/mob/living/L = spear.loc - L.unEquip(spear) + L.drop_item_to_ground(spear) L.visible_message("An unseen force pulls the blood spear from [L]'s hands!") spear.throw_at(owner, 10, 2, null, dodgeable = FALSE) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index 9592e8ecaf4..c954a0ae059 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -1002,7 +1002,7 @@ structure_check() searches for nearby cultist structures required for the invoca new_human.visible_message("[new_human] suddenly dissolves into bones and ashes.", "Your link to the world fades. Your form breaks apart.") for(var/obj/item/I in new_human.get_all_slots()) - new_human.unEquip(I) + new_human.drop_item_to_ground(I) new_human.mind.remove_antag_datum(/datum/antagonist/cultist, silent_removal = TRUE) new_human.dust() diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 270db643db8..325c0ac431a 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -219,7 +219,7 @@ GLOBAL_VAR(bomb_set) return if(istype(O, /obj/item/nuke_core/plutonium) && removal_stage == NUKE_CORE_FULLY_EXPOSED) if(do_after(user, 2 SECONDS, target = src)) - if(!user.unEquip(O)) + if(!user.drop_item_to_ground(O)) to_chat(user, "The [O] is stuck to your hand!") return user.visible_message("[user] puts [O] back in [src].", "You put [O] back in [src].") diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index d9162487b06..e4f6698fe30 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -752,7 +752,7 @@ GLOBAL_LIST_EMPTY(multiverse) victim.revive() for(var/obj/item/item in victim) - victim.unEquip(item) + victim.drop_item_to_ground(item) var/skeleton_type = pick("roman", "pirate", "yand", "clown") diff --git a/code/game/gamemodes/wizard/magic_tarot.dm b/code/game/gamemodes/wizard/magic_tarot.dm index b6d2cbc6140..4bd0c9ec4fe 100644 --- a/code/game/gamemodes/wizard/magic_tarot.dm +++ b/code/game/gamemodes/wizard/magic_tarot.dm @@ -682,7 +682,7 @@ for(var/obj/item/I in H) if(istype(I, /obj/item/bio_chip)) continue - H.unEquip(I) + H.drop_item_to_ground(I) /datum/tarot/reversed/the_magician name = "I - The Magician?" diff --git a/code/game/gamemodes/wizard/soulstone.dm b/code/game/gamemodes/wizard/soulstone.dm index 3d45da2bab2..2cf42faeaee 100644 --- a/code/game/gamemodes/wizard/soulstone.dm +++ b/code/game/gamemodes/wizard/soulstone.dm @@ -459,7 +459,7 @@ to_chat(user, "Capture successful!: [M.real_name]'s soul has been ripped from [user.p_their()] body and stored within the soul stone.") if(!isrobot(M)) for(var/obj/item/I in M) - M.unEquip(I) + M.drop_item_to_ground(I) var/target_body = M if(isbrain(M)) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 22e844b1917..087734dee17 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -1112,7 +1112,7 @@ magichead.flags |= NODROP | DROPDEL //curses! magichead.flags_inv = null //so you can still see their face magichead.voicechange = TRUE //NEEEEIIGHH - if(!user.unEquip(user.wear_mask)) + if(!user.drop_item_to_ground(user.wear_mask)) qdel(user.wear_mask) user.equip_to_slot_if_possible(magichead, ITEM_SLOT_MASK, TRUE, TRUE) qdel(src) diff --git a/code/game/gamemodes/wizard/wizloadouts.dm b/code/game/gamemodes/wizard/wizloadouts.dm index 480ee9dfd61..b08bac86595 100644 --- a/code/game/gamemodes/wizard/wizloadouts.dm +++ b/code/game/gamemodes/wizard/wizloadouts.dm @@ -86,7 +86,7 @@ to_chat(user, "A spectral hand appears from your spellbook and pulls a brand new plasmaman envirosuit, complete with helmet, from the void, then drops it on the floor.") new /obj/item/clothing/head/helmet/space/plasmaman/assistant(get_turf(user)) new /obj/item/clothing/under/plasmaman/assistant(get_turf(user)) - user.unEquip(user.wear_id) + user.drop_item_to_ground(user.wear_id) user.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/glorf, ITEM_SLOT_JUMPSUIT) //Just in case they're naked var/obj/item/card/id/wizid = new /obj/item/card/id(src) user.equip_to_slot_or_del(wizid, ITEM_SLOT_ID) @@ -130,14 +130,8 @@ destroy_spellbook = TRUE /datum/spellbook_entry/loadout/fireball/OnBuy(mob/living/carbon/human/user, obj/item/spellbook/book) - if(user.wear_suit) - var/jumpsuit = user.wear_suit - user.unEquip(user.wear_suit, TRUE) - qdel(jumpsuit) - if(user.head) - var/head = user.head - user.unEquip(user.head, TRUE) - qdel(head) + qdel(user.wear_suit) + qdel(user.head) // Part of Sacred Flame to_chat(user, "You feel fireproof.") diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index 9bdd6811c36..f65c68866e5 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -49,7 +49,7 @@ // Upgrades! else if(is_type_in_list(I, possible_upgrades) && !is_type_in_list(I, upgrades)) // Is a possible upgrade and isn't in the camera already. - if(!user.unEquip(I)) + if(!user.drop_item_to_ground(I)) to_chat(user, "[I] is stuck!") return to_chat(user, "You attach [I] into the assembly inner circuits.") diff --git a/code/game/machinery/clonepod.dm b/code/game/machinery/clonepod.dm index de0a0af13a8..396f107fe9b 100644 --- a/code/game/machinery/clonepod.dm +++ b/code/game/machinery/clonepod.dm @@ -538,10 +538,10 @@ var/mob/M = inserted.loc if(!M.get_active_hand() == inserted) return //not sure how this would happen, but smartfridges check for it so - if(!M.drop_item()) + if(!M.unequip(inserted)) to_chat(inserter, "[inserted] is stuck to you!") return - M.unEquip(inserted) + inserted.forceMove(src) to_chat(inserter, "You insert [inserted] into [src]'s organ storage.") SStgui.try_update_ui(inserter, src) diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 6e037b9db45..6628f3577fd 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -131,7 +131,8 @@ var/mob/M = obj.loc if(istype(M)) - M.unEquip(obj, TRUE) //Holoweapons should always drop. + // Holoweapons should always drop. + M.drop_item_to_ground(obj, force = TRUE) if(!silent) var/obj/old_obj = obj diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index e5822924c39..eb8abb22c23 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -334,8 +334,7 @@ /obj/machinery/cryopod/proc/despawn_occupant() //Drop all items into the pod. for(var/obj/item/I in occupant) - occupant.unEquip(I) - I.forceMove(src) + occupant.transfer_item_to(I, src) handle_contents(I) //Delete all items not on the preservation list. diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index e5b8e4b5c39..df0d3bbd963 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1024,12 +1024,11 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays) if(note) to_chat(user, "There's already something pinned to this airlock! Use wirecutters or your hands to remove it.") return - if(!user.unEquip(C)) + if(!user.transfer_item_to(C, src)) to_chat(user, "For some reason, you can't attach [C]!") return C.add_fingerprint(user) user.create_log(MISC_LOG, "put [C] on", src) - C.forceMove(src) user.visible_message("[user] pins [C] to [src].", "You pin [C] to [src].") note = C update_icon() diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index dc292c44f28..f97faf4f0ad 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -924,7 +924,7 @@ GLOBAL_LIST_EMPTY(turret_icons) if(isrobot(user)) return var/obj/item/gun/energy/E = I //typecasts the item to an energy gun - if(!user.unEquip(I)) + if(!user.unequip(I)) to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]") return if(!E.can_fit_in_turrets) @@ -953,7 +953,7 @@ GLOBAL_LIST_EMPTY(turret_icons) if(4) if(isprox(I)) - if(!user.unEquip(I)) + if(!user.unequip(I, src)) to_chat(user, "\the [I] is stuck to your hand, you cannot put it in \the [src]") return build_step = 5 diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index a9b800a5933..f6a7070cbfa 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -189,7 +189,7 @@ // Remove and recycle the equipped items if(eat_victim_items) for(var/obj/item/I in L.get_equipped_items(TRUE)) - if(L.unEquip(I)) + if(L.drop_item_to_ground(I)) eat(I, sound = 0) // Instantly lie down, also go unconscious from the pain, before you die. diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 39449cab825..da4fafec5c3 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -51,10 +51,9 @@ if(istype(I, /obj/item/gps)) var/obj/item/gps/L = I if(L.locked_location && !(stat & (NOPOWER|BROKEN))) - if(!user.unEquip(L)) + if(!user.transfer_item_to(L, src)) to_chat(user, "[I] is stuck to your hand, you cannot put it in [src]") return - L.forceMove(src) locked = L to_chat(user, "You insert the GPS device into [src]'s slot.") else diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index a1a29b0b6e2..6d55f9a41ef 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -232,7 +232,7 @@ var/mob/living/carbon/human/H = M if(isobj(H.shoes) && !(H.shoes.flags & NODROP)) var/thingy = H.shoes - H.unEquip(H.shoes) + H.drop_item_to_ground(thingy) walk_away(thingy,chassis,15,2) spawn(20) if(thingy) diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 285462a9433..a0719e38671 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -771,7 +771,7 @@ return else if(istype(W, /obj/item/mecha_parts/mecha_tracking)) - if(!user.unEquip(W)) + if(!user.drop_item_to_ground(W)) to_chat(user, "\the [W] is stuck to your hand, you cannot put it in \the [src]") return @@ -1232,7 +1232,7 @@ else if(mmi_as_oc.brainmob.stat) to_chat(user, "Beta-rhythm below acceptable level.") return FALSE - if(!user.unEquip(mmi_as_oc)) + if(!user.drop_item_to_ground(mmi_as_oc)) to_chat(user, "\the [mmi_as_oc] is stuck to your hand, you cannot put it in \the [src]") return FALSE var/mob/living/brain/brainmob = mmi_as_oc.brainmob diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 85435143c15..ab8b3bff533 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -231,7 +231,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons QDEL_NULL(hidden_uplink) if(ismob(loc)) var/mob/m = loc - m.unEquip(src, 1) + m.unequip(src, force = TRUE) QDEL_LIST_CONTENTS(actions) master = null @@ -342,27 +342,22 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(affecting && affecting.receive_damage(0, 5)) // 5 burn damage H.UpdateDamageIcon() - if(isstorage(src.loc)) - /// If the item is in a storage item, take it out - var/obj/item/storage/S = src.loc - S.remove_from_storage(src) - if(..()) return if(throwing) throwing.finalize(FALSE) - if(loc == user) - if(HAS_TRAIT(user, TRAIT_I_WANT_BRAINS) || !user.unEquip(src, silent = TRUE)) + + if(isliving(loc)) + if(loc == user) + if(HAS_TRAIT(user, TRAIT_I_WANT_BRAINS) || !user.unequip(src)) + return FALSE + else return FALSE if(flags & ABSTRACT) return FALSE - else - if(isliving(loc)) - return FALSE - pickup(user) add_fingerprint(user) if(!user.put_in_active_hand(src)) @@ -376,7 +371,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons if(!A.has_fine_manipulation && !HAS_TRAIT(src, TRAIT_XENO_INTERACTABLE)) if(src in A.contents) // To stop Aliens having items stuck in their pockets - A.unEquip(src) + A.drop_item_to_ground(src) to_chat(user, "Your claws aren't capable of such fine manipulation!") return attack_hand(A) diff --git a/code/game/objects/items/ashtray.dm b/code/game/objects/items/ashtray.dm index 951f3f1098a..1f6cb261a9d 100644 --- a/code/game/objects/items/ashtray.dm +++ b/code/game/objects/items/ashtray.dm @@ -10,7 +10,7 @@ if(length(contents) >= max_butts) to_chat(user, "This ashtray is full.") return - if(!user.unEquip(I)) + if(!user.unequip(I)) return I.forceMove(src) diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 6885160acf5..042c0033134 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -100,7 +100,7 @@ new/obj/item/trash/candle(src.loc) if(ismob(src.loc)) var/mob/M = src.loc - M.unEquip(src, 1) //src is being deleted anyway + M.drop_item_to_ground(src, force = TRUE) //src is being deleted anyway qdel(src) if(isturf(loc)) //start a fire if possible var/turf/T = loc diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 7c5ecf95a9c..e95e8c94567 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -411,7 +411,7 @@ ) selected_disguise = disguise_spraypaint_items[selected_disguise][is_cardborg_head] playsound(user, 'sound/effects/spray.ogg', 5, TRUE, 5) - user.unEquip(target) + user.unequip(target) user.put_in_hands(new selected_disguise()) // Spawn the desired cardborg item. qdel(target) // Get rid of the old one. diff --git a/code/game/objects/items/devices/lightreplacer.dm b/code/game/objects/items/devices/lightreplacer.dm index 29ec73f15e1..924d261f040 100644 --- a/code/game/objects/items/devices/lightreplacer.dm +++ b/code/game/objects/items/devices/lightreplacer.dm @@ -77,7 +77,7 @@ return if(istype(I, /obj/item/shard)) - if(!user.unEquip(I)) + if(!user.drop_item_to_ground(I)) to_chat(user, "[I] is stuck to your hand!") return @@ -88,7 +88,7 @@ if(istype(I, /obj/item/light)) var/obj/item/light/L = I - if(!user.unEquip(L)) + if(!user.drop_item_to_ground(L)) to_chat(user, "[L] is stuck to your hand!") return diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm index 0594ba7774c..d8ba0c62e12 100644 --- a/code/game/objects/items/devices/radio/electropack.dm +++ b/code/game/objects/items/devices/radio/electropack.dm @@ -48,16 +48,15 @@ var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit(user) A.icon = 'icons/obj/assemblies.dmi' - if(!user.unEquip(W)) + if(!user.unequip(W)) to_chat(user, "\the [W] is stuck to your hand, you cannot attach it to \the [src]!") return - W.loc = A + W.forceMove(A) W.master = A A.part1 = W - user.unEquip(src) - loc = A + user.transfer_item_to(src, A) master = A A.part2 = src diff --git a/code/game/objects/items/devices/radio/headset.dm b/code/game/objects/items/devices/radio/headset.dm index 10770f41207..c676e60a76d 100644 --- a/code/game/objects/items/devices/radio/headset.dm +++ b/code/game/objects/items/devices/radio/headset.dm @@ -409,7 +409,7 @@ to_chat(user, "The headset can't hold another key!") return - if(!user.unEquip(key)) + if(!user.drop_item_to_ground(key)) to_chat(user, "[key] is stuck to your hand, you can't insert it in [src].") return diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 077f349263f..c1ff7e1a0b6 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -332,7 +332,7 @@ SLIME SCANNER to_chat(user, "An upgrade is already installed on [src].") return - if(!user.unEquip(I)) + if(!user.unequip(I)) to_chat(user, "[src] is stuck to your hand!") return diff --git a/code/game/objects/items/devices/transfer_valve.dm b/code/game/objects/items/devices/transfer_valve.dm index 58b20eb669f..f7212311663 100644 --- a/code/game/objects/items/devices/transfer_valve.dm +++ b/code/game/objects/items/devices/transfer_valve.dm @@ -32,18 +32,16 @@ return if(!tank_one) - if(!user.unEquip(I)) + if(!user.transfer_item_to(I, src)) return tank_one = I - I.forceMove(src) to_chat(user, "You attach the tank to the transfer valve.") if(I.w_class > w_class) w_class = I.w_class else if(!tank_two) - if(!user.unEquip(I)) + if(!user.transfer_item_to(I, src)) return tank_two = I - I.forceMove(src) to_chat(user, "You attach the tank to the transfer valve.") if(I.w_class > w_class) w_class = I.w_class @@ -59,9 +57,9 @@ if(attached_device) to_chat(user, "There is already a device attached to the valve, remove it first.") return - user.remove_from_mob(A) + if(!user.transfer_item_to(A, src)) + return attached_device = A - A.forceMove(src) to_chat(user, "You attach [A] to the valve controls and secure it.") A.holder = src A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb). diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 49353ed07ec..93343db6452 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -151,7 +151,7 @@ to_chat(user, "You armed the robot frame") M.use(1) if(user.get_inactive_hand()==src) - user.unEquip(src) + user.unequip(src) user.put_in_inactive_hand(B) qdel(src) if(istype(W, /obj/item/robot_parts/l_leg)) diff --git a/code/game/objects/items/sport.dm b/code/game/objects/items/sport.dm index 7f40b5b2cc2..3e9e08b3f76 100644 --- a/code/game/objects/items/sport.dm +++ b/code/game/objects/items/sport.dm @@ -20,7 +20,7 @@ return if(!user.get_inactive_hand()) // We ballin - user.unEquip(src) + user.unequip(src) user.put_in_inactive_hand(src) else to_chat(user, "You can't dribble to an occupied hand!") diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 5a23bae121c..11b9dfc1af2 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -87,7 +87,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( var/replace = user.is_in_inactive_hand(src) use(2) if(get_amount() <= 0 && replace) - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) if(new_item) user.put_in_hands(new_item) diff --git a/code/game/objects/items/tools/crowbar.dm b/code/game/objects/items/tools/crowbar.dm index fb2e40b858c..f0326342552 100644 --- a/code/game/objects/items/tools/crowbar.dm +++ b/code/game/objects/items/tools/crowbar.dm @@ -91,7 +91,7 @@ animate_fading_leap_up(user) for(var/obj/item/W in user) - user.unEquip(W) + user.drop_item_to_ground(W) user.dust() return OBLITERATION diff --git a/code/game/objects/items/tools/multitool.dm b/code/game/objects/items/tools/multitool.dm index 6e824e6ccf7..5f7187c9a0c 100644 --- a/code/game/objects/items/tools/multitool.dm +++ b/code/game/objects/items/tools/multitool.dm @@ -153,7 +153,7 @@ playsound(loc, 'sound/effects/supermatter.ogg', 50, TRUE, -1) for(var/obj/item/W in user) - user.unEquip(W) + user.drop_item_to_ground(W) user.dust() return OBLITERATION diff --git a/code/game/objects/items/tools/wirecutters.dm b/code/game/objects/items/tools/wirecutters.dm index d4e627d03d8..3d6b38d653e 100644 --- a/code/game/objects/items/tools/wirecutters.dm +++ b/code/game/objects/items/tools/wirecutters.dm @@ -85,7 +85,7 @@ new /obj/item/restraints/handcuffs/cable/zipties/used(user.loc) for(var/obj/item/W in user) - user.unEquip(W) + user.drop_item_to_ground(W) user.dust() return OBLITERATION diff --git a/code/game/objects/items/tools/wrench.dm b/code/game/objects/items/tools/wrench.dm index 720d985e6d2..040c0e1d3b1 100644 --- a/code/game/objects/items/tools/wrench.dm +++ b/code/game/objects/items/tools/wrench.dm @@ -118,7 +118,7 @@ return for(var/obj/item/W in user) - user.unEquip(W) + user.drop_item_to_ground(W) for(var/mob/living/M in orange(2, src)) // you're close enough, it's pretty fuckin bright diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 8190b14d1a4..f11720d3f8b 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -146,7 +146,7 @@ animate(holder_obj, pixel_z = 1000, time = 50) for(var/obj/item/W in user) - user.unEquip(W) + user.drop_item_to_ground(W) user.notransform = TRUE icon = null @@ -226,8 +226,6 @@ else to_chat(user, "You attach the ends of the two plastic swords, making a single double-bladed toy! You're fake-cool.") new /obj/item/dualsaber/toy(user.loc) - user.unEquip(attacking) - user.unEquip(src) qdel(attacking) qdel(src) @@ -287,7 +285,7 @@ "You hear a gentle tapping." ) playsound(loc, 'sound/weapons/tap.ogg', vary = TRUE) - target.unEquip(cig, TRUE) + target.drop_item_to_ground(cig, TRUE) return TRUE /obj/item/toy/sword/chaosprank/after_attack(atom/target, mob/user, proximity_flag, click_parameters) @@ -1457,8 +1455,7 @@ to_chat(user, "\The [attacking] is too far away to feed into \the [src]!") else to_chat(user, "You feed \the [attacking] [bicon(attacking)] into \the [src]!") - user.unEquip(attacking) - attacking.forceMove(src) + user.transfer_item_to(attacking, src) stored_minature = attacking else to_chat(user, "You stop feeding \the [attacking] into \the [src]'s mini-input.") diff --git a/code/game/objects/items/weapons/RCD.dm b/code/game/objects/items/weapons/RCD.dm index 07fa4649fd5..7ba89187f25 100644 --- a/code/game/objects/items/weapons/RCD.dm +++ b/code/game/objects/items/weapons/RCD.dm @@ -351,7 +351,7 @@ return SHAME user.visible_message("[user] deconstructs [user.p_themselves()] with [src]!") for(var/obj/item/W in user) // Do not delete all their stuff. - user.unEquip(W) // Dump everything on the floor instead. + user.drop_item_to_ground(W) // Dump everything on the floor instead. flags &= ~NODROP // NODROP must be removed so the RCD doesn't get dusted along with them. Having this come after the unequipping puts the RCD on top of the pile of stuff. user.dust() // (held items fall to the floor when dusting). return OBLITERATION diff --git a/code/game/objects/items/weapons/bio_chips/bio_chip_pad.dm b/code/game/objects/items/weapons/bio_chips/bio_chip_pad.dm index 6aca8065875..198d2168f00 100644 --- a/code/game/objects/items/weapons/bio_chips/bio_chip_pad.dm +++ b/code/game/objects/items/weapons/bio_chips/bio_chip_pad.dm @@ -41,7 +41,7 @@ if(case) to_chat(user, "There's already a bio-chip in the pad!") return - user.unEquip(C) + user.unequip(C) C.forceMove(src) case = C update_icon(UPDATE_ICON_STATE) diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index f869ea3c066..0ceb7d17a35 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -210,9 +210,8 @@ if(G.registered_name != registered_name && G.registered_name != "NOT SPECIFIED") to_chat(user, "The guest pass cannot be attached to this ID.") return - if(!user.unEquip(G)) + if(!user.transfer_item_to(G, src)) return - G.loc = src guest_pass = G /obj/item/card/id/GetID() diff --git a/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm b/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm index a5205aae1e4..9e57dc47933 100644 --- a/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm +++ b/code/game/objects/items/weapons/chemical_flamethrower/chemical_flamethrower.dm @@ -80,13 +80,10 @@ to_chat(user, "[src] is already full!") return - if(!user.unEquip(I)) - return - - to_chat(user, "You put [I] into [src].") - canisters += I - I.forceMove(src) - update_canister_stats() + if(user.transfer_item_to(I, src)) + canisters += I + to_chat(user, "You put [I] into [src].") + update_canister_stats() /obj/item/chemical_flamethrower/proc/update_canister_stats() if(!length(canisters)) diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index b927b404cdf..d2fc883566f 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -98,7 +98,7 @@ LIGHTERS ARE IN LIGHTERS.DM // If the target has no cig, try to give them the cig. var/mob/living/carbon/M = target if(istype(M) && user.zone_selected == "mouth" && !M.wear_mask && user.a_intent == INTENT_HELP) - user.unEquip(src, TRUE) + user.drop_item_to_ground(src, force = TRUE) M.equip_to_slot_if_possible(src, ITEM_SLOT_MASK) if(target != user) user.visible_message( @@ -207,7 +207,7 @@ LIGHTERS ARE IN LIGHTERS.DM e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0) e.start() if(ismob(M)) - M.unEquip(src, TRUE) + M.drop_item_to_ground(src, force = TRUE) qdel(src) return @@ -217,7 +217,7 @@ LIGHTERS ARE IN LIGHTERS.DM e.set_up(round(reagents.get_reagent_amount("fuel") / 5, 1), get_turf(src), 0, 0) e.start() if(ismob(M)) - M.unEquip(src, TRUE) + M.drop_item_to_ground(src, force = TRUE) qdel(src) return @@ -289,7 +289,7 @@ LIGHTERS ARE IN LIGHTERS.DM if(ismob(loc)) var/mob/living/M = loc to_chat(M, "Your [name] goes out.") - M.unEquip(src, TRUE) //Force the un-equip so the overlays update + M.drop_item_to_ground(src, force = TRUE) //Force the un-equip so the overlays update STOP_PROCESSING(SSobj, src) qdel(src) @@ -390,8 +390,8 @@ LIGHTERS ARE IN LIGHTERS.DM to_chat(user, "You need to dry this first!") return - user.unEquip(plant, TRUE) - user.unEquip(src, TRUE) + user.unequip(plant, TRUE) + user.unequip(src, TRUE) var/obj/item/clothing/mask/cigarette/rollie/custom/custom_rollie = new (get_turf(user)) custom_rollie.reagents.maximum_volume = plant.reagents.total_volume plant.reagents.trans_to(custom_rollie, plant.reagents.total_volume) diff --git a/code/game/objects/items/weapons/defib.dm b/code/game/objects/items/weapons/defib.dm index de6be9efb31..50424daac34 100644 --- a/code/game/objects/items/weapons/defib.dm +++ b/code/game/objects/items/weapons/defib.dm @@ -174,7 +174,7 @@ /obj/item/defibrillator/proc/remove_paddles(mob/user) // from your hands var/mob/living/carbon/human/M = user if(paddles in get_both_hands(M)) - M.unEquip(paddles) + M.drop_item_to_ground(paddles) paddles_on_defib = TRUE update_icon(UPDATE_OVERLAYS) return @@ -387,7 +387,7 @@ /obj/item/shockpaddles/proc/check_defib_exists(mainunit, mob/living/carbon/human/M, obj/O) if(!mainunit || !istype(mainunit, /obj/item/defibrillator)) //To avoid weird issues from admin spawns - M?.unEquip(O) + M?.unequip(O) qdel(O) return FALSE else diff --git a/code/game/objects/items/weapons/dice.dm b/code/game/objects/items/weapons/dice.dm index 14ca7c6fb50..536bb735ccd 100644 --- a/code/game/objects/items/weapons/dice.dm +++ b/code/game/objects/items/weapons/dice.dm @@ -165,7 +165,7 @@ /obj/item/dice/d20/fate/equipped(mob/user, slot) if(!ishuman(user) || !user.mind || iswizard(user)) to_chat(user, "You feel the magic of the dice is restricted to ordinary humans! You should leave it alone.") - user.unEquip(src) + user.drop_item_to_ground(src) /obj/item/dice/d20/fate/proc/create_smoke(amount) var/datum/effect_system/smoke_spread/smoke = new diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index e2539d68fd9..f71ede24473 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -35,11 +35,10 @@ /obj/item/grenade/plastic/attackby__legacy__attackchain(obj/item/I, mob/user, params) if(!nadeassembly && istype(I, /obj/item/assembly)) var/obj/item/assembly/A = I - if(!user.unEquip(I)) + if(!user.transfer_item_to(A, src)) return ..() nadeassembly = A A.master = src - A.loc = src assemblyattacher = user.ckey to_chat(user, "You add [A] to [src].") playsound(src, 'sound/weapons/tap.ogg', 20, 1) @@ -86,8 +85,9 @@ to_chat(user, "You start planting [src].[isnull(nadeassembly) ? " The timer is set to [det_time]..." : ""]") if(do_after(user, 1.5 SECONDS * toolspeed, target = AM)) - if(!user.unEquip(src)) + if(!user.unequip(src)) return + target = AM loc = null diff --git a/code/game/objects/items/weapons/gift_wrappaper.dm b/code/game/objects/items/weapons/gift_wrappaper.dm index 124e434ae88..39f65ff0512 100644 --- a/code/game/objects/items/weapons/gift_wrappaper.dm +++ b/code/game/objects/items/weapons/gift_wrappaper.dm @@ -119,7 +119,7 @@ if(!ispath(gift_type,/obj/item)) return var/obj/item/I = new gift_type(M) - M.unEquip(src, 1) + M.unequip(src, force = TRUE) M.put_in_hands(I) I.add_fingerprint(M) qdel(src) diff --git a/code/game/objects/items/weapons/grenades/bananade.dm b/code/game/objects/items/weapons/grenades/bananade.dm index 4d404ac862c..a7f7a9628f6 100644 --- a/code/game/objects/items/weapons/grenades/bananade.dm +++ b/code/game/objects/items/weapons/grenades/bananade.dm @@ -61,7 +61,7 @@ return TRUE var/obj/item/grenade/bananade/G = new /obj/item/grenade/bananade - user.unEquip(src) + user.drop_item_to_ground(src) user.put_in_hands(G) G.deliveryamt = deliveryamt to_chat(user, "You lock the assembly shut, readying it for HONK.") diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm index 29dad811abd..27f0f27aec2 100644 --- a/code/game/objects/items/weapons/grenades/grenade.dm +++ b/code/game/objects/items/weapons/grenades/grenade.dm @@ -83,7 +83,7 @@ /obj/item/grenade/proc/update_mob() if(ismob(loc)) var/mob/M = loc - M.unEquip(src) + M.drop_item_to_ground(src) /obj/item/grenade/screwdriver_act(mob/living/user, obj/item/I) if(!modifiable_timer) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 6f53ae83709..392e6af517a 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -26,11 +26,13 @@ /obj/item/restraints/proc/finish_resist_restraints(mob/living/carbon/user, break_cuffs, silent) if(!silent) user.visible_message("[user] manages to [break_cuffs ? "break" : "remove"] [src]!", "You successfully [break_cuffs ? "break" : "remove"] [src].") - user.unEquip(src) + user.unequip(src) if(break_cuffs) qdel(src) return TRUE + else + forceMove(user.drop_location()) ////////////////////////////// // MARK: HANDCUFFS @@ -273,7 +275,7 @@ if(!R.use(1)) to_chat(user, "[R.amount > 1 ? "These rods" : "This rod"] somehow can't be used for crafting!") return - if(!user.unEquip(src)) + if(!user.unequip(src)) return var/obj/item/wirerod/W = new /obj/item/wirerod(get_turf(src)) if(!remove_item_from_storage(user)) @@ -290,7 +292,7 @@ to_chat(user, "You begin to apply [I] to [src]...") if(do_after(user, 3.5 SECONDS * M.toolspeed, target = src)) - if(!M.use(6) || !user.unEquip(src)) + if(!M.use(6) || !user.unequip(src)) return var/obj/item/restraints/legcuffs/bola/S = new /obj/item/restraints/legcuffs/bola(get_turf(src)) to_chat(user, "You make some weights out of [I] and tie them to [src].") diff --git a/code/game/objects/items/weapons/holy_weapons.dm b/code/game/objects/items/weapons/holy_weapons.dm index 0b567a426af..6f98c58a958 100644 --- a/code/game/objects/items/weapons/holy_weapons.dm +++ b/code/game/objects/items/weapons/holy_weapons.dm @@ -53,7 +53,7 @@ user.adjustBruteLoss(force) user.adjustFireLoss(sanctify_force) user.Weaken(10 SECONDS) - user.unEquip(src, 1) + user.drop_item_to_ground(src, force = TRUE) user.visible_message("[src] slips out of the grip of [user] as they try to pick it up, bouncing upwards and smacking [user.p_them()] in the face!", \ "[src] slips out of your grip as you pick it up, bouncing upwards and smacking you in the face!") playsound(get_turf(user), 'sound/effects/hit_punch.ogg', 50, TRUE, -1) diff --git a/code/game/objects/items/weapons/melee/energy_melee_weapons.dm b/code/game/objects/items/weapons/melee/energy_melee_weapons.dm index de97b9b90c5..bd25fced3f0 100644 --- a/code/game/objects/items/weapons/melee/energy_melee_weapons.dm +++ b/code/game/objects/items/weapons/melee/energy_melee_weapons.dm @@ -279,8 +279,6 @@ if(src.hacked) // That's right, we'll only check the "original" esword. newSaber.hacked = TRUE newSaber.item_color = "rainbow" - user.unEquip(W) - user.unEquip(src) qdel(W) qdel(src) user.put_in_hands(newSaber) diff --git a/code/game/objects/items/weapons/misc_items.dm b/code/game/objects/items/weapons/misc_items.dm index 90905dcdbb8..5097771d549 100644 --- a/code/game/objects/items/weapons/misc_items.dm +++ b/code/game/objects/items/weapons/misc_items.dm @@ -81,7 +81,7 @@ return if(I.flags & ABSTRACT) return - if(!user.unEquip(I)) + if(!user.unequip(I)) to_chat(user, "[I] doesn't seem to want to go into [src]!") return I.forceMove(src) diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm index b82481a841b..f7fb3351623 100644 --- a/code/game/objects/items/weapons/pneumaticCannon.dm +++ b/code/game/objects/items/weapons/pneumaticCannon.dm @@ -56,7 +56,7 @@ if(I.w_class > w_class) to_chat(user, "[I] is too large to fit into [src]!") return FALSE - if(!user.unEquip(I) || I.flags & (ABSTRACT | NODROP | DROPDEL)) + if(!user.unequip(I) || I.flags & (ABSTRACT | NODROP | DROPDEL)) to_chat(user, "You can't put [I] into [src]!") return FALSE loaded_items.Add(I) @@ -144,7 +144,7 @@ if(tank) to_chat(user, "[src] already has a tank.") return - if(!user.unEquip(new_tank)) + if(!user.unequip(new_tank)) return to_chat(user, "You hook [new_tank] up to [src].") new_tank.forceMove(src) diff --git a/code/game/objects/items/weapons/powerfist.dm b/code/game/objects/items/weapons/powerfist.dm index f7cec8da4f0..14367dd26ef 100644 --- a/code/game/objects/items/weapons/powerfist.dm +++ b/code/game/objects/items/weapons/powerfist.dm @@ -79,7 +79,7 @@ if(tank) to_chat(user, "[src] already has a tank.") return - if(!user.unEquip(thetank)) + if(!user.unequip(thetank)) return to_chat(user, "As you hook [thetank] up to [src], the fist locks into place around your arm.") tank = thetank diff --git a/code/game/objects/items/weapons/staff.dm b/code/game/objects/items/weapons/staff.dm index 4f1f9ed2276..150324f7403 100644 --- a/code/game/objects/items/weapons/staff.dm +++ b/code/game/objects/items/weapons/staff.dm @@ -52,7 +52,7 @@ /obj/item/staff/broom/attackby__legacy__attackchain(obj/O, mob/user) if(istype(O, /obj/item/clothing/mask/horsehead)) new/obj/item/staff/broom/horsebroom(get_turf(src)) - user.unEquip(O) + user.unequip(O) qdel(O) qdel(src) return diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 90fcf07f58b..427e2587f60 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -70,11 +70,17 @@ if(!M.restrained() && !M.stat && can_use()) switch(over_object.name) if("r_hand") - if(M.unEquip(src, silent = TRUE)) - M.put_in_r_hand(src) + if(M.unequip(src)) + if(M.r_hand) + M.drop_item_to_ground(src) + else + M.put_in_r_hand(src) if("l_hand") - if(M.unEquip(src, silent = TRUE)) - M.put_in_l_hand(src) + if(M.unequip(src)) + if(M.l_hand) + M.drop_item_to_ground(src) + else + M.put_in_l_hand(src) add_fingerprint(usr) return diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm index 8641af62486..5f07e5f0f6a 100644 --- a/code/game/objects/items/weapons/storage/internal.dm +++ b/code/game/objects/items/weapons/storage/internal.dm @@ -49,10 +49,10 @@ if(!user.restrained() && !user.stat) switch(over_object.name) if("r_hand") - user.unEquip(master_item, silent = TRUE) + user.unequip(master_item) user.put_in_r_hand(master_item) if("l_hand") - user.unEquip(master_item, silent = TRUE) + user.unequip(master_item) user.put_in_l_hand(master_item) master_item.add_fingerprint(user) return 0 diff --git a/code/game/objects/items/weapons/storage/storage_base.dm b/code/game/objects/items/weapons/storage/storage_base.dm index d61c950c5b0..d016b95fbcf 100644 --- a/code/game/objects/items/weapons/storage/storage_base.dm +++ b/code/game/objects/items/weapons/storage/storage_base.dm @@ -150,11 +150,11 @@ if(!M.restrained() && !M.stat) switch(over_object.name) if("r_hand") - if(!M.unEquip(src, silent = TRUE)) + if(!M.unequip(src)) return M.put_in_r_hand(src) if("l_hand") - if(!M.unEquip(src, silent = TRUE)) + if(!M.unequip(src)) return M.put_in_l_hand(src) add_fingerprint(usr) @@ -445,7 +445,7 @@ if(user) if(!Adjacent(user) && !isnewplayer(user)) return FALSE - if(!user.unEquip(I, silent = TRUE)) + if(!user.unequip(I)) return FALSE user.update_icons() //update our overlays if(QDELING(I)) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 51865065732..33733f7e25d 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -130,7 +130,7 @@ if(C.maxcharge < hitcost) to_chat(user, "[src] requires a higher capacity cell!") return - if(!user.unEquip(I)) + if(!user.unequip(I)) return I.forceMove(src) cell = I diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index 5edd367f1ef..e6169752f75 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -70,8 +70,7 @@ return master = F F.ptank = src - user.unEquip(src) - loc = F + user.transfer_item_to(src, F) F.update_icon() else return ..() diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm index 13494689a6f..ac334cfbacc 100644 --- a/code/game/objects/items/weapons/tanks/watertank.dm +++ b/code/game/objects/items/weapons/tanks/watertank.dm @@ -68,7 +68,7 @@ /obj/item/watertank/proc/remove_noz() if(ismob(noz.loc)) var/mob/M = noz.loc - M.unEquip(noz, 1) + M.drop_item_to_ground(noz, force = TRUE) return /obj/item/watertank/attack_hand(mob/user) @@ -84,13 +84,13 @@ if("r_hand") if(H.r_hand) return - if(!H.unEquip(src)) + if(!H.unequip(src)) return H.put_in_r_hand(src) if("l_hand") if(H.l_hand) return - if(!H.unEquip(src)) + if(!H.unequip(src)) return H.put_in_l_hand(src) return diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 80136bc5cb5..fb7355532c0 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -146,7 +146,7 @@ if(HAS_TRAIT(user, TRAIT_HULK)) to_chat(user, "You grip the blade too hard and accidentally drop it!") if(HAS_TRAIT(src, TRAIT_WIELDED)) - user.unEquip(src) + user.drop_item_to_ground(src) return ..() if(HAS_TRAIT(user, TRAIT_CLUMSY) && HAS_TRAIT(src, TRAIT_WIELDED) && prob(40) && force) @@ -385,7 +385,7 @@ //Putting heads on spears /obj/item/spear/attackby__legacy__attackchain(obj/item/I, mob/living/user) if(istype(I, /obj/item/organ/external/head)) - if(user.unEquip(src) && user.drop_item()) + if(user.unequip(src) && user.drop_item()) to_chat(user, "You stick [I] onto the spear and stand it upright on the ground.") var/obj/structure/headspear/HS = new /obj/structure/headspear(get_turf(src)) var/matrix/M = matrix() diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index 2deabb75050..ed176b3bd2a 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -142,8 +142,8 @@ S.add_plasmaglass() S.update_icon() if(!remove_item_from_storage(user)) - user.unEquip(src) - user.unEquip(I) + user.unequip(src) + user.unequip(I) user.put_in_hands(S) to_chat(user, "You fasten the glass shard to the top of the rod with the cable.") @@ -154,8 +154,8 @@ var/obj/item/melee/baton/cattleprod/P = new /obj/item/melee/baton/cattleprod if(!remove_item_from_storage(user)) - user.unEquip(src) - user.unEquip(I) + user.unequip(src) + user.unequip(I) user.put_in_hands(P) to_chat(user, "You fasten [I] to the top of the rod with the cable.") diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index 25843fd4cbc..86ec5986d27 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -33,7 +33,7 @@ if(do_after(user, 1 SECONDS, target = user) && !QDELETED(src)) to_chat(user, "You begin to open the envelope.") playsound(loc, 'sound/items/poster_ripped.ogg', 50, TRUE) - user.unEquip(src) + user.unequip(src) for(var/obj/item/I in contents) user.put_in_hands(I) qdel(src) diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm index bec34e3f23b..2b45b4a04ef 100644 --- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm +++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm @@ -66,7 +66,7 @@ if(HAS_TRAIT(F, TRAIT_WIELDED)) to_chat(user, "Unwield \the [F] first.") return - if(!user.unEquip(F, FALSE)) + if(!user.unequip(F, FALSE)) to_chat(user, "\The [F] stays stuck to your hands!") return fireaxe = F diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index e9e02ff2e8b..c206bd8195b 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -35,7 +35,7 @@ return ..() /obj/structure/janitorialcart/proc/put_in_cart(mob/user, obj/item/I) - if(!user.unEquip(I)) // We can do this here because everything below wants to + if(!user.unequip(I)) // We can do this here because everything below wants to to_chat(user, "[I] is stuck to your hand!") return diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm index d727e706238..85df7aa4dd6 100644 --- a/code/game/objects/structures/mop_bucket.dm +++ b/code/game/objects/structures/mop_bucket.dm @@ -34,7 +34,7 @@ attacking_mop.wet_mop(src, user) return - if(!user.unEquip(attacking_mop)) + if(!user.drop_item_to_ground(attacking_mop)) to_chat(user, "[attacking_mop] is stuck to your hand!") return diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 1a774e17791..28183daff66 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -91,7 +91,7 @@ if(istype(H.shoes, /obj/item/clothing/shoes/slippers)) sleep_ratio *= 2 // take your shoes off first, you filthy animal - H.unEquip(H.shoes) + H.drop_item_to_ground(H.shoes) var/extinguished_candle = FALSE for(var/obj/item/candle/C in range(2, src)) diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index b84616c0d91..ccffafa7570 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -587,7 +587,7 @@ /obj/item/chair/stool/attack__legacy__attackchain(mob/M as mob, mob/user as mob) if(prob(5) && isliving(M)) user.visible_message("[user] breaks [src] over [M]'s back!.") - user.unEquip(src) + user.unequip(src) var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal m.loc = get_turf(src) qdel(src) diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 308d5e6b688..24e67bd26a1 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -733,7 +733,7 @@ S.anchored = FALSE S.dir = user.dir S.update_icon() - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) if(prob(50)) new /obj/item/stack/sheet/cardboard(T) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 9c8f042264c..602e710d128 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1160,7 +1160,7 @@ //strip their stuff and stick it in the crate for(var/obj/item/I in M) - if(M.unEquip(I)) + if(M.drop_item_to_ground(I)) I.loc = locker I.layer = initial(I.layer) I.plane = initial(I.plane) @@ -1302,7 +1302,7 @@ return for(var/obj/item/I in M) - M.unEquip(I) + M.drop_item_to_ground(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -1334,7 +1334,7 @@ return for(var/obj/item/I in M) - M.unEquip(I) + M.drop_item_to_ground(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -1390,7 +1390,7 @@ return for(var/obj/item/I in M) - M.unEquip(I) + M.drop_item_to_ground(I) if(I) I.loc = M.loc I.layer = initial(I.layer) @@ -2212,7 +2212,7 @@ logmsg = "floor cluwne" if("Shamebrero") if(H.head) - H.unEquip(H.head, TRUE) + H.drop_item_to_ground(H.head, force = TRUE) var/obj/item/clothing/head/sombrero/shamebrero/S = new(H.loc) H.equip_to_slot_or_del(S, ITEM_SLOT_HEAD) logmsg = "shamebrero" @@ -2963,7 +2963,7 @@ if(!security) //strip their stuff before they teleport into a cell :downs: for(var/obj/item/W in H) - H.unEquip(W) + H.drop_item_to_ground(W) if(H.client) H.client.screen -= W if(W) diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index ce39aea36f8..041e39422de 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -82,7 +82,7 @@ var/obj/item/slot_item_ID = H.get_item_by_slot(ITEM_SLOT_ID) qdel(slot_item_ID) var/obj/item/slot_item_hand = H.get_item_by_slot(ITEM_SLOT_RIGHT_HAND) - H.unEquip(slot_item_hand) + H.drop_item_to_ground(slot_item_hand) var/obj/item/multisword/pure_evil/multi = new(H) H.equip_to_slot_or_del(multi, ITEM_SLOT_RIGHT_HAND) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index dd917e6744e..ac2d156b834 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -9,7 +9,7 @@ return for(var/obj/item/W in M) - M.unEquip(W) + M.drop_item_to_ground(W) log_admin("[key_name(usr)] made [key_name(M)] drop everything!") message_admins("[key_name_admin(usr)] made [key_name_admin(M)] drop everything!", 1) @@ -28,7 +28,7 @@ return //strip their stuff before they teleport into a cell :downs: for(var/obj/item/W in M) - M.unEquip(W) + M.drop_item_to_ground(W) //teleport person to cell if(isliving(M)) var/mob/living/L = M diff --git a/code/modules/antagonists/changeling/powers/biodegrade.dm b/code/modules/antagonists/changeling/powers/biodegrade.dm index 2982058152b..63975f29e9e 100644 --- a/code/modules/antagonists/changeling/powers/biodegrade.dm +++ b/code/modules/antagonists/changeling/powers/biodegrade.dm @@ -84,9 +84,7 @@ /datum/action/changeling/biodegrade/proc/dissolve_restraint(mob/living/carbon/human/user, obj/O) if(O && (user.handcuffed == O || user.legcuffed == O || user.wear_suit == O)) - user.unEquip(O) O.visible_message("[O] dissolves into a puddle of sizzling goop.") - O.forceMove(get_turf(user)) qdel(O) /datum/action/changeling/biodegrade/proc/open_closet(mob/living/carbon/human/user, obj/structure/closet/C) diff --git a/code/modules/antagonists/changeling/powers/mutations.dm b/code/modules/antagonists/changeling/powers/mutations.dm index 2262004cd0c..c6fd006e472 100644 --- a/code/modules/antagonists/changeling/powers/mutations.dm +++ b/code/modules/antagonists/changeling/powers/mutations.dm @@ -27,7 +27,7 @@ /datum/action/changeling/weapon/sting_action(mob/user) SEND_SIGNAL(user, COMSIG_MOB_WEAPON_APPEARS) - if(!user.drop_item()) + if(user.get_active_hand() && !user.drop_item()) to_chat(user, "[user.get_active_hand()] is stuck to your hand, you cannot grow a [weapon_name_simple] over it!") return FALSE var/obj/item/W = new weapon_type(user, silent, src) @@ -97,15 +97,14 @@ ..(H, target) /datum/action/changeling/suit/sting_action(mob/living/carbon/human/user) - if(!user.unEquip(user.wear_suit)) - to_chat(user, "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!") - return FALSE - if(!user.unEquip(user.head)) - to_chat(user, "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!") - return FALSE - - user.unEquip(user.head) - user.unEquip(user.wear_suit) + if(user.wear_suit) + if(!user.drop_item_to_ground(user.wear_suit)) + to_chat(user, "\the [user.wear_suit] is stuck to your body, you cannot grow a [suit_name_simple] over it!") + return FALSE + if(user.head) + if(!user.drop_item_to_ground(user.head)) + to_chat(user, "\the [user.head] is stuck on your head, you cannot grow a [helmet_name_simple] over it!") + return FALSE user.equip_to_slot_if_possible(new suit_type(user), ITEM_SLOT_OUTER_SUIT, TRUE, TRUE) user.equip_to_slot_if_possible(new helmet_type(user), ITEM_SLOT_HEAD, TRUE, TRUE) @@ -438,7 +437,7 @@ var/mob/living/carbon/human/H = loc H.visible_message("With a sickening crunch, [H] reforms [H.p_their()] shield into an arm!", "We assimilate our shield into our body", "You hear organic matter ripping and tearing!") playsound(loc, 'sound/effects/bone_break_2.ogg', 100, TRUE) - H.unEquip(src, 1) + H.unequip(src, force = TRUE) qdel(src) return FALSE else @@ -576,9 +575,9 @@ // you've torn it up, get rid of it. new /obj/effect/decal/cleanable/shreds(owner.loc) // just unequip them since they qdel on drop - owner.unEquip(src, TRUE, TRUE) + owner.drop_item_to_ground(src, force = TRUE, silent = TRUE) if(istype(owner.head, /obj/item/clothing/head/helmet/changeling)) - owner.unEquip(owner.head, TRUE, TRUE) + owner.drop_item_to_ground(owner.head, force = TRUE, silent = TRUE) return TRUE diff --git a/code/modules/antagonists/cult/datum_cultist.dm b/code/modules/antagonists/cult/datum_cultist.dm index 457abc6fea7..dcfe7dd2022 100644 --- a/code/modules/antagonists/cult/datum_cultist.dm +++ b/code/modules/antagonists/cult/datum_cultist.dm @@ -50,7 +50,7 @@ RESTRICT_TYPE(/datum/antagonist/cultist) if(remove_gear_on_removal) for(var/I in H.contents) if(is_type_in_list(I, CULT_CLOTHING)) - H.unEquip(I) + H.drop_item_to_ground(I) return ..() diff --git a/code/modules/antagonists/mind_flayer/powers/flayer_weapon_powers.dm b/code/modules/antagonists/mind_flayer/powers/flayer_weapon_powers.dm index a38584f0e7c..f7b32b24dba 100644 --- a/code/modules/antagonists/mind_flayer/powers/flayer_weapon_powers.dm +++ b/code/modules/antagonists/mind_flayer/powers/flayer_weapon_powers.dm @@ -38,7 +38,7 @@ create_new_weapon() weapon_ref.flags |= (ABSTRACT | NODROP) // Just in case the item doesn't start with both of these, or somehow loses them. - if(!user.drop_item() || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) + if(HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || (user.get_active_hand() && !user.drop_item())) flayer.send_swarm_message("We cannot manifest [weapon_ref] into our active hand...") return FALSE @@ -53,8 +53,7 @@ SIGNAL_HANDLER // COMSIG_MOB_WILLINGLY_DROP + COMSIG_FLAYER_RETRACT_IMPLANTS if(!any_hand && !istype(owner.get_active_hand(), weapon_type)) return - INVOKE_ASYNC(owner, TYPE_PROC_REF(/mob, unEquip), weapon_ref, TRUE) - INVOKE_ASYNC(weapon_ref, TYPE_PROC_REF(/atom/movable, forceMove), owner) // Just kinda shove it into the user + owner.transfer_item_to(weapon_ref, owner, force = TRUE, silent = TRUE) owner.update_inv_l_hand() owner.update_inv_r_hand() playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 25, TRUE, ignore_walls = FALSE) diff --git a/code/modules/antagonists/traitor/contractor/datums/syndicate_contract.dm b/code/modules/antagonists/traitor/contractor/datums/syndicate_contract.dm index 55dfc245347..86d432cb229 100644 --- a/code/modules/antagonists/traitor/contractor/datums/syndicate_contract.dm +++ b/code/modules/antagonists/traitor/contractor/datums/syndicate_contract.dm @@ -362,7 +362,7 @@ if(M.back) //Lets not bork modsuits in funny ways. var/obj/modsuit_safety = M.back - M.unEquip(modsuit_safety) + M.drop_item_to_ground(modsuit_safety) stuff_to_transfer += modsuit_safety // Regular items get removed in second for(var/obj/item/I in M) @@ -385,14 +385,14 @@ qdel(I) continue - if(M.unEquip(I)) + if(M.drop_item_to_ground(I)) stuff_to_transfer += I // Remove accessories from the suit if present if(length(H.w_uniform?.accessories)) for(var/obj/item/clothing/accessory/A in H.w_uniform.accessories) H.w_uniform.detach_accessory(A, null) - H.unEquip(A) + H.drop_item_to_ground(A) stuff_to_transfer += A // Transfer it all (or drop it if not possible) diff --git a/code/modules/arcade/arcade_prize.dm b/code/modules/arcade/arcade_prize.dm index 10912d16b37..930cbc424b8 100644 --- a/code/modules/arcade/arcade_prize.dm +++ b/code/modules/arcade/arcade_prize.dm @@ -29,7 +29,7 @@ src.color = pick(GLOB.random_color_list) var/prize_inside = pick(possible_contents) spawn(10) - user.unEquip(src) + user.unequip(src) if(ispath(prize_inside,/obj/item/stack)) var/amount = pick(5, 10, 15, 25, 50) new prize_inside(user.loc, amount) diff --git a/code/modules/arcade/prize_counter.dm b/code/modules/arcade/prize_counter.dm index bbfb26aa84d..3bab7848f10 100644 --- a/code/modules/arcade/prize_counter.dm +++ b/code/modules/arcade/prize_counter.dm @@ -82,7 +82,7 @@ /obj/machinery/prize_counter/attackby__legacy__attackchain(obj/item/O, mob/user, params) if(istype(O, /obj/item/stack/tickets)) var/obj/item/stack/tickets/T = O - if(user.unEquip(T)) //Because if you can't drop it for some reason, you shouldn't be increasing the tickets var + if(user.drop_item_to_ground(T)) tickets += T.amount SStgui.update_uis(src) qdel(T) diff --git a/code/modules/assembly/assembly_holder.dm b/code/modules/assembly/assembly_holder.dm index 3eb13ae461d..60314450f78 100644 --- a/code/modules/assembly/assembly_holder.dm +++ b/code/modules/assembly/assembly_holder.dm @@ -34,12 +34,14 @@ return FALSE if(!A1.remove_item_from_storage(src)) if(user) - user.remove_from_mob(A1) - A1.forceMove(src) + user.transfer_item_to(A1, src) + else + A1.forceMove(src) if(!A2.remove_item_from_storage(src)) if(user) - user.remove_from_mob(A2) - A2.forceMove(src) + user.transfer_item_to(A2, src) + else + A2.forceMove(src) A1.holder = src A2.holder = src a_left = A1 @@ -171,7 +173,7 @@ var/turf/T = get_turf(src) if(!T) return FALSE - user.unEquip(src, TRUE, TRUE) + user.unequip(src, force = TRUE) if(a_left) a_left.holder = null a_left.forceMove(T) diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index 7ef7a8f40c9..5af40484a39 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -110,7 +110,7 @@ var/obj/item/onetankbomb/R = new /obj/item/onetankbomb(loc) M.drop_item() //Remove the assembly from your hands - M.remove_from_mob(src) //Remove the tank from your character,in case you were holding it + M.unequip(src) //Remove the tank from your character,in case you were holding it M.put_in_hands(R) //Equips the bomb if possible, or puts it on the floor. R.bombassembly = S //Tell the bomb about its assembly part diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 3bc0f946c74..55ec3adf372 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -167,7 +167,7 @@ if(!usr.canUnEquip(src)) return - user.unEquip(src) + user.drop_item_to_ground(src) if(src) user.put_in_hands(src) @@ -508,7 +508,7 @@ /obj/item/clothing/head/proc/attach_hat(obj/item/clothing/head/hat, mob/user, unequip = FALSE) if(can_attach_hat(hat)) - if(unequip && !user.unEquip(hat)) // Make absolutely sure this hat is removed from hands + if(unequip && !user.drop_item_to_ground(hat)) // Make absolutely sure this hat is removed from hands return FALSE attached_hats += hat @@ -571,13 +571,13 @@ flags_cover |= MASKCOVERSMOUTH if(H.head == src) if(isnull(user.get_item_by_slot(slot_flags))) - user.unEquip(src) + user.drop_item_to_ground(src) user.equip_to_slot(src, slot_flags) else if(flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer. if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground. - user.unEquip(src) + user.drop_item_to_ground(src) else //Otherwise, put it in an available hand, the active one preferentially. - user.unEquip(src) + user.drop_item_to_ground(src) user.put_in_hands(src) else to_chat(user, "You push \the [src] out of the way.") @@ -598,13 +598,13 @@ flags &= ~AIRTIGHT if(user.wear_mask == src) if(isnull(user.get_item_by_slot(slot_flags))) - user.unEquip(src) + user.drop_item_to_ground(src) user.equip_to_slot(src, slot_flags) else if(initial(flags_inv) == HIDEFACE) //Means that you won't have to take off and put back on simple things like breath masks which, realistically, can just be pulled down off your face. if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground. - user.unEquip(src) + user.drop_item_to_ground(src) else //Otherwise, put it in an available hand, the active one preferentially. - user.unEquip(src) + user.drop_item_to_ground(src) user.put_in_hands(src) H.wear_mask_update(src, toggle_off = up) usr.update_inv_wear_mask() @@ -697,7 +697,7 @@ if(hidden_blade) to_chat(user, "There is already something in [src]!") return - if(!user.unEquip(I)) + if(!user.drop_item_to_ground(I)) return user.visible_message("[user] places [I] into their [name]!", \ "You place [I] into the side of your [name]!") @@ -820,10 +820,10 @@ if(istype(O, /obj/item/storage/internal)) //If it's a pocket... if(O.contents) //Check to see if the pocket's got anything in it. for(var/obj/item/I in O.contents) //Dump the pocket out onto the floor below the user. - user.unEquip(I,1) + user.drop_item_to_ground(I, force = TRUE) user.visible_message("[user] bellows, [pick("shredding", "ripping open", "tearing off")] [user.p_their()] jacket in a fit of rage!","You accidentally [pick("shred", "rend", "tear apart")] [src] with your [pick("excessive", "extreme", "insane", "monstrous", "ridiculous", "unreal", "stupendous")] [pick("power", "strength")]!") - user.unEquip(src) + user.drop_item_to_ground(src) qdel(src) //Now that the pockets have been emptied, we can safely destroy the jacket. user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!")) user.update_inv_wear_suit() @@ -901,7 +901,7 @@ return user.visible_message("[user] manages to [break_restraints ? "break" : "remove"] [src]!", "You successfully [break_restraints ? "break" : "remove"] [src].") - user.unEquip(src) + user.drop_item_to_ground(src) ////////////////////////////// // MARK: SPACE SUIT @@ -1068,7 +1068,7 @@ /obj/item/clothing/under/proc/attach_accessory(obj/item/clothing/accessory/A, mob/user, unequip = FALSE) if(can_attach_accessory(A)) - if(unequip && !user.unEquip(A)) // Make absolutely sure this accessory is removed from hands + if(unequip && !user.drop_item_to_ground(A)) // Make absolutely sure this accessory is removed from hands return FALSE accessories += A diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm index 5874362d7f1..25e886f8719 100644 --- a/code/modules/clothing/glasses/glasses.dm +++ b/code/modules/clothing/glasses/glasses.dm @@ -13,7 +13,7 @@ if(prescription) to_chat(H, "You can't possibly imagine how adding more lenses would improve [src].") return - H.unEquip(I) + H.drop_item_to_ground(I) upgrade_prescription(I) to_chat(H, "You fit [src] with lenses from [I].") diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm index f6eb97f7fa2..932787d7d94 100644 --- a/code/modules/clothing/shoes/magboots.dm +++ b/code/modules/clothing/shoes/magboots.dm @@ -277,7 +277,7 @@ if(cell) to_chat(user, "[src] already has a cell!") return - if(!user.unEquip(I)) + if(!user.drop_item_to_ground(I)) return I.forceMove(src) cell = I diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm index ac6af273e4e..1ca2bda770d 100644 --- a/code/modules/clothing/spacesuits/hardsuit.dm +++ b/code/modules/clothing/spacesuits/hardsuit.dm @@ -205,7 +205,7 @@ to_chat(user, "You cannot install the upgrade to [src] while wearing it.") return - if(user.unEquip(I)) + if(user.temperature_expose(I)) I.forceMove(src) jetpack = I to_chat(user, "You successfully install the jetpack into [src].") diff --git a/code/modules/clothing/suits/armor_suits.dm b/code/modules/clothing/suits/armor_suits.dm index e822e93d425..a23f6c83fb6 100644 --- a/code/modules/clothing/suits/armor_suits.dm +++ b/code/modules/clothing/suits/armor_suits.dm @@ -54,7 +54,7 @@ /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.unEquip(I)) + if(user.drop_item_to_ground(I)) add_fingerprint(user) I.forceMove(src) attached_badge = I diff --git a/code/modules/clothing/suits/hood.dm b/code/modules/clothing/suits/hood.dm index 660911e7fe0..0647bd233e6 100644 --- a/code/modules/clothing/suits/hood.dm +++ b/code/modules/clothing/suits/hood.dm @@ -44,9 +44,10 @@ suit_adjusted = 0 if(ishuman(hood.loc)) var/mob/living/carbon/H = hood.loc - H.unEquip(hood, 1) + H.transfer_item_to(hood, src, force = TRUE) H.update_inv_wear_suit() - hood.forceMove(src) + else + hood.forceMove(src) for(var/X in actions) var/datum/action/A = X A.UpdateButtons() diff --git a/code/modules/clothing/suits/misc_suits.dm b/code/modules/clothing/suits/misc_suits.dm index 5b5f3db86d6..d1f6402e34d 100644 --- a/code/modules/clothing/suits/misc_suits.dm +++ b/code/modules/clothing/suits/misc_suits.dm @@ -1422,7 +1422,7 @@ return var/abaya_type = options[choice] var/obj/item/clothing/suit/hooded/abaya/abaya = new abaya_type(get_turf(src)) - L.unEquip(src, silent = TRUE) + L.unequip(src) L.put_in_active_hand(abaya) to_chat(L, "You are now wearing \a [choice]. Allahu Akbar!") qdel(src) diff --git a/code/modules/clothing/suits/toggles.dm b/code/modules/clothing/suits/toggles.dm index e5e8813818d..48848e28e2b 100644 --- a/code/modules/clothing/suits/toggles.dm +++ b/code/modules/clothing/suits/toggles.dm @@ -13,8 +13,7 @@ var/mob/living/carbon/H = helmet.loc if(helmet.on) helmet.attack_self__legacy__attackchain(H) - H.unEquip(helmet, TRUE) - helmet.forceMove(src) + H.transfer_item_to(helmet, src, force = TRUE) H.update_inv_wear_suit() to_chat(H, "The helmet on the hardsuit disengages.") playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm index 0c6b5722a98..2307688228b 100644 --- a/code/modules/clothing/under/accessories/holster.dm +++ b/code/modules/clothing/under/accessories/holster.dm @@ -50,8 +50,8 @@ return holstered = W - user.unEquip(holstered) - holstered.loc = src + user.unequip(holstered) + holstered.forceMove(src) holstered.add_fingerprint(user) user.visible_message("[user] holsters [holstered].", "You holster [holstered].") diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm index ed1748695ad..14aa4c539ff 100644 --- a/code/modules/crafting/guncrafting.dm +++ b/code/modules/crafting/guncrafting.dm @@ -134,12 +134,12 @@ if(istype(gunkit_to_use, /obj/item/weaponcrafting/gunkit/sparker)) //Snowflake checking, but I don't want a person with a self assembling kit to be robbed var/obj/item/gun_produceda = new gunkit_to_use.outcome var/obj/item/gun_producedb = new gunkit_to_use.outcome - user.unEquip(src) + user.unequip(src) user.put_in_hands(gun_produceda) user.put_in_hands(gun_producedb) else var/obj/item/gun_produced = new gunkit_to_use.outcome - user.unEquip(src) + user.unequip(src) user.put_in_hands(gun_produced) qdel(gunkit_to_use) qdel(src) @@ -150,7 +150,7 @@ if(istype(W,/obj/item/pipe)) to_chat(user, "You attach the shotgun barrel to the receiver. The pins seem loose.") var/obj/item/weaponcrafting/ishotgunconstruction/I = new /obj/item/weaponcrafting/ishotgunconstruction - user.unEquip(src) + user.unequip(src) user.put_in_hands(I) qdel(W) qdel(src) @@ -166,7 +166,7 @@ /obj/item/weaponcrafting/ishotgunconstruction/screwdriver_act(mob/living/user, obj/item/I) var/obj/item/weaponcrafting/ishotgunconstruction2/C = new /obj/item/weaponcrafting/ishotgunconstruction2 - user.unEquip(src) + user.unequip(src) user.put_in_hands(C) to_chat(user, "You screw the pins into place, securing the pipe to the receiver.") qdel(src) @@ -182,7 +182,7 @@ if(istype(W,/obj/item/weaponcrafting/stock)) to_chat(user, "You attach the stock to the receiver-barrel assembly.") var/obj/item/weaponcrafting/ishotgunconstruction3/I = new /obj/item/weaponcrafting/ishotgunconstruction3 - user.unEquip(src) + user.unequip(src) user.put_in_hands(I) qdel(W) qdel(src) @@ -200,7 +200,7 @@ var/obj/item/stack/package_wrap/C = I if(C.use(5)) var/obj/item/gun/projectile/revolver/doublebarrel/improvised/W = new /obj/item/gun/projectile/revolver/doublebarrel/improvised - user.unEquip(src) + user.unequip(src) user.put_in_hands(W) to_chat(user, "You tie the wrapping paper around the stock and the barrel to secure it.") qdel(src) diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm index 3081eddac13..e2dd430a46a 100644 --- a/code/modules/customitems/item_defines.dm +++ b/code/modules/customitems/item_defines.dm @@ -1613,7 +1613,7 @@ playsound(src, 'sound/effects/spray.ogg', 5, TRUE, 5) var/obj/item/clothing/head/helmet/space/plasmaman/lf53_fluff/F = new(P.loc) if(P == H.head) - H.unEquip(P, TRUE, TRUE) + H.unequip(P, force = TRUE) H.equip_to_slot(F, ITEM_SLOT_HEAD, TRUE) H.update_inv_head() qdel(P) diff --git a/code/modules/detective_work/evidence.dm b/code/modules/detective_work/evidence.dm index d8840f8cdfd..79ad107bb01 100644 --- a/code/modules/detective_work/evidence.dm +++ b/code/modules/detective_work/evidence.dm @@ -41,7 +41,7 @@ if(isstorage(I.loc)) //in a container. var/obj/item/storage/U = I.loc U.remove_from_storage(I, src) - else if(!user.is_holding(I) || !user.unEquip(I)) //in a hand + else if(!user.is_holding(I) || !user.unequip(I)) //in a hand return user.visible_message("[user] puts [I] into [src].", "You put [I] inside [src].",\ diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm index 9d8b4b8fd39..998a0eba239 100644 --- a/code/modules/food_and_drinks/drinks/bottler/bottler.dm +++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm @@ -47,7 +47,7 @@ if(is_type_in_list(O,acceptable_items)) if(istype(O, /obj/item/food)) var/obj/item/food/S = O - user.unEquip(S) + user.drop_item_to_ground(S) if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error to_chat(user, "[S] is gone, oh no!") qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents @@ -60,24 +60,24 @@ if(C.can_opened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them to_chat(user, "Only unopened cans and bottles can be processed to ensure product integrity.") return 0 - user.unEquip(C) + user.drop_item_to_ground(C) if(!C.reagents.total_volume) //Empty cans get recycled, even if they have somehow remained unopened due to some sort of error recycle_container(C) else //Full cans that are unopened get inserted for processing as ingredients insert_item(C, user) return 1 else - user.unEquip(O) + user.drop_item_to_ground(O) insert_item(O, user) return 1 else if(istype(O, /obj/item/trash/can)) //Crushed cans (and bottles) are returnable still var/obj/item/trash/can/C = O - user.unEquip(C) + user.drop_item_to_ground(C) recycle_container(C) return 1 else if(istype(O, /obj/item/stack/sheet)) //Sheets of materials can replenish the machine's supply of drink containers (when people inevitably don't return them) var/obj/item/stack/sheet/S = O - user.unEquip(S) + user.drop_item_to_ground(S) process_sheets(S) return 1 else //If it doesn't qualify in the above checks, we don't want it. Inform the person so they (ideally) stop trying to put the nuke disc in. diff --git a/code/modules/food_and_drinks/food/customizables.dm b/code/modules/food_and_drinks/food/customizables.dm index d667e8827d5..24f3218bd19 100644 --- a/code/modules/food_and_drinks/food/customizables.dm +++ b/code/modules/food_and_drinks/food/customizables.dm @@ -356,7 +356,7 @@ do {\ to_chat(user, "Merging [snack] and [src] together is going to make a mess.") return - if(!user.unEquip(snack)) + if(!user.unequip(snack)) to_chat(user, "[snack] is stuck to your hand!") return diff --git a/code/modules/food_and_drinks/food/foods/junkfood.dm b/code/modules/food_and_drinks/food/foods/junkfood.dm index 981abacca5e..4a31ee24b66 100644 --- a/code/modules/food_and_drinks/food/foods/junkfood.dm +++ b/code/modules/food_and_drinks/food/foods/junkfood.dm @@ -115,9 +115,9 @@ var/obj/item/restraints/handcuffs/twimsts/L = new /obj/item/restraints/handcuffs/twimsts L.create_reagents(100) reagents.copy_to(L, reagents.total_volume) - user.unEquip(src) + user.unequip(src) var/obj/item/trash_item = generate_trash(user) - user.unEquip(trash_item) + user.drop_item_to_ground(trash_item) user.put_in_hands(L) qdel(src) diff --git a/code/modules/food_and_drinks/food/foods/pizza.dm b/code/modules/food_and_drinks/food/foods/pizza.dm index ea384ed02fe..dc3b01f9ae5 100644 --- a/code/modules/food_and_drinks/food/foods/pizza.dm +++ b/code/modules/food_and_drinks/food/foods/pizza.dm @@ -607,7 +607,7 @@ return user.visible_message("[user] starts removing the payload and wires from [src].") if(I.use_tool(src, user, 4 SECONDS, volume = 50)) - user.unEquip(src) + user.unequip(src) user.visible_message("[user] removes the insides of [src]!") var/obj/item/stack/cable_coil/C = new /obj/item/stack/cable_coil(src.loc) C.amount = 3 diff --git a/code/modules/food_and_drinks/food_base.dm b/code/modules/food_and_drinks/food_base.dm index 6b92c9b0576..a03e2a1f8fc 100644 --- a/code/modules/food_and_drinks/food_base.dm +++ b/code/modules/food_and_drinks/food_base.dm @@ -150,7 +150,7 @@ if(M == user) to_chat(user, "You finish eating [src].") user.visible_message("[M] finishes eating [src].") - user.unEquip(src) //so icons update :[ + user.unequip(src) //so icons update :[ Post_Consume(M) var/obj/item/trash_item = generate_trash(user) user.put_in_hands(trash_item) @@ -167,7 +167,6 @@ return ..() if(reagents && !reagents.total_volume) // Shouldn't be needed but it checks to see if it has anything left in it. to_chat(user, "None of [src] left, oh no!") - M.unEquip(src) //so icons update :[ qdel(src) return FALSE diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index ee5c23ac0fb..a321b64f840 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -402,16 +402,14 @@ continue if(O.flags & NODROP || stealthmode) qdel(O) //they are already dead by now - H.unEquip(O) - O.loc = loc + H.transfer_item_to(O, loc) O.throw_at(get_edge_target_turf(src, gib_throw_dir), rand(1, 5), 15) sleep(1) for(var/obj/item/clothing/C in H) if(C.flags & NODROP || stealthmode) qdel(C) - H.unEquip(C) - C.loc = loc + H.transfer_item_to(C, loc) C.throw_at(get_edge_target_turf(src, gib_throw_dir), rand(1, 5), 15) sleep(1) diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index 085113c3884..89e838074fe 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -358,12 +358,14 @@ else if(ismob(I.loc)) var/mob/M = I.loc if(M.get_active_hand() == I) - if(!M.drop_item()) + if(M.transfer_item_to(I, src)) + // TODO: Use COMSIG_ATOM_ENTERED/EXITED to update item quantities + // instead of having to fiddle with the values everywhere + item_quants[I.name] += 1 + return TRUE + else to_chat(user, "\The [I] is stuck to you!") return FALSE - else - M.unEquip(I) - I.forceMove(src) else I.forceMove(src) diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index efd1754b3de..571ec9564d7 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -486,7 +486,7 @@ if(is_screen_atom(over)) if(!remove_item_from_storage(get_turf(M))) - M.unEquip(src) + M.drop_item_to_ground(src) switch(over.name) if("r_hand") if(M.put_in_r_hand(src)) @@ -527,7 +527,7 @@ H.cards += cards cards.Cut() - user.unEquip(src, force = 1) + user.unequip(src, force = TRUE) qdel(src) H.update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_OVERLAYS) @@ -1031,7 +1031,7 @@ "You play \the [selected].", "You hear a card being played." ) - user.unEquip(new_hand) + user.drop_item_to_ground(new_hand) var/atom/drop_location = get_step(user, user.dir) var/obj/item/cardhand/hand_on_the_table = locate(/obj/item/cardhand) in drop_location if(istype(hand_on_the_table) && parent_deck_id == hand_on_the_table.parent_deck_id) diff --git a/code/modules/hydroponics/beekeeping/beebox.dm b/code/modules/hydroponics/beekeeping/beebox.dm index 391429b8ec2..0e699eb422a 100644 --- a/code/modules/hydroponics/beekeeping/beebox.dm +++ b/code/modules/hydroponics/beekeeping/beebox.dm @@ -150,7 +150,7 @@ if(istype(I, /obj/item/honey_frame)) var/obj/item/honey_frame/HF = I if(length(honey_frames) < BEEBOX_MAX_FRAMES) - if(!user.unEquip(HF)) + if(!user.unequip(HF)) return visible_message("[user] adds a frame to the apiary.") HF.forceMove(src) @@ -165,7 +165,7 @@ return var/obj/item/queen_bee/qb = I - if(!user.unEquip(qb)) + if(!user.drop_item_to_ground(qb)) return qb.queen.forceMove(src) bees += qb.queen diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index e3487853595..d37b07d3fbb 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -157,7 +157,7 @@ if(length(stored_plants) >= max_storable_plants) to_chat(user, "[src] can't hold any more plants!") return - if(!user.unEquip(O)) + if(!user.drop_item_to_ground(O)) return O.forceMove(src) diff --git a/code/modules/hydroponics/compost_bin.dm b/code/modules/hydroponics/compost_bin.dm index 1badb7576b2..152ed33fa1c 100644 --- a/code/modules/hydroponics/compost_bin.dm +++ b/code/modules/hydroponics/compost_bin.dm @@ -103,7 +103,7 @@ if(biomass >= biomass_capacity && potassium >= potassium_capacity) to_chat(user, "[src] can't hold any more biomass, and its contents are saturated with potassium!") return - if(!user.unEquip(O)) + if(!user.drop_item_to_ground(O)) return O.forceMove(src) diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 45062f1abbd..2519a007649 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -175,7 +175,7 @@ /obj/item/food/grown/shell/attack_self__legacy__attackchain(mob/user) if(!do_after(user, 1.5 SECONDS, target = user)) return - user.unEquip(src) + user.unequip(src) if(trash) var/obj/item/T = generate_trash() user.put_in_hands(T) diff --git a/code/modules/hydroponics/grown/citrus.dm b/code/modules/hydroponics/grown/citrus.dm index 71db76937f7..7bb115ee6d6 100644 --- a/code/modules/hydroponics/grown/citrus.dm +++ b/code/modules/hydroponics/grown/citrus.dm @@ -134,7 +134,7 @@ /obj/item/food/grown/firelemon/proc/update_mob() if(ismob(loc)) var/mob/M = loc - M.unEquip(src) + M.drop_item_to_ground(src) /obj/item/food/grown/firelemon/ex_act(severity) qdel(src) //Ensuring that it's deleted by its own explosion diff --git a/code/modules/hydroponics/grown/corn.dm b/code/modules/hydroponics/grown/corn.dm index e9767333eab..35a4a697837 100644 --- a/code/modules/hydroponics/grown/corn.dm +++ b/code/modules/hydroponics/grown/corn.dm @@ -42,7 +42,6 @@ if(W.sharp) to_chat(user, "You use [W] to fashion a pipe out of the corn cob!") new /obj/item/clothing/mask/cigarette/pipe/cobpipe (user.loc) - user.unEquip(src) qdel(src) return else diff --git a/code/modules/hydroponics/grown/flowers.dm b/code/modules/hydroponics/grown/flowers.dm index 9cac51031a6..0ad9365f91d 100644 --- a/code/modules/hydroponics/grown/flowers.dm +++ b/code/modules/hydroponics/grown/flowers.dm @@ -244,7 +244,6 @@ force -= rand(1, (force / 3) + 1) else to_chat(usr, "All the petals have fallen off [src] from violent whacking!") - usr.unEquip(src) qdel(src) /obj/item/grown/novaflower/pickup(mob/living/carbon/human/user) diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm index ffc4ce7a4c7..0d679bc1e23 100644 --- a/code/modules/hydroponics/grown/nettle.dm +++ b/code/modules/hydroponics/grown/nettle.dm @@ -76,7 +76,7 @@ force -= rand(1, (force / 3) + 1) // When you whack someone with it, leaves fall off else to_chat(usr, "All the leaves have fallen off the nettle from violent whacking.") - usr.unEquip(src) + usr.unequip(src) qdel(src) /obj/item/grown/nettle/basic diff --git a/code/modules/hydroponics/grown/potato.dm b/code/modules/hydroponics/grown/potato.dm index dd9dbc59d7e..e5e66d8c007 100644 --- a/code/modules/hydroponics/grown/potato.dm +++ b/code/modules/hydroponics/grown/potato.dm @@ -43,7 +43,7 @@ to_chat(user, "You cut the potato into wedges with [W].") var/obj/item/food/grown/potato/wedges/Wedges = new /obj/item/food/grown/potato/wedges if(!remove_item_from_storage(user)) - user.unEquip(src) + user.unequip(src) user.put_in_hands(Wedges) qdel(src) else diff --git a/code/modules/hydroponics/grown/root.dm b/code/modules/hydroponics/grown/root.dm index c45ca2e22d1..b1cc2c829ac 100644 --- a/code/modules/hydroponics/grown/root.dm +++ b/code/modules/hydroponics/grown/root.dm @@ -36,7 +36,7 @@ to_chat(user, "You sharpen the carrot into a shiv with [I].") var/obj/item/kitchen/knife/shiv/carrot/Shiv = new () if(!remove_item_from_storage(user)) - user.unEquip(src) + user.unequip(src) user.put_in_hands(Shiv) qdel(src) else diff --git a/code/modules/hydroponics/grown/tomato.dm b/code/modules/hydroponics/grown/tomato.dm index 355e0bce240..6934b92fba3 100644 --- a/code/modules/hydroponics/grown/tomato.dm +++ b/code/modules/hydroponics/grown/tomato.dm @@ -152,7 +152,7 @@ K.health = K.maxHealth K.visible_message("The Killer Tomato growls as it suddenly awakens.") if(user) - user.unEquip(src) + user.unequip(src) message_admins("[key_name_admin(user)] released a killer tomato at [ADMIN_COORDJMP(T)]") log_game("[key_name(user)] released a killer tomato at [COORD(T)]") qdel(src) diff --git a/code/modules/hydroponics/grown/towercap.dm b/code/modules/hydroponics/grown/towercap.dm index 3f48c435c13..86b2a2133a8 100644 --- a/code/modules/hydroponics/grown/towercap.dm +++ b/code/modules/hydroponics/grown/towercap.dm @@ -70,7 +70,7 @@ if(leaf.dry) user.show_message("You wrap \the [W] around the log, turning it into a torch!") var/obj/item/flashlight/flare/torch/T = new /obj/item/flashlight/flare/torch(user.loc) - usr.unEquip(W) + user.unequip(leaf) usr.put_in_active_hand(T) qdel(leaf) qdel(src) diff --git a/code/modules/hydroponics/hydroponics_tray.dm b/code/modules/hydroponics/hydroponics_tray.dm index 6e2e8d3efe9..3174a1a4d62 100644 --- a/code/modules/hydroponics/hydroponics_tray.dm +++ b/code/modules/hydroponics/hydroponics_tray.dm @@ -831,7 +831,7 @@ if(!myseed) if(istype(O, /obj/item/seeds/kudzu)) investigate_log("had Kudzu planted in it by [key_name(user)] at ([x],[y],[z])","kudzu") - user.unEquip(O) + user.unequip(O) to_chat(user, "You plant [O].") dead = FALSE myseed = O diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index b3b91a58313..1f9d9feb17e 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -20,7 +20,7 @@ if(!original_seed) return FALSE - if(user && !user.unEquip(source_item, silent = TRUE)) //couldn't drop the item + if(user && !user.drop_item_to_ground(source_item, silent = TRUE)) //couldn't drop the item return FALSE if(seed_count == -1) diff --git a/code/modules/martial_arts/krav_maga.dm b/code/modules/martial_arts/krav_maga.dm index 79b1739b588..f2db2e92fc8 100644 --- a/code/modules/martial_arts/krav_maga.dm +++ b/code/modules/martial_arts/krav_maga.dm @@ -127,7 +127,7 @@ MARTIAL_ARTS_ACT_CHECK A.do_attack_animation(D, ATTACK_EFFECT_DISARM) var/obj/item/I = D.get_active_hand() - if(prob(60) && D.unEquip(I)) + if(prob(60) && D.drop_item_to_ground(I)) if(!(QDELETED(I) || (I.flags & ABSTRACT))) A.put_in_hands(I) D.visible_message("[A] has disarmed [D]!", \ diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index 6b68ea56f4d..f3f6a6a7424 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -257,7 +257,7 @@ if(istype(T, denied_type) || istype(src, T.denied_type)) to_chat(user, "You can't seem to attach [src] to [H]. Maybe remove a few trophies?") return FALSE - if(!user.unEquip(src)) + if(!user.unequip(src)) return forceMove(H) H.trophies += src diff --git a/code/modules/mining/equipment/mining_charges.dm b/code/modules/mining/equipment/mining_charges.dm index fa3996820e9..719a238fbd1 100644 --- a/code/modules/mining/equipment/mining_charges.dm +++ b/code/modules/mining/equipment/mining_charges.dm @@ -45,7 +45,7 @@ to_chat(user, "You start planting [src].") if(!do_after(user, (2.5 SECONDS) * toolspeed, target = AM)) return - if(!user.unEquip(src)) + if(!user.unequip(src)) return target = AM forceMove(AM) diff --git a/code/modules/mining/laborcamp/laborshuttle.dm b/code/modules/mining/laborcamp/laborshuttle.dm index abb5d600942..afe662bb5a7 100644 --- a/code/modules/mining/laborcamp/laborshuttle.dm +++ b/code/modules/mining/laborcamp/laborshuttle.dm @@ -52,7 +52,7 @@ to_chat(user, "There's an ID inserted already.") 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() diff --git a/code/modules/mining/lavaland/loot/hierophant_loot.dm b/code/modules/mining/lavaland/loot/hierophant_loot.dm index 940a929eb11..a7b71462d9c 100644 --- a/code/modules/mining/lavaland/loot/hierophant_loot.dm +++ b/code/modules/mining/lavaland/loot/hierophant_loot.dm @@ -39,11 +39,11 @@ user.visible_message("[user] fades out, leaving [user.p_their()] belongings behind!") 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 diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm index 4cf0d24f8ce..35eba5b0727 100644 --- a/code/modules/mining/lavaland/loot/tendril_loot.dm +++ b/code/modules/mining/lavaland/loot/tendril_loot.dm @@ -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 diff --git a/code/modules/mining/lavaland/necropolis_chests.dm b/code/modules/mining/lavaland/necropolis_chests.dm index 89e0de5217f..237f37897dd 100644 --- a/code/modules/mining/lavaland/necropolis_chests.dm +++ b/code/modules/mining/lavaland/necropolis_chests.dm @@ -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 diff --git a/code/modules/mob/inventory_procs.dm b/code/modules/mob/inventory_procs.dm index a80372a2f3e..6f886977818 100644 --- a/code/modules/mob/inventory_procs.dm +++ b/code/modules/mob/inventory_procs.dm @@ -140,11 +140,11 @@ //Drops the item in our left hand /mob/proc/drop_l_hand(force = FALSE) - return unEquip(l_hand, force) //All needed checks are in unEquip + return drop_item_to_ground(l_hand, force) //Drops the item in our right hand /mob/proc/drop_r_hand(force = FALSE) - return unEquip(r_hand, force) //Why was this not calling unEquip in the first place jesus fuck. + return drop_item_to_ground(r_hand, force) //Drops the item in our active hand. /mob/proc/drop_item() @@ -153,57 +153,103 @@ else return drop_r_hand() -//Here lie unEquip and before_item_take, already forgotten and not missed. - /mob/proc/canUnEquip(obj/item/I, force) if(!I) return TRUE if((I.flags & NODROP) && !force) return FALSE - if((SEND_SIGNAL(I, COMSIG_ITEM_PRE_UNEQUIP, force) & COMPONENT_ITEM_BLOCK_UNEQUIP) && !force) - return FALSE - return TRUE -/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 +/** + * Unequip `target` and drop it at our current location. + * + * Returns `FALSE` if the unequip failed, and `target` if it succeeded. Returns + * `FALSE` if there is no target to drop. If the caller cares about handling the + * resultant dropped object, they are responsible for ensuring that the thing + * actually exists. This is to ensure that the return value is meaningful and that + * a nonexistant item being unequipped and returning null is not interpreted as + * a failure. + * + * However, if you don't care about the return value, feel free to pass in possibly + * nonexistant objects, such as when dropping anything in a slot for a spell/virus + * that replaces existing clothing. + */ +/mob/proc/drop_item_to_ground(obj/item/target, force = FALSE, silent = FALSE, drop_inventory = TRUE) + if(isnull(target)) + return FALSE - if(!canUnEquip(I, force)) - return 0 + var/try_unequip = unequip_to(target, drop_location(), force, silent, drop_inventory, no_move = FALSE) - if(I == r_hand) + if(!try_unequip || !target) + return FALSE + + return target + +/** + * Unequip `target` and relocate it to `destination`. + * + * Returns `FALSE` if the transfer failed for any reason, and `TRUE` if it succeeded. + */ +/mob/proc/transfer_item_to(obj/item/target, atom/destination, force = FALSE, silent = TRUE) + return unequip_to(target, destination, force, silent, no_move = FALSE) + +/** + * Unequip `target` without relocating it. + * + * Returns `FALSE` if the transfer failed for any reason, and `TRUE` if it succeeded. + * + * A destination cannot be specified; you must either `forceMove` or `qdel` it. + * If you intend to `qdel` it immediately, it is not necessary to call this; + * [/obj/item/proc/Destroy] will perform the necessary unequipping. + */ +/mob/proc/unequip(obj/item/target, force = FALSE, drop_inventory = TRUE) + return unequip_to(target, null, force, silent = TRUE, drop_inventory = drop_inventory, no_move = TRUE) + +/** + * Central proc for unequipping items. Cannot be called but can be overridden so + * long as default arg values are preserved. Use [/mob/proc/unequip], + * [/mob/proc/drop_item_to_ground], or [/mob/proc/transfer_item_to] instead. + * + * - `target`: The object to unequip. + * - `destination`: The location the object should be unequipped to, if applicable. + * - `force`: Override `NODROP` for things like wizarditis and admin undress. + * - `silent`: Whether the unequip should play a sound. + * - `drop_inventory`: Whether items in the dropped item's slots (such as uniform pockets) should be dropped. + * - `no_move`: Whether we should attempt to move the item to `destination` or expect the caller to. + */ +/mob/proc/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) + PROTECTED_PROC(TRUE) + + if((target.flags & NODROP) && !force) + return FALSE + + if((SEND_SIGNAL(target, COMSIG_ITEM_PRE_UNEQUIP, destination, force, silent, drop_inventory, no_move) & COMPONENT_ITEM_BLOCK_UNEQUIP) && !force) + return FALSE + + if(target == r_hand) r_hand = null update_inv_r_hand() - else if(I == l_hand) + else if(target == l_hand) l_hand = null update_inv_l_hand() - else if(I in tkgrabbed_objects) - var/obj/item/tk_grab/tkgrab = tkgrabbed_objects[I] - unEquip(tkgrab, force) + else if(target in tkgrabbed_objects) + var/obj/item/tk_grab/tkgrab = tkgrabbed_objects[target] + unequip_to(tkgrab, destination, force, silent, drop_inventory, no_move) - if(I) + if(target) if(client) - client.screen -= I - var/turf/drop_loc = drop_location() - if(drop_loc) - I.forceMove(drop_loc) - else - I.moveToNullspace() - I.dropped(src, silent) - if(I) - I.layer = initial(I.layer) - I.plane = initial(I.plane) - return 1 - - -//Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob. -/mob/proc/remove_from_mob(obj/O) - unEquip(O) - O.screen_loc = null - return 1 + client.screen -= target + target.layer = initial(target.layer) + target.plane = initial(target.plane) + if(!no_move && !(target.flags & DROPDEL)) + if(isnull(destination)) + target.moveToNullspace() + else + target.forceMove(destination) + target.dropped(src, silent) + return TRUE //Outdated but still in use apparently. This should at least be a human proc. //Daily reminder to murder this - Remie. @@ -258,7 +304,7 @@ var/list/items = list() items |= get_equipped_items(TRUE) for(var/I in items) - unEquip(I) + drop_item_to_ground(I) drop_l_hand() drop_r_hand() diff --git a/code/modules/mob/living/carbon/alien/larva/larva_inventory.dm b/code/modules/mob/living/carbon/alien/larva/larva_inventory.dm index 0c5df6d99e9..b03f8ce3550 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva_inventory.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva_inventory.dm @@ -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, silent = FALSE) +/mob/living/carbon/alien/larva/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) return diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm index 5e0beba2723..517c7b8ae56 100644 --- a/code/modules/mob/living/carbon/alien/special/facehugger.dm +++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm @@ -46,7 +46,7 @@ /obj/item/clothing/mask/facehugger/attack__legacy__attackchain(mob/living/M, mob/user) ..() - user.unEquip(src) + user.drop_item_to_ground(src) Attach(M) /obj/item/clothing/mask/facehugger/examine(mob/user) @@ -129,7 +129,7 @@ var/obj/item/clothing/W = target.wear_mask if(W.flags & NODROP) return FALSE - target.unEquip(W) + target.drop_item_to_ground(W) target.visible_message("[src] tears [W] off of [target]'s face!", \ "[src] tears [W] off of [target]'s face!") diff --git a/code/modules/mob/living/carbon/carbon_procs.dm b/code/modules/mob/living/carbon/carbon_procs.dm index 214ca51752d..1a7112ffe9a 100644 --- a/code/modules/mob/living/carbon/carbon_procs.dm +++ b/code/modules/mob/living/carbon/carbon_procs.dm @@ -9,7 +9,7 @@ for(var/obj/item in get_all_slots()) if(QDELETED(item)) continue - unEquip(item, silent = TRUE) + drop_item_to_ground(item, silent = TRUE) qdel(item) QDEL_LIST_CONTENTS(internal_organs) QDEL_LIST_CONTENTS(stomach_contents) @@ -704,7 +704,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven else if(!(I.flags & ABSTRACT)) //can't throw abstract items thrown_thing = I - unEquip(I, silent = TRUE) + drop_item_to_ground(I, silent = TRUE) if(HAS_TRAIT(src, TRAIT_PACIFISM) && I.throwforce) to_chat(src, "You set [I] down gently on the ground.") @@ -733,25 +733,26 @@ 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, 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. +/mob/living/carbon/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) + . = ..() + + if(!. || !target) //We don't want to set anything to null if the parent returned 0. return - if(I == back) + if(target == back) back = null update_inv_back() - else if(I == wear_mask) + else if(target == wear_mask) if(ishuman(src)) //If we don't do this hair won't be properly rebuilt. return wear_mask = null update_inv_wear_mask() - else if(I == handcuffed) + else if(target == handcuffed) handcuffed = null if(buckled && buckled.buckle_requires_restraints) unbuckle() update_handcuffed() - else if(I == legcuffed) + else if(target == legcuffed) legcuffed = null toggle_move_intent() update_inv_legcuffed() @@ -932,7 +933,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven to_chat(src, "You get rid of [I]!") if(I.security_lock) I.do_break() - unEquip(I) + drop_item_to_ground(I) remove_status_effect(STATUS_EFFECT_REMOVE_MUZZLE) /mob/living/carbon/proc/cuff_resist(obj/item/restraints/restraints, break_cuffs) diff --git a/code/modules/mob/living/carbon/give.dm b/code/modules/mob/living/carbon/give.dm index 5912c039db9..2b79b1f307d 100644 --- a/code/modules/mob/living/carbon/give.dm +++ b/code/modules/mob/living/carbon/give.dm @@ -170,7 +170,7 @@ to_chat(receiver, "[I] stays stuck to [giver]'s hand when you try to take it!") return UnregisterSignal(I, list(COMSIG_ITEM_EQUIPPED, COMSIG_ITEM_DROPPED)) // We don't want these triggering `cancel_give` at this point, since the give is successful. - giver.unEquip(I) + giver.drop_item_to_ground(I) receiver.put_in_hands(I) I.add_fingerprint(receiver) I.on_give(giver, receiver) diff --git a/code/modules/mob/living/carbon/human/human_deadchat_control.dm b/code/modules/mob/living/carbon/human/human_deadchat_control.dm index 2c1092efbac..f1c2ffcb4d9 100644 --- a/code/modules/mob/living/carbon/human/human_deadchat_control.dm +++ b/code/modules/mob/living/carbon/human/human_deadchat_control.dm @@ -59,7 +59,7 @@ visible_message("[src] seems to have [p_their()] hands full!") return visible_message("[src] drops [in_hand] and picks up [thing] instead!") - unEquip(in_hand) + unequip(in_hand) in_hand.forceMove(old_loc) else visible_message("[src] picks up [thing]!") diff --git a/code/modules/mob/living/carbon/human/human_death.dm b/code/modules/mob/living/carbon/human/human_death.dm index 86ead9b289a..ecabf66da4e 100644 --- a/code/modules/mob/living/carbon/human/human_death.dm +++ b/code/modules/mob/living/carbon/human/human_death.dm @@ -18,8 +18,7 @@ thing.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1, 3), 5) for(var/obj/item/I in get_equipped_items(include_pockets = TRUE)) - unEquip(I, TRUE) - I.forceMove(get_turf(src)) + drop_item_to_ground(I, force = TRUE) if(!QDELETED(I)) // This is in case moving to the turf deletes the atom. I.throw_at(get_edge_target_turf(src, pick(GLOB.alldirs)), rand(1, 3), 5) diff --git a/code/modules/mob/living/carbon/human/human_emote.dm b/code/modules/mob/living/carbon/human/human_emote.dm index a9a07b72d12..3d89e7c0f22 100644 --- a/code/modules/mob/living/carbon/human/human_emote.dm +++ b/code/modules/mob/living/carbon/human/human_emote.dm @@ -323,7 +323,7 @@ ) if(cig.lit) to_chat(user, "The lit [cig] burns on the way down!") - user.unEquip(cig) + user.unequip(cig) qdel(cig) H.adjustFireLoss(5) return TRUE diff --git a/code/modules/mob/living/carbon/human/human_inventory.dm b/code/modules/mob/living/carbon/human/human_inventory.dm index 4f87fe4ff7a..6933d164a71 100644 --- a/code/modules/mob/living/carbon/human/human_inventory.dm +++ b/code/modules/mob/living/carbon/human/human_inventory.dm @@ -67,42 +67,45 @@ if(ITEM_SLOT_ACCESSORY) return TRUE -/mob/living/carbon/human/unEquip(obj/item/I, force, silent = FALSE) +/mob/living/carbon/human/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) . = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should. - if(!. || !I) + if(!. || !target) return - if(I == wear_suit) - if(s_store) - unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit. + if(target == wear_suit) + if(s_store && drop_inventory) + // It makes no sense for your suit storage to stay on you if you drop your suit. + drop_item_to_ground(s_store, force = TRUE) wear_suit = null - if(I.flags_inv & HIDEJUMPSUIT) + if(target.flags_inv & HIDEJUMPSUIT) update_inv_w_uniform() - if(I.flags_inv & HIDESHOES) + if(target.flags_inv & HIDESHOES) update_inv_shoes() - if(I.flags_inv & HIDEGLOVES) + if(target.flags_inv & HIDEGLOVES) update_inv_gloves() update_inv_wear_suit() - else if(I == w_uniform) - if(r_store) - unEquip(r_store, 1) //Again, makes sense for pockets to drop. - if(l_store) - unEquip(l_store, 1) - if(wear_id) - unEquip(wear_id) - if(belt && !(belt.flags_2 & ALLOW_BELT_NO_JUMPSUIT_2)) - unEquip(belt) + else if(target == w_uniform) + //Again, makes sense for pockets to drop. + if(drop_inventory) + if(r_store) + drop_item_to_ground(r_store, force = TRUE) + if(l_store) + drop_item_to_ground(l_store, force = TRUE) + if(wear_id) + drop_item_to_ground(wear_id, force = TRUE) + if(belt && !(belt.flags_2 & ALLOW_BELT_NO_JUMPSUIT_2)) + drop_item_to_ground(belt, force = TRUE) w_uniform = null update_inv_w_uniform() - else if(I == gloves) + else if(target == gloves) gloves = null update_inv_gloves() - else if(I == neck) + else if(target == neck) neck = null update_inv_neck() - else if(I == glasses) + else if(target == glasses) glasses = null - var/obj/item/clothing/glasses/G = I + var/obj/item/clothing/glasses/G = target if(G.tint) update_tint() if(G.prescription) @@ -111,71 +114,71 @@ update_sight() update_inv_glasses() update_client_colour() - else if(I == head) + else if(target == head) head = null - if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR) + if(target.flags & BLOCKHAIR || target.flags & BLOCKHEADHAIR) update_hair() //rebuild hair update_fhair() update_head_accessory() // Bandanas and paper hats go on the head but are not head clothing - if(istype(I,/obj/item/clothing/head)) - var/obj/item/clothing/head/hat = I + if(istype(target, /obj/item/clothing/head)) + var/obj/item/clothing/head/hat = target if(hat.vision_flags || hat.see_in_dark || !isnull(hat.lighting_alpha)) update_sight() - if(I.flags_inv & HIDEEARS) + if(target.flags_inv & HIDEEARS) update_inv_ears() - head_update(I) + head_update(target) update_inv_head() update_misc_effects() - else if(I == r_ear) + else if(target == r_ear) r_ear = null update_inv_ears() - else if(I == l_ear) + else if(target == l_ear) l_ear = null update_inv_ears() - else if(I == shoes) + else if(target == shoes) shoes = null update_inv_shoes() - else if(I == belt) + else if(target == belt) belt = null update_inv_belt() - else if(I == wear_mask) + else if(target == wear_mask) wear_mask = null - if(I.flags & BLOCKHAIR || I.flags & BLOCKHEADHAIR) + if(target.flags & BLOCKHAIR || target.flags & BLOCKHEADHAIR) update_hair() //rebuild hair update_fhair() update_head_accessory() if(internal && !get_organ_slot("breathing_tube")) internal = null - if(I.flags_inv & HIDEEARS) + if(target.flags_inv & HIDEEARS) update_inv_ears() - wear_mask_update(I, toggle_off = FALSE) + wear_mask_update(target, toggle_off = FALSE) sec_hud_set_ID() update_misc_effects() update_inv_wear_mask() - else if(I == wear_id) + else if(target == wear_id) wear_id = null sec_hud_set_ID() update_inv_wear_id() - else if(I == wear_pda) + else if(target == wear_pda) wear_pda = null update_inv_wear_pda() - else if(I == r_store) + else if(target == r_store) r_store = null update_inv_pockets() - else if(I == l_store) + else if(target == l_store) l_store = null update_inv_pockets() - else if(I == s_store) + else if(target == s_store) s_store = null update_inv_s_store() - else if(I == back) + else if(target == back) back = null update_inv_back() - else if(I == r_hand) + else if(target == r_hand) r_hand = null update_inv_r_hand() - else if(I == l_hand) + else if(target == l_hand) l_hand = null update_inv_l_hand() update_action_buttons_icon() @@ -326,7 +329,7 @@ update_inv_s_store() if(ITEM_SLOT_IN_BACKPACK) if(get_active_hand() == I) - unEquip(I) + drop_item_to_ground(I) if(ismodcontrol(back)) var/obj/item/mod/control/C = back if(C.bag) diff --git a/code/modules/mob/living/carbon/human/human_mob.dm b/code/modules/mob/living/carbon/human/human_mob.dm index 7586049bf70..ebe84b02116 100644 --- a/code/modules/mob/living/carbon/human/human_mob.dm +++ b/code/modules/mob/living/carbon/human/human_mob.dm @@ -1453,7 +1453,7 @@ Eyes need to have significantly high darksight to shine unless the mob has the X ..() if(current_size >= STAGE_THREE) for(var/obj/item/hand in get_both_hands(src)) - if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && unEquip(hand)) + if(prob(current_size * 5) && hand.w_class >= ((11-current_size)/2) && drop_item_to_ground(hand)) step_towards(hand, src) to_chat(src, "\The [S] pulls \the [hand] from your grip!") rad_act(current_size * 3) diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 6a26c0bc811..31e6e83233d 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -92,12 +92,12 @@ if((E.body_part == HAND_LEFT) || (E.body_part == ARM_LEFT)) if(!l_hand) continue - if(!unEquip(l_hand)) + if(!drop_item_to_ground(l_hand)) continue else if(!r_hand) continue - if(!unEquip(r_hand)) + if(!drop_item_to_ground(r_hand)) continue if(!E.properly_attached) @@ -116,12 +116,12 @@ if((E.body_part == HAND_LEFT) || (E.body_part == ARM_LEFT)) if(!l_hand) continue - if(!unEquip(l_hand)) + if(!drop_item_to_ground(l_hand)) continue else if(!r_hand) continue - if(!unEquip(r_hand)) + if(!drop_item_to_ground(r_hand)) continue custom_emote(EMOTE_VISIBLE, "drops what [p_they()] [p_were()] holding, [p_their()] [E.name] malfunctioning!") diff --git a/code/modules/mob/living/carbon/human/human_update_icons.dm b/code/modules/mob/living/carbon/human/human_update_icons.dm index 91860b6a882..bbac701116e 100644 --- a/code/modules/mob/living/carbon/human/human_update_icons.dm +++ b/code/modules/mob/living/carbon/human/human_update_icons.dm @@ -636,7 +636,7 @@ GLOBAL_LIST_EMPTY(damage_icon_parts) // Automatically drop anything in store / id / belt if you're not wearing a uniform. //CHECK IF NECESARRY for(var/obj/item/thing in uniform_slots) // whoever made this if(thing) // you're a piece of fucking garbage - unEquip(thing) // why the fuck would you goddamn do this motherfucking shit + drop_item_to_ground(thing) // why the fuck would you goddamn do this motherfucking shit if(client) // INVENTORY CODE IN FUCKING ICON CODE client.screen -= thing // WHAT THE FUCKING FUCK BAY GODDAMNIT // **I FUCKING HATE YOU AAAAAAAAAA** diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index 7d18e244adf..f85599e9914 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -370,7 +370,7 @@ continue var/obj/item/thing = H.get_item_by_slot(slot_id) if(thing && (!thing.species_exception || !is_type_in_list(src, thing.species_exception))) - H.unEquip(thing) + H.drop_item_to_ground(thing) if(H.hud_used) H.hud_used.update_locked_slots() H.ventcrawler = ventcrawler diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index c38a25432fe..9bf1d0ff912 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -372,7 +372,7 @@ /datum/species/golem/sand/handle_death(gibbed, mob/living/carbon/human/H) H.visible_message("[H] turns into a pile of sand!") for(var/obj/item/W in H) - H.unEquip(W) + H.drop_item_to_ground(W) for(var/i=1, i <= rand(3, 5), i++) new /obj/item/stack/ore/glass(get_turf(H)) qdel(H) @@ -406,7 +406,7 @@ playsound(H, "shatter", 70, 1) H.visible_message("[H] shatters!") for(var/obj/item/W in H) - H.unEquip(W) + H.drop_item_to_ground(W) for(var/i=1, i <= rand(3, 5), i++) new /obj/item/shard(get_turf(H)) qdel(H) diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index 91303d80766..d8684d7e2d3 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -192,7 +192,7 @@ /datum/species/plasmaman/after_equip_job(datum/job/J, mob/living/carbon/human/H) if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime") - H.unEquip(H.wear_mask) + H.drop_item_to_ground(H.wear_mask) H.equip_or_collect(new /obj/item/clothing/mask/breath(H), ITEM_SLOT_MASK) var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null @@ -202,7 +202,7 @@ else internal_tank = new /obj/item/tank/internals/plasmaman/belt/full(H) if(!H.equip_to_appropriate_slot(internal_tank) && !H.put_in_any_hand_if_possible(internal_tank)) - H.unEquip(H.l_hand) + H.drop_item_to_ground(H.l_hand) H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND) to_chat(H, "Could not find an empty slot for internals! Please report this as a bug.") stack_trace("Failed to equip plasmaman with a tank, with the job [J.type]") diff --git a/code/modules/mob/living/carbon/human/species/vox.dm b/code/modules/mob/living/carbon/human/species/vox.dm index 38ee100d642..ef4af813f56 100644 --- a/code/modules/mob/living/carbon/human/species/vox.dm +++ b/code/modules/mob/living/carbon/human/species/vox.dm @@ -79,7 +79,7 @@ /datum/species/vox/after_equip_job(datum/job/J, mob/living/carbon/human/H) if(!H.mind || !H.mind.assigned_role || H.mind.assigned_role != "Clown" && H.mind.assigned_role != "Mime") - H.unEquip(H.wear_mask) + H.drop_item_to_ground(H.wear_mask) H.equip_or_collect(new /obj/item/clothing/mask/breath/vox/respirator(H), ITEM_SLOT_MASK) var/tank_pref = H.client && H.client.prefs ? H.client.prefs.active_character.speciesprefs : null @@ -90,7 +90,7 @@ internal_tank = new /obj/item/tank/internals/emergency_oxygen/double/vox(H) if(!H.equip_to_appropriate_slot(internal_tank)) if(!H.put_in_any_hand_if_possible(internal_tank)) - H.unEquip(H.l_hand) + H.drop_item_to_ground(H.l_hand) H.equip_or_collect(internal_tank, ITEM_SLOT_LEFT_HAND) to_chat(H, "Could not find an empty slot for internals! Please report this as a bug") H.internal = internal_tank diff --git a/code/modules/mob/living/carbon/superheroes.dm b/code/modules/mob/living/carbon/superheroes.dm index cb497112049..62488b8113e 100644 --- a/code/modules/mob/living/carbon/superheroes.dm +++ b/code/modules/mob/living/carbon/superheroes.dm @@ -15,7 +15,7 @@ /datum/superheroes/proc/equip(mob/living/carbon/human/H) H.rename_character(H.real_name, name) for(var/obj/item/W in H.get_all_slots()) - H.unEquip(W) + H.drop_item_to_ground(W) H.equip_to_slot_or_del(new /obj/item/radio/headset(H), ITEM_SLOT_LEFT_EAR) /datum/superheroes/proc/fixflags(mob/living/carbon/human/H) @@ -222,7 +222,7 @@ // No `update_dna=0` here because the character is being over-written target.change_eye_color(1,1,1) for(var/obj/item/W in target.get_all_slots()) - target.unEquip(W) + target.drop_item_to_ground(W) target.rename_character(target.real_name, "Generic Henchman ([rand(1, 1000)])") target.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey/greytide(target), ITEM_SLOT_JUMPSUIT) target.equip_to_slot_or_del(new /obj/item/clothing/shoes/black/greytide(target), ITEM_SLOT_SHOES) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 2df2bb1a32b..eff680b8862 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -481,12 +481,12 @@ var/mob/living/carbon/C = src if(C.handcuffed && !initial(C.handcuffed)) - C.unEquip(C.handcuffed) + C.drop_item_to_ground(C.handcuffed) C.handcuffed = initial(C.handcuffed) C.update_handcuffed() if(C.legcuffed && !initial(C.legcuffed)) - C.unEquip(C.legcuffed) + C.drop_item_to_ground(C.legcuffed) C.legcuffed = initial(C.legcuffed) C.update_inv_legcuffed() diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 653a6c7cdb3..1a0793f528d 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -264,7 +264,7 @@ /mob/living/silicon/pai/proc/force_fold_out() if(ismob(card.loc)) var/mob/holder = card.loc - holder.unEquip(card) + holder.drop_item_to_ground(card) else if(istype(card.loc, /obj/item/pda)) var/obj/item/pda/holder = card.loc holder.pai = null @@ -343,7 +343,7 @@ if(istype(H)) var/mob/living/M = H.loc if(istype(M)) - M.unEquip(H) + M.drop_item_to_ground(H) H.loc = get_turf(src) loc = get_turf(H) diff --git a/code/modules/mob/living/silicon/robot/robot_inventory.dm b/code/modules/mob/living/silicon/robot/robot_inventory.dm index e3201740d5a..49f38ab2fd2 100644 --- a/code/modules/mob/living/silicon/robot/robot_inventory.dm +++ b/code/modules/mob/living/silicon/robot/robot_inventory.dm @@ -239,9 +239,9 @@ 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, silent = FALSE) - if(I == module_active) - uneq_active(I) +/mob/living/silicon/robot/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) + if(target == module_active) + uneq_active(target) return ..() /mob/living/silicon/robot/proc/update_module_icon() diff --git a/code/modules/mob/living/silicon/silicon_mob.dm b/code/modules/mob/living/silicon/silicon_mob.dm index a0997ce25e3..d4d5dca09d3 100644 --- a/code/modules/mob/living/silicon/silicon_mob.dm +++ b/code/modules/mob/living/silicon/silicon_mob.dm @@ -539,7 +539,7 @@ to_chat(user, "[item_to_add] does not fit on the head of [src]!") return FALSE - if(!user.unEquip(item_to_add)) + if(!user.transfer_item_to(item_to_add, src)) to_chat(user, "[item_to_add] is stuck to your hand, you cannot put it on [src]!") return FALSE @@ -547,7 +547,6 @@ "[user] puts [item_to_add] on [real_name].", "You put [item_to_add] on [real_name]." ) - item_to_add.forceMove(src) silicon_hat = item_to_add update_icons() @@ -578,7 +577,7 @@ /mob/living/silicon/proc/drop_hat() if(silicon_hat) - unEquip(silicon_hat) + drop_item_to_ground(silicon_hat) null_hat() update_icons() return TRUE diff --git a/code/modules/mob/living/simple_animal/bot/bot_construction.dm b/code/modules/mob/living/simple_animal/bot/bot_construction.dm index d7c307eb330..ee1cc37414f 100644 --- a/code/modules/mob/living/simple_animal/bot/bot_construction.dm +++ b/code/modules/mob/living/simple_animal/bot/bot_construction.dm @@ -17,7 +17,7 @@ /obj/item/bucket_sensor/attackby__legacy__attackchain(obj/item/W, mob/user as mob, params) ..() if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return qdel(W) var/turf/T = get_turf(loc) @@ -25,7 +25,7 @@ A.name = created_name A.robot_arm = W.type to_chat(user, "You add the robot arm to the bucket and sensor assembly. Beep boop!") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) else if(is_pen(W)) @@ -64,7 +64,7 @@ switch(build_step) if(0,1) if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return qdel(W) build_step++ @@ -78,7 +78,7 @@ else if(istype(W, /obj/item/clothing/suit/bluetag)) newcolor = "b" if(newcolor || istype(W, /obj/item/clothing/suit/armor/vest)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return lasercolor = newcolor qdel(W) @@ -105,7 +105,7 @@ if(!istype(W, /obj/item/clothing/head/helmet)) return - if(!user.unEquip(W)) + if(!user.unequip(W)) return qdel(W) build_step++ @@ -114,7 +114,7 @@ if(5) if(isprox(W)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return qdel(W) build_step++ @@ -153,7 +153,7 @@ new_name = "disabler ED-209 assembly" else return - if(!user.unEquip(W)) + if(!user.unequip(W)) return build_step++ to_chat(user, "You add [W] to [src].") @@ -166,14 +166,14 @@ if(9) if(istype(W, /obj/item/stock_parts/cell)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return build_step++ to_chat(user, "You complete the ED-209.") var/turf/T = get_turf(src) new /mob/living/simple_animal/bot/ed209(T,created_name,lasercolor) qdel(W) - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) /obj/item/ed209_assembly/screwdriver_act(mob/living/user, obj/item/I) @@ -280,7 +280,7 @@ B.update_icon(UPDATE_ICON_STATE) user.put_in_hands(B) to_chat(user, "You add the tiles into the empty toolbox. They protrude from the top.") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) else to_chat(user, "You need 10 floor tiles to start building a floorbot.") @@ -299,7 +299,7 @@ B.update_icon(UPDATE_ICON_STATE) user.put_in_hands(B) to_chat(user, "You add the sensor to the toolbox and tiles.") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) else if(is_pen(W)) @@ -321,7 +321,7 @@ A.name = created_name A.robot_arm = W.type to_chat(user, "You add the robot arm to the odd looking toolbox assembly. Boop beep!") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) //Medbot Assembly @@ -349,7 +349,7 @@ qdel(I) user.put_in_hands(A) to_chat(user, "You add the robot arm to the first aid kit.") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) /obj/item/firstaid_arm_assembly @@ -423,7 +423,7 @@ S.robot_arm = robot_arm else new /mob/living/simple_animal/bot/medbot/syndicate(T) //Syndicate medibots are a special case that have so many unique vars on them, it's not worth passing them through construction phases - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) /obj/item/firstaid_arm_assembly/update_name() @@ -455,7 +455,7 @@ var/obj/item/secbot_assembly/A = new /obj/item/secbot_assembly user.put_in_hands(A) to_chat(user, "You add the signaler to the helmet.") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) @@ -470,14 +470,14 @@ to_chat(user, "You weld the hole in [src] shut!") else if(isprox(I) && (build_step == 1)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return build_step++ to_chat(user, "You add the prox sensor to [src]!") qdel(I) else if(((istype(I, /obj/item/robot_parts/l_arm)) || (istype(I, /obj/item/robot_parts/r_arm))) && (build_step == 2)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return build_step++ to_chat(user, "You add the robot arm to [src]!") @@ -485,7 +485,7 @@ qdel(I) else if((istype(I, /obj/item/melee/baton)) && (build_step >= 3)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return build_step++ to_chat(user, "You complete the Securitron! Beep boop.") @@ -509,7 +509,7 @@ var/obj/item/griefsky_assembly/A = new /obj/item/griefsky_assembly(get_turf(src)) user.put_in_hands(A) to_chat(user, "You adjust the arm slots for extra weapons!") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) update_appearance(UPDATE_NAME|UPDATE_OVERLAYS) @@ -567,14 +567,14 @@ /obj/item/griefsky_assembly/attackby__legacy__attackchain(obj/item/I, mob/user, params) ..() if((istype(I, /obj/item/melee/energy/sword)) && (build_step < 3)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return build_step++ to_chat(user, "You add an energy sword to [src]!.") qdel(I) else if((istype(I, /obj/item/melee/energy/sword)) && (build_step == 3)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return to_chat(user, "You complete General Griefsky!.") new /mob/living/simple_animal/bot/secbot/griefsky(get_turf(src)) @@ -582,14 +582,14 @@ qdel(src) else if((istype(I, /obj/item/toy/sword)) && (toy_step < 3)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return toy_step++ to_chat(user, "You add a toy sword to [src]!.") qdel(I) else if((istype(I, /obj/item/toy/sword)) && (toy_step == 3)) - if(!user.unEquip(I)) + if(!user.unequip(I)) return to_chat(user, "You complete Genewul Giftskee!.") new /mob/living/simple_animal/bot/secbot/griefsky/toy(get_turf(src)) @@ -626,7 +626,7 @@ qdel(W) user.put_in_hands(A) to_chat(user, "You add the robot arm to the honkbot.") - user.unEquip(src, 1) + user.unequip(src, force = TRUE) qdel(src) /obj/item/honkbot_arm_assembly @@ -644,21 +644,21 @@ ..() if(build_step == 0) if(istype(W, /obj/item/assembly/prox_sensor)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return build_step++ to_chat(user, "You add the proximity sensor to [src].") qdel(W) else if(build_step == 1) if(istype(W, /obj/item/bikehorn)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return build_step++ to_chat(user, "You add the bikehorn to [src]! Honk!") qdel(W) else if(build_step == 2) if(istype(W, /obj/item/instrument/trombone)) - if(!user.unEquip(W)) + if(!user.unequip(W)) return to_chat(user, "You add the trombone to [src]! Heeeenk!") qdel(W) diff --git a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm index 2043aa8e15d..fd3e170fc39 100644 --- a/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm +++ b/code/modules/mob/living/simple_animal/friendly/diona_nymph.dm @@ -210,7 +210,7 @@ ADD_TRAIT(adult.mind, TRAIT_XENOBIO_SPAWNED_HUMAN, ROUNDSTART_TRAIT) for(var/obj/item/W in contents) - unEquip(W) + drop_item_to_ground(W) qdel(src) return TRUE diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm index bbd77992834..6726f119368 100644 --- a/code/modules/mob/living/simple_animal/friendly/dog.dm +++ b/code/modules/mob/living/simple_animal/friendly/dog.dm @@ -224,7 +224,7 @@ return return - if(user && !user.unEquip(item_to_add)) + if(user && !user.drop_item_to_ground(item_to_add)) to_chat(user, "\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!") return 0 diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm index 3c40fd3f44e..76a098c6b5d 100644 --- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm +++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm @@ -241,7 +241,7 @@ mind.transfer_to(C) if(pcollar) var/the_collar = pcollar - unEquip(pcollar) + drop_item_to_ground(pcollar) C.add_collar(the_collar) qdel(src) diff --git a/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm b/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm index ebffde91bd8..be47ddf0ade 100644 --- a/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm +++ b/code/modules/mob/living/simple_animal/friendly/nian_caterpillar.dm @@ -99,7 +99,7 @@ adult.real_name = adult.dna.species.get_random_name() adult.name = adult.real_name for(var/obj/item/W in contents) - unEquip(W) + drop_item_to_ground(W) qdel(src) return TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index b290d2a4ef9..26037a60fb3 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -470,7 +470,7 @@ Difficulty: Hard /mob/living/simple_animal/hostile/megafauna/hierophant/devour(mob/living/L) for(var/obj/item/W in L) - if(!L.unEquip(W)) + if(!L.drop_item_to_ground(W)) qdel(W) visible_message("\"[pick(kill_phrases)]\"") visible_message("[src] annihilates [L]!","You annihilate [L], restoring your health!") diff --git a/code/modules/mob/living/simple_animal/parrot.dm b/code/modules/mob/living/simple_animal/parrot.dm index 5962f11d651..e35f1243869 100644 --- a/code/modules/mob/living/simple_animal/parrot.dm +++ b/code/modules/mob/living/simple_animal/parrot.dm @@ -582,7 +582,7 @@ if(C.r_hand && C.r_hand.w_class <= WEIGHT_CLASS_SMALL) stolen_item = C.r_hand - if(stolen_item && C.unEquip(stolen_item)) + if(stolen_item && C.drop_item_to_ground(stolen_item)) try_grab_item(stolen_item) visible_message("[src] grabs [held_item] out of [C]'s hand!", "You snag [held_item] out of [C]'s hand!", "You hear the sounds of wings flapping furiously.") return held_item diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index daec7a7b43e..77f3a594b59 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -504,12 +504,12 @@ if(ITEM_SLOT_COLLAR) add_collar(W) -/mob/living/simple_animal/unEquip(obj/item/I, force, silent = FALSE) +/mob/living/simple_animal/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) . = ..() - if(!. || !I) + if(!. || !target) return - if(I == pcollar) + if(target == pcollar) pcollar = null regenerate_icons() @@ -593,7 +593,7 @@ /mob/living/simple_animal/proc/add_collar(obj/item/petcollar/P, mob/user) if(!istype(P) || QDELETED(P) || pcollar) return - if(user && !user.unEquip(P)) + if(user && !user.drop_item_to_ground(P)) return P.forceMove(src) P.equipped(src) @@ -611,7 +611,7 @@ var/obj/old_collar = pcollar - unEquip(pcollar) + drop_item_to_ground(pcollar) if(user) user.put_in_hands(old_collar) diff --git a/code/modules/mob/living/simple_animal/slime/slime_mob.dm b/code/modules/mob/living/simple_animal/slime/slime_mob.dm index ce0a5d3087a..9ca33b23d69 100644 --- a/code/modules/mob/living/simple_animal/slime/slime_mob.dm +++ b/code/modules/mob/living/simple_animal/slime/slime_mob.dm @@ -266,7 +266,7 @@ return return ..() -/mob/living/simple_animal/slime/unEquip(obj/item/I, force, silent = FALSE) +/mob/living/simple_animal/slime/unequip_to(obj/item/target, atom/destination, force = FALSE, silent = FALSE, drop_inventory = TRUE, no_move = FALSE) return /mob/living/simple_animal/slime/start_pulling(atom/movable/AM, state, force = pull_force, show_message = FALSE) diff --git a/code/modules/mob/mob_holder.dm b/code/modules/mob/mob_holder.dm index 5f7200b1734..51bada17cab 100644 --- a/code/modules/mob/mob_holder.dm +++ b/code/modules/mob/mob_holder.dm @@ -49,7 +49,7 @@ var/mob/M = src.loc //Get our mob holder (if any). if(istype(M)) - M.unEquip(src) + M.drop_item_to_ground(src) to_chat(M, "[src] wriggles out of your grip!") to_chat(L, "You wriggle out of [M]'s grip!") else if(isitem(loc)) diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index ed96ca9e34c..3f238a8f4c6 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -11,7 +11,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) notransform = TRUE icon = null invisibility = 101 @@ -56,7 +56,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) notransform = TRUE icon = null @@ -124,7 +124,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) regenerate_icons() notransform = TRUE icon = null @@ -154,7 +154,7 @@ return notransform = TRUE for(var/obj/item/I in src) - unEquip(I) + drop_item_to_ground(I) regenerate_icons() icon = null invisibility = INVISIBILITY_MAXIMUM @@ -185,7 +185,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) regenerate_icons() notransform = TRUE icon = null @@ -211,7 +211,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) regenerate_icons() notransform = TRUE @@ -250,7 +250,7 @@ if(notransform) return for(var/obj/item/W in src) - unEquip(W) + drop_item_to_ground(W) regenerate_icons() notransform = TRUE icon = null @@ -279,7 +279,7 @@ return for(var/obj/item/W in get_all_slots()) - unEquip(W) + drop_item_to_ground(W) regenerate_icons() notransform = TRUE diff --git a/code/modules/mod/mod_activation.dm b/code/modules/mod/mod_activation.dm index 915d02d123c..d103ebcb605 100644 --- a/code/modules/mod/mod_activation.dm +++ b/code/modules/mod/mod_activation.dm @@ -76,7 +76,7 @@ if(part in overslotting_parts) var/obj/item/overslot = wearer.get_item_by_slot(part.slot_flags) if(overslot) - wearer.unEquip(overslot, TRUE) + wearer.drop_item_to_ground(overslot, force = TRUE) overslotting_parts[part] = overslot overslot.forceMove(part) RegisterSignal(part, COMSIG_ATOM_EXITED, PROC_REF(on_overslot_exit)) @@ -104,8 +104,7 @@ to_chat(user, "You already have retracted there!") playsound(src, 'sound/machines/scanbuzz.ogg', 25, TRUE, SILENCED_SOUND_EXTRARANGE) part.flags &= ~NODROP - wearer.unEquip(part, TRUE) - part.forceMove(src) + wearer.transfer_item_to(part, src, force = TRUE) if(overslotting_parts[part]) UnregisterSignal(part, COMSIG_ATOM_EXITED) var/obj/item/overslot = overslotting_parts[part] diff --git a/code/modules/mod/mod_control.dm b/code/modules/mod/mod_control.dm index 21b9618c2d4..b907196b880 100644 --- a/code/modules/mod/mod_control.dm +++ b/code/modules/mod/mod_control.dm @@ -276,7 +276,7 @@ to_chat(wearer, "Retract parts first!") playsound(src, 'sound/machines/scanbuzz.ogg', 25, FALSE, SILENCED_SOUND_EXTRARANGE) return - if(!M.unEquip(src, silent = TRUE)) + if(!M.unequip(src, force = TRUE)) return M.put_in_active_hand(src) else diff --git a/code/modules/mod/modules/_modules.dm b/code/modules/mod/modules/_modules.dm index 40b94f0a65e..845c719aaa0 100644 --- a/code/modules/mod/modules/_modules.dm +++ b/code/modules/mod/modules/_modules.dm @@ -148,8 +148,7 @@ to_chat(mod.wearer, "[src] deactivated.") if(device) - mod.wearer.unEquip(device, 1) - device.forceMove(src) + mod.wearer.transfer_item_to(device, src, force = TRUE) UnregisterSignal(mod.wearer, COMSIG_ATOM_EXITED) UnregisterSignal(mod.wearer, COMSIG_MOB_WILLINGLY_DROP) else diff --git a/code/modules/mod/modules/module_pathfinder.dm b/code/modules/mod/modules/module_pathfinder.dm index 020e048bf03..8aada8f4cb8 100644 --- a/code/modules/mod/modules/module_pathfinder.dm +++ b/code/modules/mod/modules/module_pathfinder.dm @@ -51,7 +51,7 @@ if(!ishuman(user)) return var/mob/living/carbon/human/human_user = user - if(human_user.get_item_by_slot(ITEM_SLOT_BACK) && !human_user.unEquip(human_user.get_item_by_slot(ITEM_SLOT_BACK))) + if(human_user.get_item_by_slot(ITEM_SLOT_BACK) && !human_user.drop_item_to_ground(human_user.get_item_by_slot(ITEM_SLOT_BACK))) return if(!human_user.equip_to_slot_if_possible(mod, ITEM_SLOT_BACK, disable_warning = TRUE)) return diff --git a/code/modules/mod/modules/modules_security.dm b/code/modules/mod/modules/modules_security.dm index b8e627f434a..fe07e0cadf4 100644 --- a/code/modules/mod/modules/modules_security.dm +++ b/code/modules/mod/modules/modules_security.dm @@ -31,7 +31,7 @@ return holstered = holding mod.wearer.visible_message("[mod.wearer] holsters [holstered].", "You holster [holstered].") - mod.wearer.unEquip(mod.wearer.get_active_hand()) + mod.wearer.unequip(mod.wearer.get_active_hand()) holstered.forceMove(src) else if(mod.wearer.put_in_active_hand(holstered)) mod.wearer.visible_message("[mod.wearer] draws [msg], ready to shoot!", \ diff --git a/code/modules/newscaster/obj/newscaster.dm b/code/modules/newscaster/obj/newscaster.dm index fdd928b24eb..db044567bed 100644 --- a/code/modules/newscaster/obj/newscaster.dm +++ b/code/modules/newscaster/obj/newscaster.dm @@ -386,7 +386,7 @@ GLOBAL_LIST_EMPTY(allNewscasters) return if(ishuman(usr)) var/obj/item/photo/P = usr.get_active_hand() - if(istype(P) && usr.unEquip(P)) + if(istype(P) && usr.drop_item_to_ground(P)) photo = P P.forceMove(src) usr.visible_message("[usr] inserts [P] into [src]'s photo slot.",\ diff --git a/code/modules/paperwork/clipboard.dm b/code/modules/paperwork/clipboard.dm index e40303fdc71..d0ee8d0d797 100644 --- a/code/modules/paperwork/clipboard.dm +++ b/code/modules/paperwork/clipboard.dm @@ -52,8 +52,7 @@ if(!is_pen(P)) return to_chat(user, "You slide [P] into [src].") - user.unEquip(P) - P.forceMove(src) + user.transfer_item_to(P, src) containedpen = P else if(!containedpen) @@ -96,7 +95,7 @@ /obj/item/clipboard/attackby__legacy__attackchain(obj/item/W, mob/user) if(isPaperwork(W)) //If it's a photo, paper bundle, or piece of paper, place it on the clipboard. - user.unEquip(W) + user.unequip(W) W.forceMove(src) to_chat(user, "You clip [W] onto [src].") playsound(loc, "pageturn", 50, 1) diff --git a/code/modules/paperwork/desk_bell.dm b/code/modules/paperwork/desk_bell.dm index 485d36f6bce..051a175c8e8 100644 --- a/code/modules/paperwork/desk_bell.dm +++ b/code/modules/paperwork/desk_bell.dm @@ -44,8 +44,7 @@ to_chat(user, "There's already a signaller attached!") return var/obj/item/assembly/signaler/signal = I - user.unEquip(signal) - signal.forceMove(src) + user.transfer_item_to(signal, src) attached_signaler = signal if(signal.receiving) RegisterSignal(attached_signaler, COMSIG_ASSEMBLY_PULSED, PROC_REF(on_signal)) @@ -83,7 +82,7 @@ if(over_object == M) if(!remove_item_from_storage(M)) - M.unEquip(src) + M.unequip(src) M.put_in_hands(src) anchored = FALSE diff --git a/code/modules/paperwork/filingcabinet.dm b/code/modules/paperwork/filingcabinet.dm index 0579fa3a8e3..c62730cbde1 100644 --- a/code/modules/paperwork/filingcabinet.dm +++ b/code/modules/paperwork/filingcabinet.dm @@ -126,7 +126,7 @@ /obj/structure/filingcabinet/proc/insert(obj/item/O, mob/user) if(!is_type_in_list(O, accepted_items)) return - if(!user.unEquip(O)) + if(!user.unequip(O)) return to_chat(user, "You put [O.name] in [src].") O.loc = src diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index a34a8b666d3..e80c2475bbe 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -415,38 +415,38 @@ B.name = name else if(P.name != "paper" && P.name != "photo") B.name = P.name - user.unEquip(P) + user.drop_item_to_ground(P) if(ishuman(user)) var/mob/living/carbon/human/h_user = user if(h_user.r_hand == src) - h_user.unEquip(src) + h_user.unequip(src) h_user.put_in_r_hand(B) else if(h_user.l_hand == src) - h_user.unEquip(src) + h_user.unequip(src) h_user.put_in_l_hand(B) else if(h_user.l_store == src) - h_user.unEquip(src) + h_user.unequip(src) B.loc = h_user B.layer = ABOVE_HUD_LAYER B.plane = ABOVE_HUD_PLANE h_user.l_store = B h_user.update_inv_pockets() else if(h_user.r_store == src) - h_user.unEquip(src) + h_user.unequip(src) B.loc = h_user B.layer = ABOVE_HUD_LAYER B.plane = ABOVE_HUD_PLANE h_user.r_store = B h_user.update_inv_pockets() else if(h_user.head == src) - h_user.unEquip(src) + h_user.unequip(src) h_user.put_in_hands(B) else if(!isturf(src.loc)) src.loc = get_turf(h_user) if(h_user.client) h_user.client.screen -= src h_user.put_in_hands(B) to_chat(user, "You clip [P] to [(src.name == "paper") ? "the paper" : src.name].") - src.loc = B + forceMove(B) P.loc = B B.amount++ B.update_icon() @@ -481,7 +481,7 @@ if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites [user.p_themselves()]!", \ "You miss the paper and accidentally light yourself on fire!") - user.unEquip(P) + user.drop_item_to_ground(P) user.adjust_fire_stacks(1) user.IgniteMob() return @@ -489,7 +489,7 @@ if(!Adjacent(user)) //to prevent issues as a result of telepathically lighting a paper return - user.unEquip(src) + user.drop_item_to_ground(src) user.visible_message("[user] lights [src] ablaze with [P]!", "You light [src] on fire!") fire_act() diff --git a/code/modules/paperwork/paper_bundle.dm b/code/modules/paperwork/paper_bundle.dm index b62f8715c26..4a28fcd2c55 100644 --- a/code/modules/paperwork/paper_bundle.dm +++ b/code/modules/paperwork/paper_bundle.dm @@ -40,8 +40,7 @@ if(screen == 2) screen = 1 to_chat(user, "You add [(P.name == "paper") ? "the paper" : P.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].") - user.unEquip(P) - P.loc = src + user.transfer_item_to(P, src) if(ishuman(user)) var/mob/living/carbon/human/H = user H.update_inv_l_hand() @@ -53,14 +52,12 @@ if(screen == 2) screen = 1 to_chat(user, "You add [(W.name == "photo") ? "the photo" : W.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].") - user.unEquip(W) - W.loc = src + user.transfer_item_to(W, src) else if(W.get_heat()) burnpaper(W, user) else if(istype(W, /obj/item/paper_bundle)) - user.unEquip(W) for(var/obj/O in W) O.loc = src O.add_fingerprint(usr) @@ -91,8 +88,6 @@ user.visible_message("[user] burns right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.", \ "You burn right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.") - user.unEquip(src) - new /obj/effect/decal/cleanable/ash(get_turf(src)) qdel(src) @@ -168,7 +163,7 @@ to_chat(usr, "You remove [W] from the bundle.") if(amount == 1) var/obj/item/paper/P = get_page(1) - usr.unEquip(src) + usr.unequip(src) usr.put_in_hands(P) usr.unset_machine() // Ensure the bundle GCs for(var/obj/O in src) // just in case we somehow lose something (it's happened, especially with photos) @@ -219,7 +214,6 @@ O.plane = initial(O.plane) O.add_fingerprint(user) - user.unEquip(src) qdel(src) /obj/item/paper_bundle/update_desc() diff --git a/code/modules/paperwork/paperbin.dm b/code/modules/paperwork/paperbin.dm index 1e4a1f619a9..ff33bdb7266 100644 --- a/code/modules/paperwork/paperbin.dm +++ b/code/modules/paperwork/paperbin.dm @@ -37,18 +37,18 @@ if(over_object == M) if(!remove_item_from_storage(M)) - M.unEquip(src) + M.drop_item_to_ground(src) M.put_in_hands(src) else if(is_screen_atom(over_object)) switch(over_object.name) if("r_hand") if(!remove_item_from_storage(M)) - M.unEquip(src) + M.drop_item_to_ground(src) M.put_in_r_hand(src) if("l_hand") if(!remove_item_from_storage(M)) - M.unEquip(src) + M.drop_item_to_ground(src) M.put_in_l_hand(src) add_fingerprint(M) diff --git a/code/modules/paperwork/paperplane.dm b/code/modules/paperwork/paperplane.dm index 110dee4fc6f..a22fd573a05 100644 --- a/code/modules/paperwork/paperplane.dm +++ b/code/modules/paperwork/paperplane.dm @@ -74,14 +74,14 @@ if(HAS_TRAIT(user, TRAIT_CLUMSY) && prob(10)) user.visible_message("[user] accidentally ignites [user.p_themselves()]!", \ "You miss [src] and accidentally light yourself on fire!") - user.unEquip(P) + user.drop_item_to_ground(P) user.adjust_fire_stacks(1) user.IgniteMob() return if(!in_range(user, src)) //to prevent issues as a result of telepathically lighting a paper return - user.unEquip(src) + user.drop_item_to_ground(src) user.visible_message("[user] lights [src] on fire with [P]!", "You lights [src] on fire!") fire_act() @@ -113,7 +113,7 @@ if((!in_range(src, user)) || user.stat || user.restrained()) return to_chat(user, "You fold [src] into the shape of a plane!") - user.unEquip(src) + user.unequip(src) // forceMove happens in paperplane/Initialize I = new /obj/item/paperplane(user, src) user.put_in_hands(I) else diff --git a/code/modules/paperwork/photography.dm b/code/modules/paperwork/photography.dm index 683d93a34d1..2be2875a3de 100644 --- a/code/modules/paperwork/photography.dm +++ b/code/modules/paperwork/photography.dm @@ -74,7 +74,7 @@ "You burn right through [src], turning it to ash. It flutters through the air before settling on the floor in a heap.") if(user.is_in_inactive_hand(src)) - user.unEquip(src) + user.unequip(src) new /obj/effect/decal/cleanable/ash(get_turf(src)) qdel(src) @@ -149,10 +149,10 @@ if((!M.restrained() && !M.stat && M.back == src)) switch(over_object.name) if("r_hand") - M.unEquip(src) + M.unequip(src) M.put_in_r_hand(src) if("l_hand") - M.unEquip(src) + M.unequip(src) M.put_in_l_hand(src) add_fingerprint(usr) return diff --git a/code/modules/projectiles/ammunition/ammo_casings.dm b/code/modules/projectiles/ammunition/ammo_casings.dm index 8450f9fb94a..4f7b280c931 100644 --- a/code/modules/projectiles/ammunition/ammo_casings.dm +++ b/code/modules/projectiles/ammunition/ammo_casings.dm @@ -424,7 +424,7 @@ ..() var/obj/item/projectile/bullet/reusable/foam_dart/FD = BB if((is_pen(A)) && modified && !FD.pen) - if(!user.unEquip(A)) + if(!user.unequip(A)) // forceMove happens in add_pen return add_pen(A) to_chat(user, "You insert [A] into [src].") diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index af858679316..7e5e86a7e4d 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -349,14 +349,13 @@ var/obj/item/flashlight/seclite/S = I if(can_flashlight) if(!gun_light) - if(!user.unEquip(I)) + if(!user.transfer_item_to(I, src)) return to_chat(user, "You click [S] into place on [src].") playsound(src, 'sound/machines/click.ogg', 50, TRUE) if(S.on) set_light(0) gun_light = S - I.loc = src update_icon() update_gun_light(user) var/datum/action/A = new /datum/action/item_action/toggle_gunlight(src) diff --git a/code/modules/projectiles/guns/chaos_bolt.dm b/code/modules/projectiles/guns/chaos_bolt.dm index cd197bd8275..e53e3510ada 100644 --- a/code/modules/projectiles/guns/chaos_bolt.dm +++ b/code/modules/projectiles/guns/chaos_bolt.dm @@ -122,7 +122,7 @@ H.makeCluwne() if("spaced") for(var/obj/item/I in H) - H.unEquip(I, TRUE) + H.drop_item_to_ground(I, force = TRUE) var/turf/T = safepick(get_area_turfs(/area/space/nearstation)) //Send in space next to the station if(!T) //Shouldn't happen but just in case T = safepick(get_area_turfs(/area/space)) diff --git a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm index 7b1bc71c353..e083ad2b2da 100644 --- a/code/modules/projectiles/guns/energy/kinetic_accelerator.dm +++ b/code/modules/projectiles/guns/energy/kinetic_accelerator.dm @@ -343,7 +343,7 @@ if(.) to_chat(user, "You install the modkit.") playsound(loc, usesound, 100, 1) - user.unEquip(src) + user.unequip(src) forceMove(KA) KA.modkits += src else diff --git a/code/modules/projectiles/guns/energy/special_eguns.dm b/code/modules/projectiles/guns/energy/special_eguns.dm index 46c042baf83..252465c2c8d 100644 --- a/code/modules/projectiles/guns/energy/special_eguns.dm +++ b/code/modules/projectiles/guns/energy/special_eguns.dm @@ -1036,7 +1036,7 @@ user.flash_eyes(2, TRUE) do_sparks(rand(5, 9), FALSE, src) playsound(src, 'sound/effects/bang.ogg', 100, TRUE) - user.unEquip(src) + user.drop_item_to_ground(src) cell.charge = 0 //ha ha you lose update_icon() return diff --git a/code/modules/projectiles/guns/grenade_launcher.dm b/code/modules/projectiles/guns/grenade_launcher.dm index d4e589948b2..1dfaf4d6327 100644 --- a/code/modules/projectiles/guns/grenade_launcher.dm +++ b/code/modules/projectiles/guns/grenade_launcher.dm @@ -21,9 +21,9 @@ /obj/item/gun/grenadelauncher/attackby__legacy__attackchain(obj/item/I as obj, mob/user as mob, params) if((istype(I, /obj/item/grenade))) if(length(grenades) < max_grenades) - if(!user.unEquip(I)) + if(!user.unequip(I)) return - I.loc = src + I.forceMove(src) grenades += I to_chat(user, "You put the grenade in [src].") to_chat(user, "[length(grenades)] / [max_grenades] grenades.") diff --git a/code/modules/projectiles/guns/projectile/automatic.dm b/code/modules/projectiles/guns/projectile/automatic.dm index e02773310a2..65ac020b713 100644 --- a/code/modules/projectiles/guns/projectile/automatic.dm +++ b/code/modules/projectiles/guns/projectile/automatic.dm @@ -50,7 +50,7 @@ to_chat(user, "You insert the magazine into \the [src].") if(alarmed) alarmed = 0 - user.remove_from_mob(AM) + user.unequip(AM) magazine = AM magazine.loc = src chamber_round() diff --git a/code/modules/projectiles/guns/projectile_gun.dm b/code/modules/projectiles/guns/projectile_gun.dm index db7d318597f..15598f32a2e 100644 --- a/code/modules/projectiles/guns/projectile_gun.dm +++ b/code/modules/projectiles/guns/projectile_gun.dm @@ -79,7 +79,7 @@ return !magazine /obj/item/gun/projectile/proc/reload(obj/item/ammo_box/magazine/AM, mob/user) - user.remove_from_mob(AM) + user.unequip(AM) magazine = AM magazine.forceMove(src) if(w_class >= WEIGHT_CLASS_NORMAL && !suppressed) @@ -123,8 +123,9 @@ var/obj/item/suppressor/S = A if(can_suppress) if(!suppressed) - if(!user.unEquip(A)) + if(!user.unequip(A)) return + A.forceMove(src) to_chat(user, "You screw [S] onto [src].") playsound(src, 'sound/items/screwdriver.ogg', 40, 1) suppressed = A diff --git a/code/modules/projectiles/guns/rocket.dm b/code/modules/projectiles/guns/rocket.dm index b67fbe18eec..25af9683562 100644 --- a/code/modules/projectiles/guns/rocket.dm +++ b/code/modules/projectiles/guns/rocket.dm @@ -30,8 +30,7 @@ if(!istype(I, /obj/item/ammo_casing/rocket)) return ..() if(!chambered) - user.unEquip(I) - I.forceMove(src) + user.transfer_item_to(I, src) chambered = I to_chat(user, "You put the rocket in [src].") else diff --git a/code/modules/projectiles/guns/syringe_gun.dm b/code/modules/projectiles/guns/syringe_gun.dm index 7f44b91ae15..9378ba49626 100644 --- a/code/modules/projectiles/guns/syringe_gun.dm +++ b/code/modules/projectiles/guns/syringe_gun.dm @@ -73,13 +73,13 @@ return var/in_clip = length(syringes) + (chambered.BB ? 1 : 0) if(in_clip < max_syringes) - if(!user.unEquip(A)) + if(user.transfer_item_to(A, src)) + to_chat(user, "You load [A] into [src]!") + syringes.Add(A) + process_chamber() // Chamber the syringe if none is already + return TRUE + else return - to_chat(user, "You load [A] into [src]!") - syringes.Add(A) - A.loc = src - process_chamber() // Chamber the syringe if none is already - return TRUE else to_chat(user, "[src] cannot hold more syringes.") else if(istype(A, /obj/item/dnainjector)) @@ -170,7 +170,7 @@ return FALSE if(user) - if(!user.unEquip(new_syringe)) + if(!user.drop_item_to_ground(new_syringe)) return to_chat(user, "You load \the [new_syringe] into [src].") playsound(src, 'sound/weapons/gun_interactions/bulletinsert.ogg', 50, 1) diff --git a/code/modules/projectiles/projectile/magic_projectiles.dm b/code/modules/projectiles/projectile/magic_projectiles.dm index 7f06491c7e9..4f9cca59c05 100644 --- a/code/modules/projectiles/projectile/magic_projectiles.dm +++ b/code/modules/projectiles/projectile/magic_projectiles.dm @@ -269,7 +269,7 @@ GLOBAL_LIST_INIT(wabbajack_docile_animals, list( for(var/i in H.internal_organs) qdel(i) for(var/obj/item/W in M) - M.unEquip(W, 1) + M.unequip(W, force = TRUE) qdel(W) var/mob/living/new_mob diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index f23b282bfb7..c96ea19803e 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -579,9 +579,8 @@ if(C.maxcharge < 100) to_chat(user, "[src] requires a higher capacity cell.") return - if(!user.unEquip(W)) + if(!user.transfer_item_to(W, src)) return - W.loc = src cell = W to_chat(user, "You install a cell in [src].") update_icon(UPDATE_OVERLAYS) diff --git a/code/modules/reagents/chemistry/reagents/misc_reagents.dm b/code/modules/reagents/chemistry/reagents/misc_reagents.dm index afe91fec8b6..f39583d7136 100644 --- a/code/modules/reagents/chemistry/reagents/misc_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/misc_reagents.dm @@ -395,7 +395,7 @@ H.update_fhair() if(!H.wear_mask || H.wear_mask && !istype(H.wear_mask, /obj/item/clothing/mask/fakemoustache)) if(H.wear_mask) - H.unEquip(H.wear_mask) + H.drop_item_to_ground(H.wear_mask) var/obj/item/clothing/mask/fakemoustache = new /obj/item/clothing/mask/fakemoustache H.equip_to_slot(fakemoustache, ITEM_SLOT_MASK) to_chat(H, "Hair bursts forth from your every follicle!") diff --git a/code/modules/reagents/reagent_containers/glass_containers.dm b/code/modules/reagents/reagent_containers/glass_containers.dm index f80992e0347..41feae4ddfe 100644 --- a/code/modules/reagents/reagent_containers/glass_containers.dm +++ b/code/modules/reagents/reagent_containers/glass_containers.dm @@ -341,7 +341,7 @@ to_chat(user, "You add [D] to [src].") qdel(D) user.put_in_hands(new /obj/item/bucket_sensor) - user.unEquip(src) + user.unequip(src) qdel(src) else ..() diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 2ac19610aab..ddc87780cbc 100644 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -426,8 +426,7 @@ to_chat(user, "[O] is too large to fit in [src].") else wrapped = O - user.unEquip(O) - O.forceMove(src) + user.transfer_item_to(O, src) O.add_fingerprint(usr) add_fingerprint(usr) to_chat(user, "You put [O] in [src].") @@ -436,7 +435,7 @@ if(sealed) to_chat(user, "You tear open [src], dropping the contents onto the floor.") playsound(loc, 'sound/items/poster_ripped.ogg', 50, 1) - user.unEquip(src) + user.unequip(src) wrapped.forceMove(get_turf(user)) wrapped = null qdel(src) @@ -455,7 +454,7 @@ if(tgui_alert(user, "Do you want to tear up the package?", "Shipping", list("Yes", "No")) == "Yes") to_chat(user, "You shred [src].") playsound(loc, 'sound/items/poster_ripped.ogg', 50, 1) - user.unEquip(src) + user.drop_item_to_ground(src) qdel(src) /obj/item/shipping_package/update_desc() diff --git a/code/modules/research/backup_console.dm b/code/modules/research/backup_console.dm index 15a6a52011e..8a14054b344 100644 --- a/code/modules/research/backup_console.dm +++ b/code/modules/research/backup_console.dm @@ -41,7 +41,7 @@ /obj/machinery/computer/rnd_backup/attackby__legacy__attackchain(obj/item/O, mob/user, params) if(istype(O, /obj/item/disk/rnd_backup_disk) && istype(user, /mob/living/carbon/human)) var/mob/living/carbon/human/H = user - if(!H.unEquip(O)) + if(!H.drop_item_to_ground(O)) return TRUE O.forceMove(src) diff --git a/code/modules/ruins/lavalandruin_code/ash_walker_den.dm b/code/modules/ruins/lavalandruin_code/ash_walker_den.dm index 5620da3ccbb..1e20e885347 100644 --- a/code/modules/ruins/lavalandruin_code/ash_walker_den.dm +++ b/code/modules/ruins/lavalandruin_code/ash_walker_den.dm @@ -39,7 +39,7 @@ visible_message("Serrated tendrils eagerly pull [H] to [src], tearing the body apart as its blood seeps over the eggs.") playsound(get_turf(src),'sound/magic/demon_consume.ogg', 100, 1) for(var/obj/item/W in H) - if(!H.unEquip(W)) + if(!H.drop_item_to_ground(W)) qdel(W) if(ismegafauna(H)) meat_counter += 20 diff --git a/code/modules/surgery/limb_reattach.dm b/code/modules/surgery/limb_reattach.dm index bc94b93dccb..04dab5fb080 100644 --- a/code/modules/surgery/limb_reattach.dm +++ b/code/modules/surgery/limb_reattach.dm @@ -151,7 +151,7 @@ return TRUE /datum/surgery_step/limb/attach/proc/attach_limb(mob/living/user, mob/living/carbon/human/target, obj/item/organ/external/E) - user.unEquip(E) + user.drop_item_to_ground(E) E.replaced(target) if(!E.is_robotic()) E.properly_attached = FALSE diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index ede59565f2b..03738d2aa37 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -94,8 +94,7 @@ var/obj/item/flash/F = holder F.set_light(0) - owner.unEquip(holder, 1) - holder.forceMove(src) + owner.transfer_item_to(holder, src, force = TRUE) holder = null playsound(get_turf(owner), 'sound/mecha/mechmove03.ogg', 50, 1) @@ -125,7 +124,7 @@ var/obj/item/offhand_arm_item = owner.get_active_hand() to_chat(owner, "Your hands are too encumbered wielding [offhand_arm_item] to deploy [src]!") return - else if(!owner.unEquip(arm_item)) + else if(!owner.drop_item_to_ground(arm_item)) to_chat(owner, "Your [arm_item] interferes with [src]!") return else diff --git a/code/modules/surgery/organs/organ_external.dm b/code/modules/surgery/organs/organ_external.dm index 0cdb6f6ce4e..36c4b86aaf9 100644 --- a/code/modules/surgery/organs/organ_external.dm +++ b/code/modules/surgery/organs/organ_external.dm @@ -171,7 +171,7 @@ return ..() var/mob/living/carbon/human/C = M if(is_robotic() && HAS_TRAIT(C, TRAIT_IPC_JOINTS_MAG) && isnull(C.bodyparts_by_name[limb_name])) - user.unEquip(src) + user.drop_item_to_ground(src) replaced(C) C.update_body() C.updatehealth() @@ -749,12 +749,12 @@ Note that amputating the affected organ does in fact remove the infection from t holder.visible_message(\ "\The [holder.handcuffed.name] falls off of [holder.name].",\ "\The [holder.handcuffed.name] falls off you.") - holder.unEquip(holder.handcuffed) + holder.drop_item_to_ground(holder.handcuffed) if(holder.legcuffed && (body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT))) holder.visible_message(\ "\The [holder.legcuffed.name] falls off of [holder.name].",\ "\The [holder.legcuffed.name] falls off you.") - holder.unEquip(holder.legcuffed) + holder.drop_item_to_ground(holder.legcuffed) /obj/item/organ/external/proc/fracture(silent = FALSE) if(is_robotic()) diff --git a/code/modules/surgery/organs/organ_extractor.dm b/code/modules/surgery/organs/organ_extractor.dm index 4d8229d2fc5..6f1bc9fabd8 100644 --- a/code/modules/surgery/organs/organ_extractor.dm +++ b/code/modules/surgery/organs/organ_extractor.dm @@ -182,7 +182,7 @@ /obj/item/organ_extractor/abductor/attackby__legacy__attackchain(obj/item/I, mob/user, params) . = ..() if(istype(I, /obj/item/organ/internal) && !storedorgan) - user.unEquip(I) + user.unequip(I) insert_internal_organ_in_extractor(I) /obj/item/organ_extractor/abductor/emp_act(severity) diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 22e2af8356a..e6cf100cf1f 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -319,7 +319,7 @@ var/mob/living/carbon/human/H = owner if(isobj(H.shoes)) var/thingy = H.shoes - if(H.unEquip(H.shoes)) + if(H.drop_item_to_ground(H.shoes)) walk_away(thingy,H,15,2) spawn(20) if(thingy) diff --git a/code/modules/surgery/organs/subtypes/skrell_organs.dm b/code/modules/surgery/organs/subtypes/skrell_organs.dm index 73c4d3bcad7..e5e0fd4bcd7 100644 --- a/code/modules/surgery/organs/subtypes/skrell_organs.dm +++ b/code/modules/surgery/organs/subtypes/skrell_organs.dm @@ -52,7 +52,7 @@ if(I.w_class > WEIGHT_CLASS_SMALL) to_chat(owner, "[I] is too large to fit in your [name].") return - if(owner.unEquip(I)) + if(owner.unequip(I)) owner.visible_message("[owner] places [I] into [owner.p_their()] [name].", "You place [I] into your [name].") I.forceMove(src) held_item = I diff --git a/code/modules/surgery/organs/subtypes/standard_organs.dm b/code/modules/surgery/organs/subtypes/standard_organs.dm index a8f5ab690fb..83073b689fc 100644 --- a/code/modules/surgery/organs/subtypes/standard_organs.dm +++ b/code/modules/surgery/organs/subtypes/standard_organs.dm @@ -61,7 +61,7 @@ return var/hand = (body_part == ARM_LEFT) ? owner.l_hand : owner.r_hand if(hand && owner.canUnEquip(hand)) - owner.unEquip(hand) + owner.drop_item_to_ground(hand) to_chat(owner, "Your [name] malfunctions, dropping what it was holding!") owner.custom_emote(EMOTE_VISIBLE, "drops what [owner.p_they()] [owner.p_were()] holding, [owner.p_their()] [name] malfunctioning!") @@ -144,7 +144,8 @@ owner.AdjustWeakened(4 SECONDS) /obj/item/organ/external/foot/remove() - if(owner && owner.shoes) owner.unEquip(owner.shoes) + if(owner && owner.shoes) + owner.drop_item_to_ground(owner.shoes) . = ..() /obj/item/organ/external/foot/right @@ -175,7 +176,7 @@ return var/hand = (body_part == HAND_LEFT) ? owner.l_hand : owner.r_hand if(hand && owner.canUnEquip(hand)) - owner.unEquip(hand) + owner.drop_item_to_ground(hand) to_chat(owner, "Your [name] malfunctions, dropping what it was holding!") owner.custom_emote(EMOTE_VISIBLE, "drops what [owner.p_they()] [owner.p_were()] holding, [owner.p_their()] [name] malfunctioning!") @@ -183,11 +184,11 @@ if(owner) update_hand_missing() if(owner.gloves) - owner.unEquip(owner.gloves) + owner.drop_item_to_ground(owner.gloves) if(owner.l_hand && (body_part == HAND_LEFT)) - owner.unEquip(owner.l_hand, TRUE) + owner.drop_item_to_ground(owner.l_hand, force = TRUE) if(owner.r_hand && (body_part == HAND_RIGHT)) - owner.unEquip(owner.r_hand, TRUE) + owner.drop_item_to_ground(owner.r_hand, force = TRUE) . = ..() @@ -274,15 +275,15 @@ dna = owner.dna.Clone() name = "[dna.real_name]'s head" if(owner.glasses) - owner.unEquip(owner.glasses, force = TRUE) + owner.drop_item_to_ground(owner.glasses, force = TRUE) if(owner.head) - owner.unEquip(owner.head, force = TRUE) + owner.drop_item_to_ground(owner.head, force = TRUE) if(owner.l_ear) - owner.unEquip(owner.l_ear, force = TRUE) + owner.drop_item_to_ground(owner.l_ear, force = TRUE) if(owner.r_ear) - owner.unEquip(owner.r_ear, force = TRUE) + owner.drop_item_to_ground(owner.r_ear, force = TRUE) if(owner.wear_mask) - owner.unEquip(owner.wear_mask, force = TRUE) + owner.drop_item_to_ground(owner.wear_mask, force = TRUE) owner.update_hair() owner.update_fhair() owner.update_head_accessory() diff --git a/code/modules/surgery/robotics.dm b/code/modules/surgery/robotics.dm index cd4a2d383d7..0e3f4a12a29 100644 --- a/code/modules/surgery/robotics.dm +++ b/code/modules/surgery/robotics.dm @@ -613,7 +613,7 @@ var/obj/item/mmi/M = tool - user.unEquip(tool) + user.drop_item_to_ground(tool) M.attempt_become_organ(affected,target) return ..() diff --git a/code/modules/telesci/telesci_computer.dm b/code/modules/telesci/telesci_computer.dm index 8e3d33310f7..58705443086 100644 --- a/code/modules/telesci/telesci_computer.dm +++ b/code/modules/telesci/telesci_computer.dm @@ -75,8 +75,7 @@ else if(istype(W, /obj/item/gps)) if(!inserted_gps) inserted_gps = W - user.unEquip(W) - W.forceMove(src) + user.transfer_item_to(W, src) user.visible_message("[user] inserts [W] into [src]'s GPS device slot.") SStgui.update_uis(src)