Skip to content

Commit

Permalink
fix(things): replaces direct loc setting across the code w/ forceMove…
Browse files Browse the repository at this point in the history
… and dropInto

PR #11163
  • Loading branch information
TobyThorne authored Dec 6, 2023
1 parent 7bf0f28 commit d5f8716
Show file tree
Hide file tree
Showing 134 changed files with 270 additions and 280 deletions.
2 changes: 1 addition & 1 deletion code/game/machinery/Sleeper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
to_chat(user, "<span class='warning'>\The [src] has a beaker already.</span>")
return
if(occupant && panel_open && isCrowbar(I))
occupant.loc = get_turf(src)
occupant.forceMove(get_turf(src))
occupant = null
update_use_power(1)
update_icon()
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/cell_charger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@

/obj/machinery/cell_charger/attack_ai(mob/user)
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Borgs can remove the cell if they are near enough
if(!src.charging)
if(!charging)
return

charging.loc = src.loc
charging.forceMove(loc)
charging.update_icon()
charging = null
user.visible_message("[user] removes the cell from the charger.", "You remove the cell from the charger.")
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/computer/ai_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
to_chat(user, SPAN("notice", "You remove the circuit board."))
icon_state = "0"
circuit.loc = loc
circuit.dropInto(loc)
circuit = null
if(AI_STAGE_CABLE)
if(isScrewdriver(P) && circuit)
Expand Down Expand Up @@ -172,7 +172,7 @@
if(isCrowbar(P) && brain)
playsound(loc, 'sound/items/Crowbar.ogg', 50, 1)
to_chat(user, SPAN("notice", "You remove the brain."))
brain.loc = loc
brain.dropInto(loc)
brain = null
icon_state = "3"

Expand Down Expand Up @@ -227,7 +227,7 @@
transfer.aiRestorePowerRoutine = 0
transfer.control_disabled = 0
transfer.ai_radio.disabledAi = 0
transfer.loc = get_turf(src)
transfer.dropInto(get_turf(src))
transfer.create_eyeobj()
transfer.cancel_camera()
to_chat(user, "<span class='notice'>Transfer successful:</span> [transfer.name] ([rand(1000,9999)].exe) downloaded to host terminal. Local copy wiped.")
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/buildandrepair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
src.state = 1
src.icon_state = "0"
circuit.loc = src.loc
circuit.dropInto(loc)
src.circuit = null
if(2)
if(isScrewdriver(P) && circuit)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/cryopod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@
else
if(control_computer && control_computer.allow_items)
control_computer.frozen_items += I
I.loc = null
I.forceMove(null)
else
I.forceMove(src.loc)
I.dropInto(loc)

//Update any existing objectives involving this mob.
for(var/datum/antag_contract/AC in GLOB.all_contracts)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
else
repairing = stack.split(amount_needed, force=TRUE)
if(repairing)
repairing.loc = src
repairing.forceMove(src)
transfer = repairing.amount
repairing.uses_charge = FALSE //for clean robot door repair - stacks hint immortal if true

Expand Down Expand Up @@ -259,7 +259,7 @@
if(repairing && isCrowbar(I))
to_chat(user, "<span class='notice'>You remove \the [repairing].</span>")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
repairing.loc = user.loc
repairing.dropInto(user.loc)
repairing = null
return

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
else
ae = electronics
electronics = null
ae.loc = loc
ae.dropInto(loc)
if(operating == -1)
ae.icon_state = "door_electronics_smoked"
operating = 0
Expand Down Expand Up @@ -242,7 +242,7 @@
else
ae = electronics
electronics = null
ae.loc = loc
ae.dropInto(loc)
ae.icon_state = "door_electronics_smoked"

operating = 0
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/floorlayer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
var/obj/item/stack/tile/E = input("Choose remove tile type.", "Tiles") as null|anything in contents
if(E)
to_chat(user, "<span class='notice'>You remove the [E] from \the [src].</span>")
E.loc = src.loc
E.dropInto(loc)
T = null
return

Expand Down Expand Up @@ -103,7 +103,7 @@

/obj/machinery/floorlayer/proc/TakeTile(obj/item/stack/tile/tile)
if(!T) T = tile
tile.loc = src
tile.forceMove(src)

