diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index 400bf051ad3..b12602ccb26 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -379,7 +379,8 @@ if(!usr.stat && isturf(usr.loc) && !usr.restrained()) usr:toggle_throw_mode() if("drop") - usr.drop_item_v() + if(usr.client) + usr.client.drop_item() if("module") if(isrobot(usr)) @@ -429,7 +430,7 @@ if("Allow Walking") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetMove() @@ -438,7 +439,7 @@ if("Disallow Walking") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetMove() @@ -447,7 +448,7 @@ if("Allow Running") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetRun() @@ -456,7 +457,7 @@ if("Disallow Running") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetRun() @@ -465,7 +466,7 @@ if("Allow Item Use") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetClick() @@ -475,7 +476,7 @@ if("Disallow Item Use") if(gun_click_time > world.time - 30) //give them 3 seconds between mode changes. return - if(!istype(usr.equipped(),/obj/item/weapon/gun)) + if(!istype(usr.get_active_hand(),/obj/item/weapon/gun)) usr << "You need your gun in your active hand to do that!" return usr.client.AllowTargetClick() diff --git a/code/game/gamemodes/revolution/rp-revolution.dm b/code/game/gamemodes/revolution/rp-revolution.dm index 815b3be3cb3..242f6b1d529 100644 --- a/code/game/gamemodes/revolution/rp-revolution.dm +++ b/code/game/gamemodes/revolution/rp-revolution.dm @@ -151,9 +151,9 @@ // spawn (100) // if (rev_mob.r_store) -// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store) +// rev_mob.equip_to_slot_or_del(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_l_store) // if (rev_mob.l_store) -// rev_mob.equip_if_possible(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store) +// rev_mob.equip_to_slot_or_del(new /obj/item/weapon/paper/communist_manifesto(rev_mob), rev_mob.slot_r_store) /datum/game_mode/rp_revolution/check_win() diff --git a/code/game/machinery/kitchen/juicer.dm b/code/game/machinery/kitchen/juicer.dm index a5a15fb8767..6a116237f33 100644 --- a/code/game/machinery/kitchen/juicer.dm +++ b/code/game/machinery/kitchen/juicer.dm @@ -38,7 +38,7 @@ if (beaker) return 1 else - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src beaker = O src.verbs += /obj/machinery/juicer/verb/detach @@ -48,7 +48,7 @@ if (!is_type_in_list(O, allowed_items)) user << "It looks as not containing any juice." return 1 - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src src.updateUsrDialog() return 0 diff --git a/code/game/machinery/kitchen/microwave.dm b/code/game/machinery/kitchen/microwave.dm index 4af48a539b4..bec0006de95 100644 --- a/code/game/machinery/kitchen/microwave.dm +++ b/code/game/machinery/kitchen/microwave.dm @@ -112,7 +112,7 @@ "\blue [user] has added one of [O] to \the [src].", \ "\blue You add one of [O] to \the [src].") else - // user.before_take_item(O) //This just causes problems so far as I can tell. -Pete + // user.remove_from_mob(O) //This just causes problems so far as I can tell. -Pete user.drop_item() O.loc = src user.visible_message( \ diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm index 52ca3debd9b..15f76f191fd 100644 --- a/code/game/machinery/kitchen/smartfridge.dm +++ b/code/game/machinery/kitchen/smartfridge.dm @@ -169,7 +169,7 @@ user << "\The [src] is full." return 1 else - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src if(item_quants[O.name]) item_quants[O.name]++ diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 25461eae377..065d7dd969e 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -110,7 +110,7 @@ B.loc = get_turf(src) user << "You armed the robot frame." if (user.get_inactive_hand()==src) - user.before_take_item(src) + user.remove_from_mob(src) user.put_in_inactive_hand(B) del(src) else diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 69b6e97533e..cd133ff8e31 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -177,7 +177,7 @@ spawn(0) //delete the empty stack once the current context yields if (amount <= 0) //check again in case someone transferred stuff to us if(usr) - usr.before_take_item(src) + usr.remove_from_mob(src) del(src) return 1 diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm index 02d50e0d267..3f2bbb18265 100644 --- a/code/game/objects/items/weapons/tanks/tank_types.dm +++ b/code/game/objects/items/weapons/tanks/tank_types.dm @@ -103,7 +103,7 @@ if ((!F.status)||(F.ptank)) return src.master = F F.ptank = src - user.before_take_item(src) + user.remove_from_mob(src) src.loc = F return diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm index 40ba963efd0..44bf1ace10f 100644 --- a/code/game/objects/structures/extinguisher.dm +++ b/code/game/objects/structures/extinguisher.dm @@ -17,7 +17,7 @@ return if(istype(O, /obj/item/weapon/extinguisher)) if(!has_extinguisher && opened) - user.drop_item(O) + user.remove_from_mob(O) contents += O has_extinguisher = O user << "You place [O] in [src]." diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm index bf80024a5e2..fa45f657369 100644 --- a/code/game/objects/structures/target_stake.dm +++ b/code/game/objects/structures/target_stake.dm @@ -26,7 +26,7 @@ if(istype(W, /obj/item/target)) density = 0 W.density = 1 - user.drop_item(src) + user.remove_from_mob(W) W.loc = loc W.layer = 3.1 pinned_target = W diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 62facb8e4de..a74bd90f293 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -456,7 +456,7 @@ turf/simulated/floor/proc/update_icon() if(istype(C,/obj/item/weapon/light/bulb)) //only for light tiles if(is_light_floor()) if(get_lightfloor_state()) - user.drop_item(C) + user.remove_from_mob(C) del(C) set_lightfloor_state(0) //fixing it by bashing it with a light bulb, fun eh? update_icon() diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 71d50c1e8b6..9b3d757691e 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -736,19 +736,19 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_syndicate_commando() if("nanotrasen representative") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom(M), slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/laceup(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/white(M), slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/hop(M), slot_l_ear) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/hop(M), slot_l_ear) var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "NanoTrasen Navy Representative" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, slot_r_store) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/clipboard(M), slot_belt) + M.equip_to_slot_or_del(pda, slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/clipboard(M), slot_belt) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -758,23 +758,23 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += list("VIP Guest","Custodian","Thunderdome Overseer","Intel Officer","Medical Officer","Death Commando","Research Officer") W.assignment = "NanoTrasen Navy Representative" W.registered_name = M.real_name - M.equip_if_possible(W, slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("nanotrasen officer") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/laceup(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/white(M), slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear) - M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear) + M.equip_to_slot_or_del(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head) var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "NanoTrasen Navy Officer" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, slot_r_store) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/gun/energy(M), slot_belt) + M.equip_to_slot_or_del(pda, slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy(M), slot_belt) var/obj/item/weapon/card/id/centcom/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -782,24 +782,24 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += get_all_centcom_access() W.assignment = "NanoTrasen Navy Officer" W.registered_name = M.real_name - M.equip_if_possible(W, slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("nanotrasen captain") - M.equip_if_possible(new /obj/item/clothing/under/rank/centcom_captain(M), slot_w_uniform) - M.equip_if_possible(new /obj/item/clothing/shoes/laceup(M), slot_shoes) - M.equip_if_possible(new /obj/item/clothing/gloves/white(M), slot_gloves) - M.equip_if_possible(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear) - M.equip_if_possible(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head) + M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_captain(M), slot_w_uniform) + M.equip_to_slot_or_del(new /obj/item/clothing/shoes/laceup(M), slot_shoes) + M.equip_to_slot_or_del(new /obj/item/clothing/gloves/white(M), slot_gloves) + M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear) + M.equip_to_slot_or_del(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head) var/obj/item/device/pda/heads/pda = new(M) pda.owner = M.real_name pda.ownjob = "NanoTrasen Navy Captain" pda.name = "PDA-[M.real_name] ([pda.ownjob])" - M.equip_if_possible(pda, slot_r_store) - M.equip_if_possible(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) - M.equip_if_possible(new /obj/item/weapon/gun/energy(M), slot_belt) + M.equip_to_slot_or_del(pda, slot_r_store) + M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store) + M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy(M), slot_belt) var/obj/item/weapon/card/id/centcom/W = new(M) W.name = "[M.real_name]'s ID Card" @@ -807,7 +807,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that W.access += get_all_centcom_access() W.assignment = "NanoTrasen Navy Captain" W.registered_name = M.real_name - M.equip_if_possible(W, slot_wear_id) + M.equip_to_slot_or_del(W, slot_wear_id) if("emergency response team") M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform) diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm index 38f50bf742b..8d575538a45 100644 --- a/code/modules/customitems/item_spawning.dm +++ b/code/modules/customitems/item_spawning.dm @@ -60,7 +60,7 @@ //replace old ID del(C) - ok = M.equip_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail + ok = M.equip_to_slot_if_possible(I, slot_wear_id, 0) //if 1, last argument deletes on fail break else if(istype(Item,/obj/item/weapon/storage/belt)) if(M.ckey == "jakksergal" && M.real_name == "Nashi Ra'hal" && M.mind.role_alt_title && M.mind.role_alt_title != "Nurse" && M.mind.role_alt_title != "Chemist") @@ -72,13 +72,13 @@ for(var/obj/item/weapon/storage/belt/B in M) del(B) M.belt=null - ok = M.equip_if_possible(I, slot_belt, 0) + ok = M.equip_to_slot_if_possible(I, slot_belt, 0) break if(istype(M.belt,/obj/item/device/pda)) for(var/obj/item/device/pda/Pda in M) M.belt=null - M.equip_if_possible(Pda, slot_l_store, 0) - ok = M.equip_if_possible(I, slot_belt, 0) + M.equip_to_slot_if_possible(Pda, slot_l_store, 0) + ok = M.equip_to_slot_if_possible(I, slot_belt, 0) else if(istype(M.back,/obj/item/weapon/storage) && M.back:contents.len < M.back:storage_slots) // Try to place it in something on the mob's back Item.loc = M.back ok = 1 diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 263f797a95d..119c49fe41a 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -36,7 +36,7 @@ if(beaker) user << "\red The biogenerator is already loaded." else - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src beaker = O updateUsrDialog() @@ -68,7 +68,7 @@ if(i >= 10) user << "\red The biogenerator is full! Activate it." else - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src user << "\blue You put [O.name] in [src.name]" update_icon() diff --git a/code/modules/hydroponics/hydro_tray.dm b/code/modules/hydroponics/hydro_tray.dm index eafff17b073..9ef693a94de 100644 --- a/code/modules/hydroponics/hydro_tray.dm +++ b/code/modules/hydroponics/hydro_tray.dm @@ -633,7 +633,7 @@ if(!seed) var/obj/item/seeds/S = O - user.drop_item(O) + user.remove_from_mob(O) if(!S.seed) user << "The packet seems to be empty. You throw it away." @@ -691,7 +691,7 @@ else if ( istype(O, /obj/item/weapon/plantspray) ) var/obj/item/weapon/plantspray/spray = O - user.drop_item(O) + user.remove_from_mob(O) toxins += spray.toxicity pestlevel -= spray.pest_kill_str weedlevel -= spray.weed_kill_str diff --git a/code/modules/hydroponics/seed_machines.dm b/code/modules/hydroponics/seed_machines.dm index 8b4295d72be..1b5034f4170 100644 --- a/code/modules/hydroponics/seed_machines.dm +++ b/code/modules/hydroponics/seed_machines.dm @@ -88,7 +88,7 @@ if(S.seed && S.seed.immutable > 0) user << "That seed is not compatible with our genetics technology." else - user.drop_item(W) + user.remove_from_mob(W) W.loc = src seed = W user << "You load [W] into [src]." @@ -120,7 +120,7 @@ user << "That disk does not have any gene data loaded." return - user.drop_item(W) + user.remove_from_mob(W) W.loc = src loaded_disk = W user << "You load [W] into [src]." diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 303f1665de7..34423228f44 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -143,13 +143,6 @@ var/list/slot_equipment_priority = list( \ W.dropped() return 0 - - -/mob/proc/drop_item_v() //this is dumb. - if(stat == CONSCIOUS && isturf(loc)) - return drop_item() - return 0 - // Removes an item from inventory and places it in the target atom /mob/proc/drop_from_inventory(var/obj/item/W, var/atom/Target = null) if(W) @@ -166,64 +159,17 @@ var/list/slot_equipment_priority = list( \ //Drops the item in our left hand /mob/proc/drop_l_hand(var/atom/Target) - if(l_hand) - if(client) client.screen -= l_hand - l_hand.layer = initial(l_hand.layer) - - if(Target) l_hand.loc = Target.loc - else l_hand.loc = loc - - var/turf/T = get_turf(loc) - if(isturf(T)) - T.Entered(l_hand) - - l_hand.dropped(src) - l_hand = null - update_inv_l_hand() - return 1 - return 0 + return drop_from_inventory(l_hand, Target) //Drops the item in our right hand /mob/proc/drop_r_hand(var/atom/Target) - if(r_hand) - if(client) client.screen -= r_hand - r_hand.layer = initial(r_hand.layer) - - if(Target) r_hand.loc = Target.loc - else r_hand.loc = loc - - var/turf/T = get_turf(Target) - if(istype(T)) - T.Entered(r_hand) - - r_hand.dropped(src) - r_hand = null - update_inv_r_hand() - return 1 - return 0 + return drop_from_inventory(r_hand, Target) //Drops the item in our active hand. /mob/proc/drop_item(var/atom/Target) if(hand) return drop_l_hand(Target) else return drop_r_hand(Target) - - - - - - - - -//TODO: phase out this proc -/mob/proc/before_take_item(var/obj/item/W) //TODO: what is this? - W.loc = null - W.layer = initial(W.layer) - u_equip(W) - update_icons() - return - - //Removes the object from any slots the mob might have, calling the appropriate icon update proc. //Does nothing else. //DO NOT CALL THIS PROC DIRECTLY. It is meant to be called only by other inventory procs. @@ -244,34 +190,18 @@ var/list/slot_equipment_priority = list( \ update_inv_wear_mask(0) return +//This differs from remove_from_mob() in that it checks canremove first. /mob/proc/unEquip(obj/item/I, force = 0) //Force overrides NODROP for things like wizarditis and admin undress. - if(!I) //If there's nothing to drop, the drop is automatically successful. If(unEquip) should generally be used to check for NODROP. + if(!I) //If there's nothing to drop, the drop is automatically successful. return 1 - /*if((I.flags & NODROP) && !force) - return 0*/ - if(!I.canremove && !force) return 0 - if(I == r_hand) - r_hand = null - update_inv_r_hand() - else if(I == l_hand) - l_hand = null - update_inv_l_hand() - - if(I) - if(client) - client.screen -= I - I.loc = loc - I.dropped(src) - if(I) - I.layer = initial(I.layer) + remove_from_mob(I) return 1 //Attemps to remove an object on a mob. Will not move it to another area or such, just removes from the mob. -//It does call u_equip() though. So it can drop items to the floor but only if src is human. /mob/proc/remove_from_mob(var/obj/O) src.u_equip(O) if (src.client) @@ -306,99 +236,3 @@ var/list/slot_equipment_priority = list( \ //if(hasvar(src,"r_hand")) if(src:r_hand) items += src:r_hand return items - -/** BS12's proc to get the item in the active hand. Couldn't find the /tg/ equivalent. **/ -/mob/proc/equipped() - return get_active_hand() //TODO: get rid of this proc - -/mob/living/carbon/human/proc/equip_if_possible(obj/item/W, slot, del_on_fail = 1) // since byond doesn't seem to have pointers, this seems like the best way to do this :/ - //warning: icky code - var/equipped = 0 - switch(slot) - if(slot_back) - if(!src.back) - src.back = W - equipped = 1 - if(slot_wear_mask) - if(!src.wear_mask) - src.wear_mask = W - equipped = 1 - if(slot_handcuffed) - if(!src.handcuffed) - src.handcuffed = W - equipped = 1 - if(slot_l_hand) - if(!src.l_hand) - src.l_hand = W - equipped = 1 - if(slot_r_hand) - if(!src.r_hand) - src.r_hand = W - equipped = 1 - if(slot_belt) - if(!src.belt && src.w_uniform) - src.belt = W - equipped = 1 - if(slot_wear_id) - if(!src.wear_id && src.w_uniform) - src.wear_id = W - equipped = 1 - if(slot_l_ear) - if(!src.l_ear) - src.l_ear = W - equipped = 1 - if(slot_r_ear) - if(!src.r_ear) - src.r_ear = W - equipped = 1 - if(slot_glasses) - if(!src.glasses) - src.glasses = W - equipped = 1 - if(slot_gloves) - if(!src.gloves) - src.gloves = W - equipped = 1 - if(slot_head) - if(!src.head) - src.head = W - equipped = 1 - if(slot_shoes) - if(!src.shoes) - src.shoes = W - equipped = 1 - if(slot_wear_suit) - if(!src.wear_suit) - src.wear_suit = W - equipped = 1 - if(slot_w_uniform) - if(!src.w_uniform) - src.w_uniform = W - equipped = 1 - if(slot_l_store) - if(!src.l_store && src.w_uniform) - src.l_store = W - equipped = 1 - if(slot_r_store) - if(!src.r_store && src.w_uniform) - src.r_store = W - equipped = 1 - if(slot_s_store) - if(!src.s_store && src.wear_suit) - src.s_store = W - equipped = 1 - if(slot_in_backpack) - if (src.back && istype(src.back, /obj/item/weapon/storage/backpack)) - var/obj/item/weapon/storage/backpack/B = src.back - if(B.contents.len < B.storage_slots && W.w_class <= B.max_w_class) - W.loc = B - equipped = 1 - - if(equipped) - W.layer = 20 - if(src.back && W.loc != src.back) - W.loc = src - else - if (del_on_fail) - del(W) - return equipped diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8aa3ad82008..4c265d520ee 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -235,7 +235,7 @@ src << "\red It becomes hard to see for some reason." eye_blurry = 10 if(getBrainLoss() >= 35) - if(7 <= rn && rn <= 9) if(hand && equipped()) + if(7 <= rn && rn <= 9) if(get_active_hand()) src << "\red Your hand won't respond properly, you drop what you're holding." drop_item() if(getBrainLoss() >= 50) diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 4ac03cdf5f2..e830657c83c 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -49,8 +49,8 @@ Stun(2) //Being hit while using a deadman switch - if(istype(equipped(),/obj/item/device/assembly/signaler)) - var/obj/item/device/assembly/signaler/signaler = equipped() + if(istype(get_active_hand(),/obj/item/device/assembly/signaler)) + var/obj/item/device/assembly/signaler/signaler = get_active_hand() if(signaler.deadman && prob(80)) src.visible_message("\red [src] triggers their deadman's switch!") signaler.signal() diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 84f74cacae0..6dd04d3ca5d 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -96,8 +96,8 @@ /client/verb/drop_item() set hidden = 1 - if(!isrobot(mob)) - mob.drop_item_v() + if(!isrobot(mob) && mob.stat == CONSCIOUS && isturf(mob.loc)) + return mob.drop_item() return diff --git a/code/modules/power/antimatter/computer.dm b/code/modules/power/antimatter/computer.dm index 3a47ec7abf2..d531ccfb540 100644 --- a/code/modules/power/antimatter/computer.dm +++ b/code/modules/power/antimatter/computer.dm @@ -45,7 +45,7 @@ src.state = STATE_DEFAULT if("login") var/mob/M = usr - var/obj/item/weapon/card/id/I = M.equipped() + var/obj/item/weapon/card/id/I = M.get_active_hand() if (I && istype(I)) if(src.check_access(I)) authenticated = 1 diff --git a/code/modules/projectiles/guns/projectile/pneumatic.dm b/code/modules/projectiles/guns/projectile/pneumatic.dm index 43a5bc8e9ad..a9cdea466c1 100644 --- a/code/modules/projectiles/guns/projectile/pneumatic.dm +++ b/code/modules/projectiles/guns/projectile/pneumatic.dm @@ -67,7 +67,7 @@ for(var/obj/item/O in src.contents) total_stored += O.w_class if(total_stored + W.w_class <= max_combined_w_class) - user.drop_item(W) + user.remove_from_mob(W) W.loc = src user << "You shove [W] into the hopper." else diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm index 496455f24e4..59c5c028027 100644 --- a/code/modules/projectiles/targeting.dm +++ b/code/modules/projectiles/targeting.dm @@ -80,7 +80,7 @@ var/mob/living/M = loc if(M == T) return if(!istype(M)) return - if(src != M.equipped()) + if(src != M.get_active_hand()) stop_aim() return diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm index 7f754e56b37..afe1eb3ef7c 100644 --- a/code/modules/reagents/Chemistry-Machinery.dm +++ b/code/modules/reagents/Chemistry-Machinery.dm @@ -925,7 +925,7 @@ user << "Cannot refine into a reagent." return 1 - user.before_take_item(O) + user.remove_from_mob(O) O.loc = src holdingitems += O src.updateUsrDialog()