.loc = to forceMove() (#4937)

As requested, this PR is changed to only include all .loc = to forceMove() changes.
This commit is contained in:
BurgerLUA
2018-08-04 01:48:58 +03:00
committed by Erki
parent 187613428e
commit 8519dcc393
376 changed files with 968 additions and 1261 deletions
+4 -6
View File
@@ -49,8 +49,7 @@
/obj/item/weapon/clipboard/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo))
user.drop_item()
W.loc = src
user.drop_from_inventory(W,src)
if(istype(W, /obj/item/weapon/paper))
toppaper = W
user << "<span class='notice'>You clip the [W] onto \the [src].</span>"
@@ -95,7 +94,7 @@
if(href_list["pen"])
if(istype(haspen) && (haspen.loc == src))
haspen.loc = usr.loc
haspen.forceMove(usr.loc)
usr.put_in_hands(haspen)
haspen = null
@@ -103,8 +102,7 @@
if(!haspen)
var/obj/item/weapon/pen/W = usr.get_active_hand()
if(istype(W, /obj/item/weapon/pen))
usr.drop_item()
W.loc = src
usr.drop_from_inventory(W,src)
haspen = W
usr << "<span class='notice'>You slot the pen into \the [src].</span>"
@@ -124,7 +122,7 @@
if(P && (P.loc == src) && (istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/photo)) )
P.loc = usr.loc
P.forceMove(usr.loc)
usr.put_in_hands(P)
if(P == toppaper)
toppaper = null
+4 -4
View File
@@ -123,7 +123,7 @@ var/list/admin_departments
else if(href_list["remove"])
if(copyitem)
copyitem.loc = loc
copyitem.forceMove(loc)
if (get_dist(usr, src) < 2)
usr.put_in_hands(copyitem)
usr << "<span class='notice'>You take \the [copyitem] out of \the [src].</span>"
@@ -135,17 +135,17 @@ var/list/admin_departments
if(href_list["scan"])
if (scan)
if(ishuman(usr))
scan.loc = usr.loc
scan.forceMove(usr.loc)
if(!usr.get_active_hand())
usr.put_in_hands(scan)
scan = null
else
scan.loc = src.loc
scan.forceMove(src.loc)
scan = null
else
var/obj/item/I = usr.get_active_hand()
if (istype(I, /obj/item/weapon/card/id) && usr.unEquip(I))
I.loc = src
I.forceMove(src)
scan = I
authenticated = 0
+3 -4
View File
@@ -31,14 +31,13 @@
. = ..()
for(var/obj/item/I in loc)
if(istype(I, /obj/item/weapon/paper) || istype(I, /obj/item/weapon/folder) || istype(I, /obj/item/weapon/photo) || istype(I, /obj/item/weapon/paper_bundle))
I.loc = src
I.forceMove(src)
/obj/structure/filingcabinet/attackby(obj/item/P as obj, mob/user as mob)
if(istype(P, /obj/item/weapon/paper) || istype(P, /obj/item/weapon/folder) || istype(P, /obj/item/weapon/photo) || istype(P, /obj/item/weapon/paper_bundle))
user << "<span class='notice'>You put [P] in [src].</span>"
user.drop_item()
P.loc = src
user.drop_from_inventory(P,src)
icon_state = "[initial(icon_state)]-open"
sleep(5)
icon_state = initial(icon_state)
@@ -75,7 +74,7 @@
if(contents.len)
if(prob(40 + contents.len * 5))
var/obj/item/I = pick(contents)
I.loc = loc
I.forceMove(loc)
if(prob(25))
step_rand(I)
user << "<span class='notice'>You pull \a [I] out of [src] at random.</span>"
+2 -3
View File
@@ -37,8 +37,7 @@
/obj/item/weapon/folder/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/photo) || istype(W, /obj/item/weapon/paper_bundle))
user.drop_item()
W.loc = src
user.drop_from_inventory(W,src)
user << "<span class='notice'>You put the [W] into \the [src].</span>"
update_icon()
else if(istype(W, /obj/item/weapon/pen))
@@ -71,7 +70,7 @@
if(href_list["remove"])
var/obj/item/P = locate(href_list["remove"])
if(P && (P.loc == src) && istype(P))
P.loc = usr.loc
P.forceMove(usr.loc)
usr.put_in_hands(P)
else if(href_list["read"])
+6 -10
View File
@@ -322,10 +322,6 @@
if(get_dist(src, user) < 2 && user.get_active_hand() == P)
user.visible_message("<span class='[class]'>[user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>", \
"<span class='[class]'>You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>")
if(user.get_inactive_hand() == src)
user.drop_from_inventory(src)
new /obj/effect/decal/cleanable/ash(src.loc)
qdel(src)
@@ -419,7 +415,8 @@
B.name = name
else if (P.name != "paper" && P.name != "photo")
B.name = P.name
user.drop_from_inventory(P)
user.drop_from_inventory(P,B)
//TODO: Look into this stuff
if (istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/h_user = user
if (h_user.r_hand == src)
@@ -430,13 +427,13 @@
h_user.put_in_l_hand(B)
else if (h_user.l_store == src)
h_user.drop_from_inventory(src)
B.loc = h_user
B.forceMove(h_user)
B.layer = 20
h_user.l_store = B
h_user.update_inv_pockets()
else if (h_user.r_store == src)
h_user.drop_from_inventory(src)
B.loc = h_user
B.forceMove(h_user)
B.layer = 20
h_user.r_store = B
h_user.update_inv_pockets()
@@ -444,12 +441,11 @@
h_user.u_equip(src)
h_user.put_in_hands(B)
else if (!istype(src.loc, /turf))
src.loc = get_turf(h_user)
src.forceMove(get_turf(h_user))
if(h_user.client) h_user.client.screen -= src
h_user.put_in_hands(B)
user << "<span class='notice'>You clip the [P.name] to [(src.name == "paper") ? "the paper" : src.name].</span>"
src.loc = B
P.loc = B
src.forceMove(B)
B.pages.Add(src)
B.pages.Add(P)
+3 -12
View File
@@ -34,9 +34,8 @@
// merging bundles
else if(istype(W, /obj/item/weapon/paper_bundle))
user.drop_from_inventory(W)
for(var/obj/O in W)
O.loc = src
O.forceMove(src)
O.add_fingerprint(usr)
pages.Add(O)
amount++
@@ -62,8 +61,7 @@
else if(istype(sheet, /obj/item/weapon/photo))
user << "<span class='notice'>You add [(sheet.name == "photo") ? "the photo" : sheet.name] to [(src.name == "paper bundle") ? "the paper bundle" : src.name].</span>"
user.drop_from_inventory(sheet)
sheet.loc = src
user.drop_from_inventory(sheet,src)
pages.Insert(index, sheet)
@@ -84,10 +82,6 @@
if(get_dist(src, user) < 2 && user.get_active_hand() == P && P.lit)
user.visible_message("<span class='[class]'>[user] burns right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>", \
"<span class='[class]'>You burn right through \the [src], turning it to ash. It flutters through the air before settling on the floor in a heap.</span>")
if(user.get_inactive_hand() == src)
user.drop_from_inventory(src)
new /obj/effect/decal/cleanable/ash(src.loc)
qdel(src)
@@ -169,10 +163,8 @@
if(pages.len <= 1)
var/obj/item/weapon/paper/P = src[1]
usr.drop_from_inventory(src)
usr.put_in_hands(P)
qdel(src)
return
if(page > pages.len)
@@ -204,10 +196,9 @@
usr << "<span class='notice'>You loosen the bundle.</span>"
for(var/obj/O in src)
O.loc = usr.loc
O.forceMove(usr.loc)
O.layer = initial(O.layer)
O.add_fingerprint(usr)
usr.drop_from_inventory(src)
qdel(src)
return
+4 -5
View File
@@ -65,7 +65,7 @@
else if (response == "Carbon-Copy")
P = new /obj/item/weapon/paper/carbon
P.loc = user.loc
P.forceMove(user.loc)
user.put_in_hands(P)
user << "<span class='notice'>You take [P] out of the [src].</span>"
else
@@ -78,17 +78,16 @@
/obj/item/weapon/paper_bin/attackby(obj/item/weapon/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
var/obj/item/weapon/paper/i = O
user.drop_item()
i.loc = src
user.drop_from_inventory(i,src)
user << "<span class='notice'>You put [i] in [src].</span>"
papers.Add(i)
amount++
/* if(istype(O, /obj/item/weapon/paper_pack)) WIP written in.
var/obj/item/weapon/paper_bundle/j = O
user.drop_item()
amount += j.amount
user << "<span class='notice'>You add paper from [j] into [src].</span>"
del(j)
user.drop_from_inventory(j,get_turf(src))
qdel(j)
*/
+1 -5
View File
@@ -45,14 +45,13 @@
return
if (paper_result > 0)
paperamount += paper_result
user.drop_from_inventory(W)
qdel(W)
playsound(src.loc, 'sound/items/pshred.ogg', 75, 1)
if(paperamount > max_paper)
user <<"<span class='danger'>\The [src] was too full, and shredded paper goes everywhere!</span>"
for(var/i=(paperamount-max_paper);i>0;i--)
var/obj/item/weapon/shreddedp/SP = get_shredded_paper()
SP.loc = get_turf(src)
SP.forceMove(get_turf(src))
SP.throw_at(get_edge_target_turf(src,pick(alldirs)),1,5)
paperamount = max_paper
update_icon()
@@ -131,9 +130,6 @@
FireBurn()
/obj/item/weapon/shreddedp/proc/FireBurn()
var/mob/living/M = loc
if(istype(M))
M.drop_from_inventory(src)
new /obj/effect/decal/cleanable/ash(get_turf(src))
qdel(src)
+7 -8
View File
@@ -65,7 +65,7 @@
updateUsrDialog()
else if(href_list["remove"])
if(copyitem)
copyitem.loc = usr.loc
copyitem.forceMove(usr.loc)
usr.put_in_hands(copyitem)
usr << "<span class='notice'>You take \the [copyitem] out of \the [src].</span>"
copyitem = null
@@ -104,9 +104,8 @@
/obj/machinery/photocopier/attackby(obj/item/O as obj, mob/user as mob)
if(istype(O, /obj/item/weapon/paper) || istype(O, /obj/item/weapon/photo) || istype(O, /obj/item/weapon/paper_bundle))
if(!copyitem)
user.drop_item()
user.drop_from_inventory(O,src)
copyitem = O
O.loc = src
user << "<span class='notice'>You insert \the [O] into \the [src].</span>"
flick(insert_anim, src)
updateUsrDialog()
@@ -114,10 +113,10 @@
user << "<span class='notice'>There is already something in \the [src].</span>"
else if(istype(O, /obj/item/device/toner))
if(toner <= 10) //allow replacing when low toner is affecting the print darkness
user.drop_item()
user << "<span class='notice'>You insert the toner cartridge into \the [src].</span>"
user << "<span class='notice'>You insert \the [O] into \the [src].</span>"
var/obj/item/device/toner/T = O
toner += T.toner_amount
user.drop_from_inventory(O,get_turf(src))
qdel(O)
updateUsrDialog()
else
@@ -191,7 +190,7 @@
/obj/machinery/photocopier/proc/photocopy(var/obj/item/weapon/photo/photocopy)
var/obj/item/weapon/photo/p = photocopy.copy()
p.loc = src.loc
p.forceMove(src.loc)
var/icon/I = icon(photocopy.icon, photocopy.icon_state)
if(toner > 10) //plenty of toner, go straight greyscale
@@ -223,10 +222,10 @@
W = copy(W)
else if(istype(W, /obj/item/weapon/photo))
W = photocopy(W)
W.loc = p
W.forceMove(p)
p.pages += W
p.loc = src.loc
p.forceMove(src.loc)
p.update_icon()
p.icon_state = "paper_words"
p.name = bundle.name
+2 -2
View File
@@ -158,7 +158,7 @@ var/global/photo_count = 0
user << "<span class='notice'>[src] still has some film in it!</span>"
return
user << "<span class='notice'>You insert [I] into [src].</span>"
user.drop_item()
user.drop_from_inventory(I,get_turf(src))
qdel(I)
pictures_left = pictures_max
return
@@ -250,7 +250,7 @@ var/global/photo_count = 0
return p
/obj/item/device/camera/proc/printpicture(mob/user, obj/item/weapon/photo/p)
p.loc = user.loc
p.forceMove(user.loc)
if(!user.get_inactive_hand())
user.put_in_inactive_hand(p)
@@ -16,7 +16,7 @@
name = "Drone photo camera"
/obj/item/device/camera/siliconcam/proc/injectaialbum(obj/item/weapon/photo/p, var/sufix = "") //stores image information to a list similar to that of the datacore
p.loc = src
p.forceMove(src)
photos_taken++
p.name = "Image [photos_taken][sufix]"
aipictures += p