.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-03 15:48:58 -07:00
committed by Erki
parent 187613428e
commit 8519dcc393
376 changed files with 968 additions and 1261 deletions
+1 -1
View File
@@ -67,7 +67,7 @@
/obj/structure/alien/egg/proc/givefacehugger(var/kill = 1)
var/obj/item/clothing/mask/facehugger/child = GetFacehugger()
status = BURST
child.loc = get_turf(src)
child.forceMove(get_turf(src))
if(kill && istype(child))
child.Die()
+6 -8
View File
@@ -117,14 +117,12 @@ LINEN BINS
/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/bedsheet))
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
sheets.Add(I)
amount++
user << "<span class='notice'>You put [I] in [src].</span>"
else if(amount && !hidden && I.w_class < 4) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
hidden = I
user << "<span class='notice'>You hide [I] among the sheets.</span>"
@@ -140,12 +138,12 @@ LINEN BINS
else
B = new /obj/item/weapon/bedsheet(loc)
B.loc = user.loc
B.forceMove(user.loc)
user.put_in_hands(B)
user << "<span class='notice'>You take [B] out of [src].</span>"
if(hidden)
hidden.loc = user.loc
hidden.forceMove(user.loc)
user << "<span class='notice'>[hidden] falls out of [B]!</span>"
hidden = null
@@ -164,12 +162,12 @@ LINEN BINS
else
B = new /obj/item/weapon/bedsheet(loc)
B.loc = loc
B.forceMove(loc)
user << "<span class='notice'>You telekinetically remove [B] from [src].</span>"
update_icon()
if(hidden)
hidden.loc = loc
hidden.forceMove(loc)
hidden = null
+1 -1
View File
@@ -42,7 +42,7 @@
if (can_hang && !coat)
src.visible_message("[mover] lands on \the [src].")
coat = mover
coat.loc = src
coat.forceMove(src)
update_icon()
return 0
else
@@ -256,9 +256,10 @@
return
if(!dropsafety(W))
return
usr.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(istype(W, /obj/item/weapon/packageWrap))
return
else if(iswelder(W))
@@ -15,9 +15,10 @@
return 0
if(!dropsafety(W))
return
user.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(istype(W, /obj/item/weapon/packageWrap))
return
else
@@ -22,9 +22,10 @@
return 0
if(!dropsafety(W))
return
user.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(istype(W, /obj/item/weapon/packageWrap))
return
else
@@ -34,9 +34,10 @@
return
else if(W.loc != user) // This should stop mounted modules ending up outside the module.
return
user.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(!opened)
if(istype(W, /obj/item/weapon/melee/energy/blade))//Attempt to cut open locker if locked
if(emag_act(INFINITY, user, "<span class='danger'>The locker has been sliced open by [user] with \an [W]</span>!", "<span class='danger'>You hear metal being sliced and sparks flying.</span>"))
@@ -48,8 +48,10 @@
if (opened)
if (istype(W, /obj/item/weapon/grab))
MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
user.drop_item()
if (W) W.forceMove(loc)
if(W)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(W.GetID())
var/obj/item/weapon/card/id/I = W.GetID()
@@ -104,9 +104,10 @@
return
else if(W.loc != user) // This should stop mounted modules ending up outside the module.
return
user.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else
user.drop_item()
else if(isscrewdriver(W) && canbemoved)
if(screwed)
user << "<span class='notice'>You start to unscrew the locker from the floor...</span>"
@@ -366,9 +366,7 @@
return
else if(W.loc != user) // This should stop mounted modules ending up outside the module.
return
user.drop_item()
if(W)
W.forceMove(loc)
user.drop_from_inventory(W,loc)
else if(!opened)
if(istype(W, /obj/item/weapon/melee/energy/blade))//Attempt to cut open locker if locked
if(emag_act(INFINITY, user, "<span class='danger'>The locker has been sliced open by [user] with \an [W]</span>!", "<span class='danger'>You hear metal being sliced and sparks flying.</span>"))
@@ -105,8 +105,7 @@
else if(istype(W, /obj/item/device/radio/electropack))
if(rigged)
user << "<span class='notice'>You attach [W] to [src].</span>"
user.drop_item()
W.forceMove(src)
user.drop_from_inventory(W,src)
return
else if(iswirecutter(W))
if(rigged)
@@ -232,8 +232,7 @@
if(do_after(user, 40))
EL.inuse = 0
if(!src) return
user.drop_item()
EL.forceMove(src)
user.drop_from_inventory(EL,src)
user << "<span class='notice'>You installed the airlock electronics!</span>"
src.state = 2
src.name = "Near finished Airlock Assembly"
@@ -256,7 +255,7 @@
user << "<span class='notice'>You removed the airlock electronics!</span>"
src.state = 1
src.name = "Wired Airlock Assembly"
electronics.loc = src.loc
electronics.forceMove(src.loc)
electronics = null
else if(istype(W, /obj/item/stack/material) && !glass)
+1 -1
View File
@@ -52,7 +52,7 @@
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(has_extinguisher)
has_extinguisher.loc = loc
has_extinguisher.forceMove(loc)
user << "<span class='notice'>You telekinetically remove [has_extinguisher] from [src].</span>"
has_extinguisher = null
opened = 1
+1 -2
View File
@@ -104,8 +104,7 @@
if(do_after(user, 20, act_target = src))
if(!stored_item)
if(W.w_class <= ITEMSIZE_NORMAL)
user.drop_from_inventory(W)
W.forceMove(src)
user.drop_from_inventory(W,src)
stored_item = W
to_chat(user,"<span class='notice'>You hide \the [W] in [src].</span>")
return
+6 -10
View File
@@ -50,7 +50,7 @@
/obj/structure/janitorialcart/MouseDrop_T(atom/movable/O as mob|obj, mob/living/user as mob)
if (istype(O, /obj/structure/mopbucket) && !mybucket)
O.loc = src
O.forceMove(src)
mybucket = O
user << "You mount the [O] on the janicart."
update_icon()
@@ -65,9 +65,8 @@
var/obj/I = usr.get_active_hand()
if(istype(I, /obj/item/weapon/mop))
if(!mymop)
usr.drop_item()
usr.drop_from_inventory(I,src)
mymop = I
I.forceMove(src)
update_icon()
updateUsrDialog()
usr << "<span class='notice'>You put [I] into [src].</span>"
@@ -100,25 +99,23 @@
return 1
else if(istype(I, /obj/item/weapon/reagent_containers/spray) && !myspray)
user.drop_item()
user.drop_from_inventory(I,src)
myspray = I
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
return 1
else if(istype(I, /obj/item/device/lightreplacer) && !myreplacer)
user.drop_item()
user.drop_from_inventory(I,src)
myreplacer = I
I.forceMove(src)
update_icon()
updateUsrDialog()
user << "<span class='notice'>You put [I] into [src].</span>"
return 1
else if(istype(I, /obj/item/weapon/storage/bag/trash) && !mybag)
user.drop_item()
user.drop_from_inventory(I,src)
mybag = I
I.forceMove(src)
update_icon()
@@ -128,8 +125,7 @@
else if(istype(I, /obj/item/weapon/caution))
if(signs < 4)
user.drop_item()
I.forceMove(src)
user.drop_from_inventory(I,src)
signs++
update_icon()
updateUsrDialog()
+3 -4
View File
@@ -12,7 +12,7 @@
for(var/obj/item/I in loc)
if(notices > 4) break
if(istype(I, /obj/item/weapon/paper))
I.loc = src
I.forceMove(src)
notices++
icon_state = "nboard0[notices]"
@@ -22,8 +22,7 @@
if(notices < 5)
O.add_fingerprint(user)
add_fingerprint(user)
user.drop_from_inventory(O)
O.loc = src
user.drop_from_inventory(O,src)
notices++
icon_state = "nboard0[notices]" //update sprite
user << "<span class='notice'>You pin the paper to the noticeboard.</span>"
@@ -55,7 +54,7 @@
return
var/obj/item/P = locate(href_list["remove"])
if(P && P.loc == src)
P.loc = get_turf(src) //dump paper on the floor because you're a clumsy fuck
P.forceMove(get_turf(src)) //dump paper on the floor because you're a clumsy fuck
P.add_fingerprint(usr)
add_fingerprint(usr)
notices--
+2 -3
View File
@@ -37,7 +37,7 @@ FLOOR SAFES
return
if(I.w_class + space <= maxspace)
space += I.w_class
I.loc = src
I.forceMove(src)
/obj/structure/safe/proc/check_unlocked(mob/user as mob, canhear)
@@ -147,8 +147,7 @@ FLOOR SAFES
if(open)
if(I.w_class + space <= maxspace)
space += I.w_class
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
user << "<span class='notice'>You put [I] in [src].</span>"
updateUsrDialog()
return
@@ -62,7 +62,7 @@
"<span class='warning'>[user.name] drenches you in a foul-smelling resin, trapping you in the [src]!</span>",\
"<span class='notice'>You hear squelching...</span>")
M.buckled = src
M.loc = src.loc
M.forceMove(src.loc)
M.set_dir(src.dir)
M.update_canmove()
M.pixel_y = 6
@@ -101,7 +101,6 @@
return
var/obj/item/stack/C = W
if(C.get_amount() < 1) // How??
user.drop_from_inventory(C)
qdel(C)
return
var/padding_type //This is awful but it needs to be like this until tiles are given a material var.
@@ -117,7 +116,7 @@
C.use(1)
if(!istype(src.loc, /turf))
user.drop_from_inventory(src)
src.loc = get_turf(src)
src.forceMove(get_turf(src))
user << "You add padding to \the [src]."
add_padding(padding_type)
return
@@ -135,7 +134,7 @@
var/mob/living/affecting = G.affecting
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")
if(do_after(user, 20))
affecting.loc = loc
affecting.forceMove(loc)
spawn(0)
if(buckle_mob(affecting))
affecting.visible_message(\
@@ -224,7 +223,7 @@
var/obj/item/roller_holder/RH = W
if(!RH.held)
user << "<span class='notice'>You collect the roller bed.</span>"
src.loc = RH
src.forceMove(RH)
RH.held = src
return
@@ -258,7 +257,7 @@
..()
if(buckled_mob)
if(buckled_mob.buckled == src)
buckled_mob.loc = src.loc
buckled_mob.forceMove(src.loc)
else
buckled_mob = null
@@ -15,12 +15,11 @@
if(!SK.status)
user << "<span class='notice'>\The [SK] is not ready to be attached!</span>"
return
user.drop_item()
var/obj/structure/bed/chair/e_chair/E = new (src.loc, material.name)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
E.set_dir(dir)
E.part = SK
SK.loc = E
user.drop_from_inventory(SK,E)
SK.master = E
qdel(src)
@@ -122,7 +122,6 @@
return
var/obj/item/stack/C = W
if(C.get_amount() < 1) // How??
user.drop_from_inventory(C)
qdel(C)
return
var/padding_type //This is awful but it needs to be like this until tiles are given a material var.
@@ -138,7 +137,7 @@
C.use(1)
if(!istype(src.loc, /turf))
user.drop_from_inventory(src)
src.loc = get_turf(src)
src.forceMove(get_turf(src))
user << "You add padding to \the [src]."
add_padding(padding_type)
return
@@ -24,14 +24,14 @@
/obj/structure/dispenser/update_icon()
cut_overlays()
switch(oxygentanks)
if(1 to 3)
if(1 to 3)
add_overlay("oxygen-[oxygentanks]")
if(4 to INFINITY)
if(4 to INFINITY)
add_overlay("oxygen-4")
switch(phorontanks)
if(1 to 4)
add_overlay("phoron-[phorontanks]")
if(5 to INFINITY)
if(5 to INFINITY)
add_overlay("phoron-5")
/obj/structure/dispenser/attack_ai(mob/user as mob)
@@ -52,8 +52,7 @@
/obj/structure/dispenser/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/weapon/tank/oxygen) || istype(I, /obj/item/weapon/tank/air) || istype(I, /obj/item/weapon/tank/anesthetic))
if(oxygentanks < 10)
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
oxytanks.Add(I)
oxygentanks++
user << "<span class='notice'>You put [I] in [src].</span>"
@@ -65,8 +64,7 @@
return
if(istype(I, /obj/item/weapon/tank/phoron))
if(phorontanks < 10)
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
platanks.Add(I)
phorontanks++
user << "<span class='notice'>You put [I] in [src].</span>"
@@ -98,7 +96,7 @@
oxytanks.Remove(O)
else
O = new /obj/item/weapon/tank/oxygen(loc)
O.loc = loc
O.forceMove(loc)
usr << "<span class='notice'>You take [O] out of [src].</span>"
oxygentanks--
update_icon()
@@ -110,7 +108,7 @@
platanks.Remove(P)
else
P = new /obj/item/weapon/tank/phoron(loc)
P.loc = loc
P.forceMove(loc)
usr << "<span class='notice'>You take [P] out of [src].</span>"
phorontanks--
update_icon()
+4 -4
View File
@@ -13,7 +13,7 @@
..()
// Move the pinned target along with the stake
if(pinned_target in view(3, src))
pinned_target.loc = loc
pinned_target.forceMove(loc)
else // Sanity check: if the pinned target can't be found in immediate view
pinned_target = null
@@ -28,7 +28,7 @@
density = 0
W.density = 1
user.remove_from_mob(W)
W.loc = loc
W.forceMove(loc)
W.layer = 3.1
pinned_target = W
user << "You slide the target into the stake."
@@ -41,13 +41,13 @@
pinned_target.density = 0
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
pinned_target.forceMove(user.loc)
if(ishuman(user))
if(!user.get_active_hand())
user.put_in_hands(pinned_target)
user << "You take the target out of the stake."
else
pinned_target.loc = get_turf(user)
pinned_target.forceMove(get_turf(user))
user << "You take the target out of the stake."
pinned_target = null
@@ -49,7 +49,7 @@
/obj/structure/transit_tube_pod/Destroy()
for(var/atom/movable/AM in contents)
AM.loc = loc
AM.forceMove(loc)
return ..()
@@ -60,7 +60,7 @@ obj/structure/ex_act(severity)
switch(severity)
if(1.0)
for(var/atom/movable/AM in contents)
AM.loc = loc
AM.forceMove(loc)
AM.ex_act(severity++)
qdel(src)
@@ -68,7 +68,7 @@ obj/structure/ex_act(severity)
if(2.0)
if(prob(50))
for(var/atom/movable/AM in contents)
AM.loc = loc
AM.forceMove(loc)
AM.ex_act(severity++)
qdel(src)
@@ -104,7 +104,7 @@ obj/structure/ex_act(severity)
AM << "<span class='warning'>The tube's support pylons block your way.</span>"
return ..()
else
AM.loc = src.loc
AM.forceMove(src.loc)
AM << "<span class='info'>You slip under the tube.</span>"
@@ -120,7 +120,7 @@ obj/structure/ex_act(severity)
AM << "<span class='notice'>The pod is already occupied.</span>"
return
else if(!pod.moving && pod.dir in directions())
AM.loc = pod
AM.forceMove(pod)
return
@@ -380,7 +380,7 @@ obj/structure/ex_act(severity)
if(istype(mob, /mob) && mob.client)
// If the pod is not in a tube at all, you can get out at any time.
if(!(locate(/obj/structure/transit_tube) in loc))
mob.loc = loc
mob.forceMove(loc)
mob.client.Move(get_step(loc, direction), direction)
//if(moving && istype(loc, /turf/space))
@@ -393,7 +393,7 @@ obj/structure/ex_act(severity)
if(!station.pod_moving)
if(direction == station.dir)
if(station.icon_state == "open")
mob.loc = loc
mob.forceMove(loc)
mob.client.Move(get_step(loc, direction), direction)
else
+2 -3
View File
@@ -33,7 +33,7 @@
if(ishuman(user))
user.put_in_hands(I)
else
I.loc = get_turf(src)
I.forceMove(get_turf(src))
user << "<span class='notice'>You find \an [I] in the cistern.</span>"
w_items -= I.w_class
return
@@ -87,8 +87,7 @@
if(w_items + I.w_class > 5)
user << "<span class='notice'>The cistern is full.</span>"
return
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
w_items += I.w_class
user << "You carefully place \the [I] into the cistern."
return
@@ -175,8 +175,7 @@ obj/structure/windoor_assembly/Destroy()
if(do_after(user, 40))
EL.inuse = 0
if(!src) return
user.drop_item()
EL.forceMove(src)
user.drop_from_inventory(EL,src)
user << "<span class='notice'>You've installed the airlock electronics!</span>"
src.name = "Near finished Windoor Assembly"
src.electronics = EL
@@ -197,7 +196,7 @@ obj/structure/windoor_assembly/Destroy()
src.name = "Wired Windoor Assembly"
var/obj/item/weapon/airlock_electronics/ae = electronics
electronics = null
ae.loc = src.loc
ae.forceMove(src.loc)
//Crowbar to complete the assembly, Step 7 complete.
else if(iscrowbar(W))
@@ -232,7 +231,7 @@ obj/structure/windoor_assembly/Destroy()
else
windoor.req_access = src.electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
src.electronics.forceMove(windoor)
else
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(src.loc)
if(src.facing == "l")
@@ -250,7 +249,7 @@ obj/structure/windoor_assembly/Destroy()
else
windoor.req_access = src.electronics.conf_access
windoor.electronics = src.electronics
src.electronics.loc = windoor
src.electronics.forceMove(windoor)
qdel(src)