Replaces uses of u_equip() with remove_from_mob() or drop_from_inventory(), where appropriate.

This commit is contained in:
mwerezak
2015-03-30 22:05:00 -04:00
parent 1b4e13aabc
commit cdfce64ad0
24 changed files with 45 additions and 113 deletions

View File

@@ -1054,11 +1054,7 @@
//strip their stuff and stick it in the crate
for(var/obj/item/I in M)
M.u_equip(I)
if(I)
I.loc = locker
I.layer = initial(I.layer)
I.dropped(M)
M.drop_from_inventory(I, locker)
M.update_icons()
//so they black out before warping
@@ -1091,11 +1087,7 @@
return
for(var/obj/item/I in M)
M.u_equip(I)
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
I.dropped(M)
M.drop_from_inventory(I)
M.Paralyse(5)
sleep(5)
@@ -1120,11 +1112,7 @@
return
for(var/obj/item/I in M)
M.u_equip(I)
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
I.dropped(M)
M.drop_from_inventory(I)
M.Paralyse(5)
sleep(5)
@@ -1171,11 +1159,7 @@
return
for(var/obj/item/I in M)
M.u_equip(I)
if(I)
I.loc = M.loc
I.layer = initial(I.layer)
I.dropped(M)
M.drop_from_inventory(I)
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/observer = M
@@ -1961,13 +1945,7 @@
if(istype(W, /datum/organ/external))
continue
//don't strip organs
H.u_equip(W)
if (H.client)
H.client.screen -= W
if (W)
W.loc = H.loc
W.dropped(H)
W.layer = initial(W.layer)
H.drop_from_inventory(W)
//teleport person to cell
H.loc = pick(prisonwarp)
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform)

View File

@@ -58,7 +58,7 @@
/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
user.remove_from_mob(W)
W.loc = src
input += W
else
@@ -128,7 +128,7 @@
/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
user.remove_from_mob(W)
W.loc = src
input += W
else
@@ -189,7 +189,7 @@
/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
user.remove_from_mob(W)
W.loc = src
input += W
else
@@ -274,7 +274,7 @@
/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
user.remove_from_mob(W)
W.loc = src
input += W
else

View File

@@ -12,7 +12,7 @@
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (istype(W, /obj/item/weapon/ore))
user.u_equip(W)
user.remove_from_mob(W)
src.contents += W
if (istype(W, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = W

View File

@@ -173,6 +173,7 @@ var/list/slot_equipment_priority = list( \
//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.
//The only exception to this is if you are transferring the item between slots on the same mob.
//As far as I can tell the proc exists so that mobs with different inventory slots can override
//the search through all the slots, without having to duplicate the rest of the item dropping.
/mob/proc/u_equip(obj/W as obj)

View File

@@ -301,16 +301,9 @@
if(!item) return //Grab processing has a chance of returning null
item.layer = initial(item.layer)
u_equip(item)
update_icons()
if (istype(usr, /mob/living/carbon)) //Check if a carbon mob is throwing. Modify/remove this line as required.
item.loc = src.loc
if(src.client)
src.client.screen -= item
if(istype(item, /obj/item))
item:dropped(src) // let it know it's been dropped
src.remove_from_mob(item)
item.loc = src.loc
//actually throw it!
if (item)

View File

@@ -73,7 +73,7 @@ emp_act
if(c_hand && (stun_amount || agony_amount > 10))
msg_admin_attack("[src.name] ([src.ckey]) was disarmed by a stun effect")
u_equip(c_hand)
drop_from_inventory(c_hand)
if (affected.status & ORGAN_ROBOT)
emote("me", 1, "drops what they were holding, their [affected.display_name] malfunctioning!")
else

View File

@@ -81,13 +81,7 @@
if(istype(target.wear_mask, /obj/item/clothing)&& !target.wear_mask:canremove)
return
var/obj/item/W = target.wear_mask
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
target.drop_from_inventory(W)
W.add_fingerprint(source)
else
if (istype(item, /obj/item/clothing/mask))
@@ -99,13 +93,7 @@
if("l_hand")
if (target.l_hand)
var/obj/item/W = target.l_hand
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
target.drop_from_inventory(W)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
@@ -119,13 +107,7 @@
if("r_hand")
if (target.r_hand)
var/obj/item/W = target.r_hand
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.layer = initial(W.layer)
W.dropped(target)
target.drop_from_inventory(W)
W.add_fingerprint(source)
else
if (istype(item, /obj/item))
@@ -139,13 +121,7 @@
if("back")
if (target.back)
var/obj/item/W = target.back
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
target.target.drop_from_inventory(W)
W.add_fingerprint(source)
else
if ((istype(item, /obj/item) && item.slot_flags & SLOT_BACK ))
@@ -157,13 +133,7 @@
if("handcuff")
if (target.handcuffed)
var/obj/item/W = target.handcuffed
target.u_equip(W)
if (target.client)
target.client.screen -= W
if (W)
W.loc = target.loc
W.dropped(target)
W.layer = initial(W.layer)
target.target.drop_from_inventory(W)
W.add_fingerprint(source)
else
if (istype(item, /obj/item/weapon/handcuffs))

View File

@@ -828,11 +828,11 @@ Note that amputating the affected organ does in fact remove the infection from t
return
if(is_broken())
owner.u_equip(c_hand)
owner.drop_from_inventory(c_hand)
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
owner.emote("me", 1, "[(owner.species && owner.species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [hand_name]!")
if(is_malfunctioning())
owner.u_equip(c_hand)
owner.drop_from_inventory(c_hand)
owner.emote("me", 1, "drops what they were holding, their [hand_name] malfunctioning!")
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, owner)

View File

@@ -171,10 +171,8 @@
user << "\red There is already a [fueljar] inside!"
return
fueljar = W
user.remove_from_mob(W)
W.loc = src
if(user.client)
user.client.screen -= W
user.u_equip(W)
user.update_icons()
user.visible_message("[user.name] loads an [W.name] into the [src.name].", \
"You load an [W.name].", \

View File

@@ -165,9 +165,7 @@
return
user << "\red You slip [W] inside [src]."
user.u_equip(W)
if ((user.client && user.s_active != src))
user.client.screen -= W
user.remove_from_mob(W)
W.dropped(user)
add_fingerprint(user)
contents += W

View File

@@ -250,7 +250,7 @@
if (target != user && target.getarmor(target_zone, "melee") > 5 && prob(50))
for(var/mob/O in viewers(world.view, user))
O.show_message(text("\red <B>[user] tries to stab [target] in \the [hit_area] with [src.name], but the attack is deflected by armor!</B>"), 1)
user.u_equip(src)
user.remove_from_mob(src)
del(src)
return