.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
+1 -2
View File
@@ -708,9 +708,8 @@ obj/item/weapon/gun/Destroy()
to_chat(user, "<span class='danger'>There is a bayonet attached to \the [src] already.</span>")
return
user.drop_from_inventory(I)
user.drop_from_inventory(I,src)
bayonet = I
I.forceMove(src)
to_chat(user, "<span class='notice'>You attach \the [I] to the front of \the [src].</span>")
update_icon()
+1 -1
View File
@@ -24,6 +24,6 @@
/obj/item/weapon/gun/launcher/process_projectile(obj/item/projectile, mob/user, atom/target, var/target_zone, var/params=null, var/pointblank=0, var/reflex=0)
update_release_force(projectile)
projectile.loc = get_turf(user)
projectile.forceMove(get_turf(user))
projectile.throw_at(target, throw_distance, release_force, user)
return 1
@@ -42,7 +42,7 @@
if(throwforce == 15) // The rod has been superheated - we don't want it to be useable when removed from the bow.
user << "[src] shatters into a scattering of overstressed metal shards as it leaves the crossbow."
var/obj/item/weapon/material/shard/shrapnel/S = new()
S.loc = get_turf(src)
S.forceMove(get_turf(src))
qdel(src)
/obj/item/weapon/gun/launcher/crossbow
@@ -83,7 +83,7 @@
if(tension)
if(bolt)
user.visible_message("[user] relaxes the tension on [src]'s string and removes [bolt].","You relax the tension on [src]'s string and remove [bolt].")
bolt.loc = get_turf(src)
bolt.forceMove(get_turf(src))
var/obj/item/weapon/arrow/A = bolt
bolt = null
A.removed(user)
@@ -147,7 +147,7 @@
if (R.use(1))
bolt = new /obj/item/weapon/arrow/rod(src)
bolt.fingerprintslast = src.fingerprintslast
bolt.loc = src
bolt.forceMove(src)
update_icon()
user.visible_message("[user] jams [bolt] into [src].","You jam [bolt] into [src].")
superheat_rod(user)
@@ -155,9 +155,8 @@
if(istype(W, /obj/item/weapon/cell))
if(!cell)
user.drop_item()
user.drop_from_inventory(cell,src)
cell = W
cell.loc = src
user << "<span class='notice'>You jam [cell] into [src] and wire it to the firing coil.</span>"
superheat_rod(user)
else
@@ -166,7 +165,7 @@
else if(isscrewdriver(W))
if(cell)
var/obj/item/C = cell
C.loc = get_turf(user)
C.forceMove(get_turf(user))
user << "<span class='notice'>You jimmy [cell] out of [src] with [W].</span>"
cell = null
else
@@ -55,7 +55,7 @@
user << "<span class='warning'>[src] is full.</span>"
return
user.remove_from_mob(G)
G.loc = src
G.forceMove(src)
grenades.Insert(1, G) //add to the head of the list, so that it is loaded on the next pump
user.visible_message("[user] inserts \a [G] into [src].", "<span class='notice'>You insert \a [G] into [src].</span>")
@@ -117,7 +117,7 @@
user << "<span class='warning'>[src] is already loaded.</span>"
return
user.remove_from_mob(G)
G.loc = src
G.forceMove(src)
chambered = G
user.visible_message("[user] load \a [G] into [src].", "<span class='notice'>You load \a [G] into [src].</span>")
@@ -162,7 +162,6 @@
/obj/item/weapon/cannonframe/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
if(buildstate == 0)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You secure the piping inside the frame.</span>"
buildstate++
@@ -180,7 +179,6 @@
return
else if(istype(W,/obj/item/device/transfer_valve))
if(buildstate == 4)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You install the transfer valve and connect it to the piping.</span>"
buildstate++
@@ -26,8 +26,7 @@
/obj/item/weapon/gun/launcher/rocket/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/ammo_casing/rocket))
if(rockets.len < max_rockets)
user.drop_item()
I.loc = src
user.drop_from_inventory(I,src)
rockets += I
user << "<span class='notice'>You put the rocket in [src].</span>"
user << "<span class='notice'>[rockets.len] / [max_rockets] rockets.</span>"
@@ -23,7 +23,7 @@
syringe = I
user << "<span class='notice'>You carefully insert [syringe] into [src].</span>"
user.remove_from_mob(syringe)
syringe.loc = src
syringe.forceMove(src)
sharp = 1
name = "syringe dart"
update_icon()
@@ -126,7 +126,7 @@
user << "<span class='warning'>[src] is full!</span>"
return
user.remove_from_mob(C)
C.loc = src
C.forceMove(src)
darts += C //add to the end
user.visible_message("[user] inserts \a [C] into [src].", "<span class='notice'>You insert \a [C] into [src].</span>")
else
+6 -6
View File
@@ -96,7 +96,7 @@
switch(handle_casings)
if(EJECT_CASINGS) //eject casing onto ground.
chambered.loc = get_turf(src)
chambered.forceMove(get_turf(src))
if(CYCLE_CASINGS) //cycle the casing back to the end.
if(ammo_magazine)
ammo_magazine.stored_ammo += chambered
@@ -121,7 +121,7 @@
user << "<span class='warning'>[src] already has a magazine loaded.</span>" //already a magazine here
return
user.remove_from_mob(AM)
AM.loc = src
AM.forceMove(src)
ammo_magazine = AM
user.visible_message("[user] inserts [AM] into [src].", "<span class='notice'>You insert [AM] into [src].</span>")
playsound(src.loc, 'sound/weapons/flipblade.ogg', 50, 1)
@@ -134,7 +134,7 @@
if(loaded.len >= max_shells)
break
if(C.caliber == caliber)
C.loc = src
C.forceMove(src)
loaded += C
AM.stored_ammo -= C //should probably go inside an ammo_magazine proc, but I guess less proc calls this way...
count++
@@ -151,7 +151,7 @@
return
user.remove_from_mob(C)
C.loc = src
C.forceMove(src)
loaded.Insert(1, C) //add to the head of the list
user.visible_message("[user] inserts \a [C] into [src].", "<span class='notice'>You insert \a [C] into [src].</span>")
playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1)
@@ -173,7 +173,7 @@
var/turf/T = get_turf(user)
if(T)
for(var/obj/item/ammo_casing/C in loaded)
C.loc = T
C.forceMove(T)
count++
loaded.Cut()
if(count)
@@ -212,7 +212,7 @@
/obj/item/weapon/gun/projectile/afterattack(atom/A, mob/living/user)
..()
if(auto_eject && ammo_magazine && ammo_magazine.stored_ammo && !ammo_magazine.stored_ammo.len)
ammo_magazine.loc = get_turf(src.loc)
ammo_magazine.forceMove(get_turf(src.loc))
user.visible_message(
"[ammo_magazine] falls out and clatters on the floor!",
"<span class='notice'>[ammo_magazine] falls out and clatters on the floor!</span>"
@@ -112,8 +112,7 @@
user << "<span class='notice'>[src] already has [max_beakers] beakers in it - another one isn't going to fit!</span>"
return
var/obj/item/weapon/reagent_containers/glass/beaker/B = I
user.drop_item()
B.loc = src
user.drop_from_inventory(B,src)
beakers += B
user << "<span class='notice'>You slot [B] into [src].</span>"
src.updateUsrDialog()
@@ -189,7 +188,7 @@
usr << "You remove [B] from [src]."
mixing -= B
beakers -= B
B.loc = get_turf(src)
B.forceMove(get_turf(src))
else if (href_list["eject_cart"])
unload_ammo(usr)
src.updateUsrDialog()
@@ -101,7 +101,6 @@
/obj/item/weapon/receivergun/attackby(obj/item/W as obj, mob/user as mob)
if(istype(W,/obj/item/pipe))
if(buildstate == 0)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You place the pipe and the receiver together.</span>"
buildstate++
@@ -109,7 +108,6 @@
return
else if(istype(W,/obj/item/weapon/stock))
if(buildstate == 1)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You add the stock to the assembly.</span>"
buildstate++
@@ -117,7 +115,6 @@
return
else if(istype(W,/obj/item/weapon/tape_roll))
if(buildstate == 2)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You strap the pieces together with tape.</span>"
buildstate++
@@ -185,7 +182,6 @@
return
else if(istype(W,/obj/item/weapon/receivergun))
if(buildstate == 1)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You add the receiver to the assembly.</span>"
buildstate++
@@ -193,7 +189,6 @@
return
else if(istype(W,/obj/item/pipe))
if(buildstate == 2)
user.drop_from_inventory(W)
qdel(W)
user << "<span class='notice'>You strap the pipe to the assembly.</span>"
buildstate++
@@ -31,7 +31,7 @@
ammo_magazine = new magazine_type(src)
gun.magazine_type = ammo_magazine
gun.ammo_magazine = ammo_magazine
gun.loc = src
gun.forceMove(src)
/obj/item/minigunpack/proc/make_gun()
return new /obj/item/weapon/gun/projectile/automatic/rifle/minigun()
@@ -215,11 +215,10 @@
if(user.l_hand != src && user.r_hand != src) //if we're not in his hands
user << "<span class='notice'>You'll need [src] in your hands to do that.</span>"
return
user.drop_item()
user.drop_from_inventory(I,src)
user << "<span class='notice'>You screw [I] onto [src].</span>"
silenced = I //dodgy?
w_class = 3
I.loc = src //put the silencer into the gun
update_icon()
return
..()
@@ -72,7 +72,7 @@
/obj/item/weapon/gun/projectile/contender/attack_self(mob/user as mob)
if(chambered)
chambered.loc = get_turf(src)
chambered.forceMove(get_turf(src))
chambered = null
var/obj/item/ammo_casing/C = loaded[1]
loaded -= C
@@ -165,7 +165,7 @@
if(chambered)//We have a shell in the chamber
chambered.loc = get_turf(src)//Eject casing
chambered.forceMove(get_turf(src))//Eject casing
chambered = null
if(loaded.len)
@@ -181,8 +181,7 @@
user << "<span class='notice'>You need to open the bolt of \the [src] first.</span>"
return
if(!has_clip)
user.drop_from_inventory(A)
A.forceMove(src)
user.drop_from_inventory(A,src)
has_clip = A
user << "<span class='notice'>You load the clip into \the [src].</span>"
if(!has_clip.stored_ammo.len)
@@ -58,7 +58,7 @@
if(bolt_open)
if(chambered)
user << "<span class='notice'>You work the bolt open, ejecting [chambered]!</span>"
chambered.loc = get_turf(src)
chambered.forceMove(get_turf(src))
loaded -= chambered
chambered = null
else
@@ -151,22 +151,18 @@
return ..()
if(ismodifier(A) && gun_mods.len < modifier_cap)
gun_mods += A
user.drop_item()
A.forceMove(src)
user.drop_from_inventory(A,src)
else if(islasercapacitor(A) && stage == 1)
capacitor = A
user.drop_item()
A.forceMove(src)
user.drop_from_inventory(A,src)
stage = 2
else if(isfocusinglens(A) && stage == 2)
focusing_lens = A
user.drop_item()
A.forceMove(src)
user.drop_from_inventory(A,src)
stage = 3
else if(ismodulator(A) && stage == 3)
modulator = A
user.drop_item()
A.forceMove(src)
user.drop_from_inventory(A,src)
else
return ..()
user << "<span class='notice'>You insert \the [A] into the assembly.</span>"
+1 -2
View File
@@ -52,8 +52,7 @@ Firing pins as a rule can't be removed without replacing them, blame a really sh
/obj/item/device/firing_pin/proc/gun_insert(mob/living/user, obj/item/weapon/gun/G)
gun = G
user.drop_from_inventory(src)
forceMove(gun)
user.drop_from_inventory(src,gun)
gun.pin = src
return