SortStacks()

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.anchored = 1//So space wind cannot drag it.
if(caller_id)
hologram.SetName("[caller_id.name] (Hologram)")
hologram.loc = get_step(src,1)
hologram.forceMove(get_step(src, 1))
masters[caller_id] = hologram
else
hologram.SetName("[A.name] (Hologram)") //If someone decides to right click.
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/newscaster.dm
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
NEWSPAPER.news_content += FC
if(news_network.wanted_issue)
NEWSPAPER.important_message = news_network.wanted_issue
NEWSPAPER.loc = get_turf(src)
NEWSPAPER.forceMove(get_turf(src))
src.paper_remaining--
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/robot_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Please wait until completion...</TT><BR>

spawn (build_time)
if (!isnull(src.being_built))
src.being_built.loc = get_turf(src)
src.being_built.forceMove(get_turf(src))
src.being_built = null
src.update_use_power(POWER_USE_IDLE)
src.operating = 0
Expand Down
12 changes: 6 additions & 6 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@
usr.stop_pulling()
usr.client.perspective = EYE_PERSPECTIVE
usr.client.eye = src
usr.loc = src
usr.forceMove(src)
occupant = usr
isopen = 0 //Close the thing after the guy gets inside
update_icon()
Expand Down Expand Up @@ -577,7 +577,7 @@
if (M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
M.forceMove(src)
occupant = M
isopen = 0 //close ittt
add_fingerprint(user)
Expand Down Expand Up @@ -805,7 +805,7 @@
if (M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
M.loc = src
M.forceMove(src)
occupant = M

add_fingerprint(user)
Expand Down Expand Up @@ -935,11 +935,11 @@
/obj/machinery/suit_cycler/OnTopic(href, href_list)
if(href_list["eject_suit"])
if(!suit) return
suit.loc = get_turf(src)
suit.dropInto(get_turf(src))
suit = null
else if(href_list["eject_helmet"])
if(!helmet) return
helmet.loc = get_turf(src)
helmet.dropInto(get_turf(src))
helmet = null
else if(href_list["select_department"])
var/choice = input("Please select the target department paintjob.","Suit cycler",null) as null|anything in departments
Expand Down Expand Up @@ -1076,7 +1076,7 @@
occupant.client.eye = occupant.client.mob
occupant.client.perspective = MOB_PERSPECTIVE

occupant.loc = get_turf(occupant)
occupant.forceMove(get_turf(occupant))
occupant = null

add_fingerprint(user)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/telecomms/logbrowser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
new /obj/item/material/shard( src.loc )
var/obj/item/circuitboard/comm_server/M = new /obj/item/circuitboard/comm_server( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 3
A.icon_state = "3"
Expand All @@ -207,7 +207,7 @@
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/circuitboard/comm_server/M = new /obj/item/circuitboard/comm_server( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 4
A.icon_state = "4"
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/telecomms/telemonitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
new /obj/item/material/shard( src.loc )
var/obj/item/circuitboard/comm_monitor/M = new /obj/item/circuitboard/comm_monitor( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 3
A.icon_state = "3"
Expand All @@ -142,7 +142,7 @@
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/circuitboard/comm_monitor/M = new /obj/item/circuitboard/comm_monitor( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 4
A.icon_state = "4"
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/telecomms/traffic_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
new /obj/item/material/shard( src.loc )
var/obj/item/circuitboard/comm_traffic/M = new /obj/item/circuitboard/comm_traffic( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 3
A.icon_state = "3"
Expand All @@ -139,7 +139,7 @@
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/circuitboard/comm_traffic/M = new /obj/item/circuitboard/comm_traffic( A )
for (var/obj/C in src)
C.loc = src.loc
C.dropInto(loc)
A.circuit = M
A.state = 4
A.icon_state = "4"
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/washing_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

sleep(20)
if(state in list(1,3,6) )
usr.loc = src.loc
usr.forceMove(src.loc)


/obj/machinery/washing_machine/on_update_icon()
Expand All @@ -104,7 +104,7 @@
if( (state == 1) && hacked)
var/obj/item/grab/G = W
if(ishuman(G.assailant) && iscorgi(G.affecting))
G.affecting.loc = src
G.affecting.forceMove(src)
qdel(G)
state = 3
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/combat/marauder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@

/obj/mecha/combat/marauder/relaymove(mob/user,direction)
if(user != src.occupant) //While not "realistic", this piece is player friendly.
user.loc = get_turf(src)
user.forceMove(get_turf(src))
to_chat(user, "You climb out from [src]")
return 0
if(!can_move)
Expand Down
4 changes: 2 additions & 2 deletions code/game/mecha/combat/phazon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
if(can_move)
can_move = 0
flick("phazon-phase", src)
src.loc = get_step(src,src.dir)
src.use_power(phasing_energy_drain)
forceMove(get_step(src, dir))
use_power(phasing_energy_drain)
sleep(step_in*3)
can_move = 1
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/equipment/mecha_equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
/obj/item/mecha_parts/mecha_equipment/proc/attach(obj/mecha/M as obj)
M.equipment += src
chassis = M
src.loc = M
forceMove(M)
M.log_message("[src] initialized.")
if(!M.selected)
M.selected = src
Expand Down
4 changes: 2 additions & 2 deletions code/game/mecha/equipment/tools/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
cargo_holder.cargo += O
O.loc = chassis
O.forceMove(chassis)
O.anchored = 0
occupant_message(SPAN("notice", "[target] succesfully loaded."))
log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
Expand Down Expand Up @@ -986,7 +986,7 @@
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
cargo_holder.cargo += O
O.loc = chassis
O.forceMove(chassis)
O.anchored = 0
chassis.occupant_message(SPAN("notice", "[target] succesfully loaded."))
chassis.log_message("Loaded [O]. Cargo compartment capacity: [cargo_holder.cargo_capacity - cargo_holder.cargo.len]")
Expand Down
6 changes: 3 additions & 3 deletions code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@
user.drop(I, src)
brainmob.reset_view(src)
occupant = brainmob
brainmob.loc = src // should allow relaymove
brainmob.forceMove(src) // should allow relaymove
//brainmob.canmove = TRUE
//mmi_as_oc.mecha = src
verbs -= /obj/mecha/verb/eject
Expand Down Expand Up @@ -1282,12 +1282,12 @@
if(istype(mob_container, /obj/item/organ/internal/cerebrum/mmi))
var/obj/item/organ/internal/cerebrum/mmi/mmi = mob_container
if(mmi.brainmob)
occupant.loc = mmi
occupant.forceMove(mmi)
verbs += /obj/mecha/verb/eject
if(istype(mob_container, /obj/item/organ/internal/cerebrum/posibrain))
var/obj/item/organ/internal/cerebrum/posibrain/pb = mob_container
if(pb.brainmob)
occupant.loc = pb
occupant.forceMove(pb)
verbs += /obj/mecha/verb/eject

occupant = null
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/mecha_wreckage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
if(!isemptylist(crowbar_salvage))
var/obj/S = pick(crowbar_salvage)
if(S)
S.loc = get_turf(user)
S.dropInto(get_turf(user))
crowbar_salvage -= S
user.visible_message("[user] pries [S] from [src].", "You pry [S] from [src].")
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/mecha/working/ripley.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

/obj/mecha/working/ripley/Destroy()
for(var/atom/movable/A in src.cargo)
A.loc = loc
A.dropInto(loc)
var/turf/T = loc
if(istype(T))
T.Entered(A)
Expand Down
6 changes: 3 additions & 3 deletions code/game/mecha/working/working.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
for(var/mob/M in src)
if(M==src.occupant)
continue
M.loc = get_turf(src)
M.forceMove(get_turf(src))
M.loc.Entered(M)
step_rand(M)
for(var/atom/movable/A in src.cargo)
A.loc = get_turf(src)
A.dropInto(get_turf(src))
var/turf/T = get_turf(A)
if(T)
T.Entered(A)
Expand All @@ -27,7 +27,7 @@
var/obj/O = locate(href_list["drop_from_cargo"])
if(O && (O in src.cargo))
src.occupant_message("<span class='notice'>You unload [O].</span>")
O.loc = get_turf(src)
O.dropInto(get_turf(src))
src.cargo -= O
var/turf/T = get_turf(O)
if(T)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/effects/chem/foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
/obj/structure/foamedmetal/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/grab))
var/obj/item/grab/G = I
G.affecting.loc = src.loc
G.affecting.forceMove(loc)
visible_message("<span class='warning'>[G.assailant] smashes [G.affecting] through the foamed metal wall.</span>")
qdel(I)
qdel(src)
Expand Down
Loading

0 comments on commit d5f8716

Please sign in to comment.