Merge pull request #3208 from Citadel-Station-13/upstream-merge-31386

[MIRROR] Remove drop_item, drop_item_v, put_in_hands_or_del
This commit is contained in:
LetterJay
2017-10-08 16:18:18 -04:00
committed by GitHub
154 changed files with 2047 additions and 2234 deletions
@@ -58,14 +58,14 @@
playsound(src.loc, W.usesound, 50, 1)
deconstruct()
else if(istype(W, /obj/item/assembly/shock_kit))
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(W))
return
var/obj/item/assembly/shock_kit/SK = W
var/obj/structure/chair/e_chair/E = new /obj/structure/chair/e_chair(src.loc)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
E.setDir(dir)
E.part = SK
SK.loc = E
SK.forceMove(E)
SK.master = E
qdel(src)
else
+4 -5
View File
@@ -27,7 +27,8 @@ LINEN BINS
..()
/obj/item/bedsheet/attack_self(mob/user)
user.drop_item()
if(!user.dropItemToGround(src))
return
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
@@ -275,18 +276,16 @@ LINEN BINS
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/bedsheet))
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
sheets.Add(I)
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
return
I.loc = src
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
@@ -229,8 +229,7 @@
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
deconstruct(TRUE)
return 0
if(user.drop_item()) // so we put in unlit welder too
W.forceMove(loc)
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
return 1
else if(istype(W, /obj/item/weldingtool) && can_weld_shut)
var/obj/item/weldingtool/WT = W
@@ -602,10 +602,9 @@
if(do_after(user, 40, target = src))
if( src.state != 1 )
return
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
W.loc = src
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
src.state = 2
src.name = "near finished airlock assembly"
+1 -2
View File
@@ -54,9 +54,8 @@
return
if(istype(I, /obj/item/extinguisher))
if(!stored_extinguisher && opened)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
contents += I
stored_extinguisher = I
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
+1 -2
View File
@@ -53,10 +53,9 @@
if(F.wielded)
to_chat(user, "<span class='warning'>Unwield the [F.name] first.</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(F, src))
return
fireaxe = F
F.forceMove(src)
to_chat(user, "<span class='caution'>You place the [F.name] back in the [name].</span>")
update_icon()
return
+1 -2
View File
@@ -259,9 +259,8 @@
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
if(!user.drop_item())
if(!user.transferItemToLoc(P, drop_location()))
return
P.loc = src.loc
to_chat(user, "<span class='notice'>You fit the pipe into \the [src].</span>")
else
return ..()
+1 -2
View File
@@ -39,9 +39,8 @@
return
if(istype(I, gun_category) && open)
if(LAZYLEN(contents) < capacity)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
else
+1 -2
View File
@@ -32,9 +32,8 @@
return 1
/obj/structure/janitorialcart/proc/put_in_cart(obj/item/I, mob/user)
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
updateUsrDialog()
to_chat(user, "<span class='notice'>You put [I] into [src].</span>")
return
+1 -2
View File
@@ -159,10 +159,9 @@ FLOOR SAFES
. = 1 //no afterattack
if(I.w_class + space <= maxspace)
space += I.w_class
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>")
return
I.forceMove(src)
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
updateUsrDialog()
return
-1
View File
@@ -104,7 +104,6 @@
"<span class='notice'>You attach the sign to [T].</span>")
playsound(T, 'sound/items/deconstruct.ogg', 50, 1)
new sign_path(T)
user.drop_item()
qdel(src)
else
return ..()
+4 -6
View File
@@ -131,8 +131,7 @@
// If the tray IS empty, continue on (tray will be placed on the table like other items)
if(user.a_intent != INTENT_HARM && !(I.flags_1 & ABSTRACT_1))
if(user.drop_item())
I.Move(loc)
if(user.transferItemToLoc(I, drop_location()))
var/list/click_params = params2list(params)
//Center the icon where the user clicked.
if(!click_params || !click_params["icon-x"] || !click_params["icon-y"])
@@ -439,7 +438,7 @@
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
return
if(!user.drop_item())
if(!user.dropItemToGround(O))
return
if(O.loc != src.loc)
step(O, get_dir(O, src))
@@ -452,8 +451,7 @@
return
if(user.a_intent == INTENT_HARM)
return ..()
if(user.drop_item())
W.Move(loc)
if(user.transferItemToLoc(W, drop_location()))
return 1
/obj/structure/rack/attack_paw(mob/living/user)
@@ -516,7 +514,7 @@
building = TRUE
to_chat(user, "<span class='notice'>You start constructing a rack...</span>")
if(do_after(user, 50, target = user, progress=TRUE))
if(!user.drop_item())
if(!user.temporarilyRemoveItemFromInventory(src))
return
var/obj/structure/rack/R = new /obj/structure/rack(user.loc)
user.visible_message("<span class='notice'>[user] assembles \a [R].\
@@ -62,9 +62,8 @@
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
return
I.loc = src
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
+51 -52
View File
@@ -1,55 +1,54 @@
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
density = TRUE
flags_1 = CONDUCT_1
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
..()
if(pinned_target)
pinned_target.loc = loc
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.drop_item())
pinned_target = T
T.pinnedLoc = src
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
..()
if(pinned_target)
pinned_target.loc = loc
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.transferItemToLoc(T, drop_location()))
pinned_target = T
T.pinnedLoc = src
T.density = TRUE
T.layer = OBJ_LAYER + 0.01
T.loc = loc
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
pinned_target.nullPinnedLoc()
nullPinnedTarget()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.loc = get_turf(user)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
T.layer = OBJ_LAYER + 0.01
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
pinned_target.nullPinnedLoc()
nullPinnedTarget()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.loc = get_turf(user)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
+2 -4
View File
@@ -88,10 +88,9 @@
if(w_items + I.w_class > WEIGHT_CLASS_HUGE)
to_chat(user, "<span class='warning'>The cistern is full!</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the cistern!</span>")
return
I.loc = src
w_items += I.w_class
to_chat(user, "<span class='notice'>You carefully place [I] into the cistern.</span>")
@@ -173,10 +172,9 @@
if(I.w_class > 1)
to_chat(user, "<span class='warning'>[I] is too large for the drain enclosure.</span>")
return
if(!user.drop_item())
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\[I] is stuck to your hand, you cannot put it in the drain enclosure!</span>")
return
I.forceMove(src)
hiddenitem = I
to_chat(user, "<span class='notice'>You place [I] into the drain enclosure.</span>")
@@ -208,11 +208,10 @@
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/electronics/airlock))
if(!user.drop_item())
if(!user.transferItemToLoc(W, src))
return
playsound(loc, W.usesound, 100, 1)
user.visible_message("[user] installs the electronics into the airlock assembly.", "<span class='notice'>You start to install electronics into the airlock assembly...</span>")
W.loc = src
if(do_after(user, 40, target = src))
if(!src || electronics)