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

@@ -388,13 +388,7 @@
del(animation)
for(var/obj/item/W in src)
C.u_equip(W)
if (C.client)
C.client.screen -= W
if (W)
W.loc = C.loc
W.dropped(C)
W.layer = initial(W.layer)
C.drop_from_inventory(W)
var/mob/living/carbon/human/O = new /mob/living/carbon/human( src )
if (C.dna.GetUIState(DNA_UI_GENDER))

View File

@@ -798,7 +798,7 @@ var/list/sacrificed = list()
if (cultist.legcuffed)
cultist.drop_from_inventory(cultist.legcuffed)
if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle))
cultist.u_equip(cultist.wear_mask)
cultist.drop_from_inventory(cultist.wear_mask)
if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded)
cultist.loc:welded = 0
if(istype(cultist.loc, /obj/structure/closet/secure_closet)&&cultist.loc:locked)

View File

@@ -542,7 +542,7 @@
A.loc = src.loc
user << "You add the robot arm to the [src]"
src.loc = A //Place the water tank into the assembly, it will be needed for the finished bot
user.u_equip(S)
user.remove_from_mob(S)
del(S)
/obj/item/weapon/farmbot_arm_assembly/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -551,21 +551,21 @@
src.build_step++
user << "You add the plant analyzer to [src]!"
src.name = "farmbot assembly"
user.u_equip(W)
user.remove_from_mob(W)
del(W)
else if(( istype(W, /obj/item/weapon/reagent_containers/glass/bucket)) && (src.build_step == 1))
src.build_step++
user << "You add a bucket to [src]!"
src.name = "farmbot assembly with bucket"
user.u_equip(W)
user.remove_from_mob(W)
del(W)
else if(( istype(W, /obj/item/weapon/minihoe)) && (src.build_step == 2))
src.build_step++
user << "You add a minihoe to [src]!"
src.name = "farmbot assembly with bucket and minihoe"
user.u_equip(W)
user.remove_from_mob(W)
del(W)
else if((isprox(W)) && (src.build_step == 3))
@@ -577,7 +577,7 @@
S.tank = wTank
S.loc = get_turf(src)
S.name = src.created_name
user.u_equip(W)
user.remove_from_mob(W)
del(W)
del(src)

View File

@@ -233,7 +233,7 @@ var/global/list/holodeck_programs = list(
if(isobj(obj))
var/mob/M = obj.loc
if(ismob(M))
M.u_equip(obj)
M.remove_from_mob(obj)
M.update_icons() //so their overlays update
if(!silent)

View File

@@ -154,7 +154,7 @@
if(isobj(obj))
var/mob/M = obj.loc
if(ismob(M))
M.u_equip(obj)
M.remove_from_mob(obj)
M.update_icons() //so their overlays update
if(!silent)

View File

@@ -21,7 +21,7 @@
if (contents.len >= max_butts)
user << "This ashtray is full."
return
user.u_equip(W)
user.remove_from_mob(W)
W.loc = src
if (istype(W,/obj/item/clothing/mask/cigarette))

View File

@@ -198,7 +198,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(ismob(loc))
var/mob/living/M = loc
M << "<span class='notice'>Your [name] goes out.</span>"
M.u_equip(src) //un-equip it so the overlays can update
M.remove_from_mob(src) //un-equip it so the overlays can update
M.update_inv_wear_mask(0)
processing_objects.Remove(src)
del(src)

View File

@@ -109,7 +109,7 @@
if(!ispath(gift_type,/obj/item)) return
var/obj/item/I = new gift_type(M)
M.u_equip(src)
M.remove_from_mob(src)
M.put_in_hands(I)
I.add_fingerprint(M)
del(src)

View File

@@ -123,7 +123,7 @@
c.scanned = A
if(istype(A.loc,/mob/living/carbon/human))
var/mob/living/carbon/human/H = A.loc
H.u_equip(A)
H.remove_from_mob(A)
else if(istype(A.loc,/obj/item/weapon/storage))
var/obj/item/weapon/storage/S = A.loc
S.remove_from_storage(A)

View File

@@ -156,7 +156,7 @@
break
if(!inserted || !S.amount)
usr.u_equip(S)
usr.remove_from_mob(S)
usr.update_icons() //update our overlays
if (usr.client && usr.s_active != src)
usr.client.screen -= S

View File

@@ -256,7 +256,7 @@
/obj/item/weapon/storage/proc/handle_item_insertion(obj/item/W as obj, prevent_warning = 0)
if(!istype(W)) return 0
if(usr)
usr.u_equip(W)
usr.remove_from_mob(W)
usr.update_icons() //update our overlays
W.loc = src
W.on_enter_storage(src)

View File

@@ -188,12 +188,12 @@
if (user.client)
user.client.screen -= src
if (user.r_hand == src)
user.u_equip(src)
user.remove_from_mob(src)
else
user.u_equip(src)
user.remove_from_mob(src)
src.master = F
src.layer = initial(src.layer)
user.u_equip(src)
user.remove_from_mob(src)
if (user.client)
user.client.screen -= src
src.loc = F

View File

@@ -61,7 +61,7 @@
origin.loc = get_turf(src)
if(user)
user.u_equip(src)
user.remove_from_mob(src)
user.visible_message("\blue [user] puts [src] down.", "\blue You put [src] down.")
del src
@@ -78,7 +78,7 @@
/obj/item/weapon/stool/attack(mob/M as mob, mob/user as mob)
if (prob(5) && istype(M,/mob/living))
user.visible_message("\red [user] breaks [src] over [M]'s back!")
user.u_equip(src)
user.remove_from_mob(src)
var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal
m.loc = get_turf(src)
del src

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