diff --git a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
index 649972297a..aed8b2dc07 100644
--- a/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/binary_atmos_base.dm
@@ -1,5 +1,5 @@
obj/machinery/atmospherics/binary
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH
use_power = 1
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index 0ac8ab6299..cb9ecfbdc5 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -111,7 +111,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
@@ -123,5 +123,5 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, -90)
+ src.set_dir(turn(src.dir, -90))
desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
index 7f0984efd7..6923b6d31e 100644
--- a/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/pipeturbine.dm
@@ -129,7 +129,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, -90)
+ src.set_dir(turn(src.dir, -90))
verb/rotate_anticlockwise()
@@ -140,7 +140,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
//Goddamn copypaste from binary base class because atmospherics machinery API is not damn flexible
network_expand(datum/pipe_network/new_network, obj/machinery/atmospherics/pipe/reference)
@@ -276,7 +276,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, -90)
+ src.set_dir(turn(src.dir, -90))
verb/rotate_anticlock()
set category = "Object"
@@ -286,4 +286,4 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, 90)
\ No newline at end of file
+ src.set_dir(turn(src.dir, 90))
\ No newline at end of file
diff --git a/code/ATMOSPHERICS/components/portables_connector.dm b/code/ATMOSPHERICS/components/portables_connector.dm
index 4bfd61a0a2..488c1eeb91 100644
--- a/code/ATMOSPHERICS/components/portables_connector.dm
+++ b/code/ATMOSPHERICS/components/portables_connector.dm
@@ -5,7 +5,7 @@
name = "Connector Port"
desc = "For connecting portables devices related to atmospherics control."
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
var/obj/machinery/portable_atmospherics/connected_device
diff --git a/code/ATMOSPHERICS/components/trinary_devices/filter.dm b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
index 5649b25e01..4f5205687e 100755
--- a/code/ATMOSPHERICS/components/trinary_devices/filter.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/filter.dm
@@ -248,7 +248,7 @@
/obj/machinery/atmospherics/trinary/filter/m_filter
icon_state = "mmap"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH|EAST
obj/machinery/atmospherics/trinary/filter/m_filter/New()
diff --git a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
index 051a2ced27..9432518b53 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/mixer.dm
@@ -181,7 +181,7 @@
obj/machinery/atmospherics/trinary/mixer/t_mixer
icon_state = "tmap"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|EAST|WEST
//node 3 is the outlet, nodes 1 & 2 are intakes
@@ -227,7 +227,7 @@ obj/machinery/atmospherics/trinary/mixer/t_mixer/initialize()
obj/machinery/atmospherics/trinary/mixer/m_mixer
icon_state = "mmap"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH|EAST
//node 3 is the outlet, nodes 1 & 2 are intakes
diff --git a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
index 822c9a4d6d..ce3aafc953 100644
--- a/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
+++ b/code/ATMOSPHERICS/components/trinary_devices/trinary_base.dm
@@ -1,5 +1,5 @@
obj/machinery/atmospherics/trinary
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH|WEST
use_power = 1
diff --git a/code/ATMOSPHERICS/components/tvalve.dm b/code/ATMOSPHERICS/components/tvalve.dm
index 39ca1e25fd..4d931bd324 100644
--- a/code/ATMOSPHERICS/components/tvalve.dm
+++ b/code/ATMOSPHERICS/components/tvalve.dm
@@ -6,7 +6,7 @@
desc = "A pipe valve"
level = 1
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH|WEST
var/state = 0 // 0 = go straight, 1 = go to side
diff --git a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
index 14bbb46bba..c3ccdbc574 100644
--- a/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
+++ b/code/ATMOSPHERICS/components/unary/oxygen_generator.dm
@@ -6,7 +6,7 @@ obj/machinery/atmospherics/unary/oxygen_generator
name = "Oxygen Generator"
desc = ""
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
var/on = 0
diff --git a/code/ATMOSPHERICS/components/unary/unary_base.dm b/code/ATMOSPHERICS/components/unary/unary_base.dm
index 8af26e51eb..8d850cc74f 100644
--- a/code/ATMOSPHERICS/components/unary/unary_base.dm
+++ b/code/ATMOSPHERICS/components/unary/unary_base.dm
@@ -1,5 +1,5 @@
/obj/machinery/atmospherics/unary
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
//layer = TURF_LAYER+0.1
diff --git a/code/ATMOSPHERICS/components/valve.dm b/code/ATMOSPHERICS/components/valve.dm
index bce38d0654..4633c06511 100644
--- a/code/ATMOSPHERICS/components/valve.dm
+++ b/code/ATMOSPHERICS/components/valve.dm
@@ -6,7 +6,7 @@
desc = "A pipe valve"
level = 1
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH
var/open = 0
@@ -123,9 +123,9 @@
/obj/machinery/atmospherics/valve/proc/normalize_dir()
if(dir==3)
- dir = 1
+ set_dir(1)
else if(dir==12)
- dir = 4
+ set_dir(4)
/obj/machinery/atmospherics/valve/attack_ai(mob/user as mob)
return
diff --git a/code/ATMOSPHERICS/mainspipe.dm b/code/ATMOSPHERICS/mainspipe.dm
index 631f3530a2..ce23f7bfba 100644
--- a/code/ATMOSPHERICS/mainspipe.dm
+++ b/code/ATMOSPHERICS/mainspipe.dm
@@ -115,7 +115,7 @@ obj/machinery/atmospherics/mains_pipe/simple
name = "mains pipe"
desc = "A one meter section of 3-line mains pipe"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_mains_directions = SOUTH|NORTH
New()
@@ -137,9 +137,9 @@ obj/machinery/atmospherics/mains_pipe/simple
proc/normalize_dir()
if(dir==3)
- dir = 1
+ set_dir(1)
else if(dir==12)
- dir = 4
+ set_dir(4)
update_icon()
if(nodes[1] && nodes[2])
@@ -148,7 +148,7 @@ obj/machinery/atmospherics/mains_pipe/simple
//var/node1_direction = get_dir(src, node1)
//var/node2_direction = get_dir(src, node2)
- //dir = node1_direction|node2_direction
+ //set_dir(node1_direction|node2_direction)
else
if(!nodes[1]&&!nodes[2])
@@ -196,7 +196,7 @@ obj/machinery/atmospherics/mains_pipe/manifold
name = "manifold pipe"
desc = "A manifold composed of mains pipes"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_mains_directions = EAST|NORTH|WEST
volume = 105
@@ -261,7 +261,7 @@ obj/machinery/atmospherics/mains_pipe/manifold4w
name = "manifold pipe"
desc = "A manifold composed of mains pipes"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_mains_directions = EAST|NORTH|WEST|SOUTH
volume = 105
@@ -504,7 +504,7 @@ obj/machinery/atmospherics/mains_pipe/cap
name = "pipe cap"
desc = "A cap for the end of a mains pipe"
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
volume = 35
@@ -546,7 +546,7 @@ obj/machinery/atmospherics/mains_pipe/valve
var/open = 1
- dir = SOUTH
+ set_dir(SOUTH)
initialize_mains_directions = SOUTH|NORTH
New()
@@ -597,9 +597,9 @@ obj/machinery/atmospherics/mains_pipe/valve
proc/normalize_dir()
if(dir==3)
- dir = 1
+ set_dir(1)
else if(dir==12)
- dir = 4
+ set_dir(4)
proc/open()
if(open) return 0
diff --git a/code/ATMOSPHERICS/pipes.dm b/code/ATMOSPHERICS/pipes.dm
index 53910f2fe3..037d39218a 100644
--- a/code/ATMOSPHERICS/pipes.dm
+++ b/code/ATMOSPHERICS/pipes.dm
@@ -143,7 +143,7 @@
volume = ATMOS_DEFAULT_VOLUME_PIPE
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH|NORTH
var/obj/machinery/atmospherics/node1
@@ -216,9 +216,9 @@
/obj/machinery/atmospherics/pipe/simple/proc/normalize_dir()
if(dir==3)
- dir = 1
+ set_dir(1)
else if(dir==12)
- dir = 4
+ set_dir(4)
/obj/machinery/atmospherics/pipe/simple/Del()
if(node1)
@@ -406,7 +406,7 @@
volume = ATMOS_DEFAULT_VOLUME_PIPE * 1.5
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = EAST|NORTH|WEST
var/obj/machinery/atmospherics/node1
@@ -658,7 +658,7 @@
volume = ATMOS_DEFAULT_VOLUME_PIPE * 2
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = NORTH|SOUTH|EAST|WEST
var/obj/machinery/atmospherics/node1
@@ -918,7 +918,7 @@
volume = 35
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
var/obj/machinery/atmospherics/node
@@ -1042,7 +1042,7 @@
var/start_pressure = 25*ONE_ATMOSPHERE
level = 1
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
density = 1
@@ -1220,7 +1220,7 @@
volume = 250
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
var/build_killswitch = 1
@@ -1259,7 +1259,7 @@
if(node1)
icon_state = "intact"
- dir = get_dir(src, node1)
+ set_dir(get_dir(src, node1))
else
icon_state = "exposed"
@@ -1291,7 +1291,7 @@
/obj/machinery/atmospherics/pipe/vent/hide(var/i) //to make the little pipe section invisible, the icon changes.
if(node1)
icon_state = "[i == 1 && istype(loc, /turf/simulated) ? "h" : "" ]intact"
- dir = get_dir(src, node1)
+ set_dir(get_dir(src, node1))
else
icon_state = "exposed"
diff --git a/code/FEA/FEA_fire.dm b/code/FEA/FEA_fire.dm
index bb71f31d47..b7a8d42fa5 100644
--- a/code/FEA/FEA_fire.dm
+++ b/code/FEA/FEA_fire.dm
@@ -167,7 +167,7 @@
/obj/effect/hotspot/New()
..()
- dir = pick(cardinal)
+ set_dir(pick(cardinal))
return
/*
diff --git a/code/TriDimension/Pipes.dm b/code/TriDimension/Pipes.dm
index 4132ddfe94..4f38444e98 100644
--- a/code/TriDimension/Pipes.dm
+++ b/code/TriDimension/Pipes.dm
@@ -10,7 +10,7 @@ obj/machinery/atmospherics/pipe/zpipe
volume = 70
- dir = SOUTH
+ set_dir(SOUTH)
initialize_directions = SOUTH
var/obj/machinery/atmospherics/node1 //connection on the same Z
@@ -84,9 +84,9 @@ obj/machinery/atmospherics/pipe/zpipe/proc/burst()
obj/machinery/atmospherics/pipe/zpipe/proc/normalize_dir()
if(dir==3)
- dir = 1
+ set_dir(1)
else if(dir==12)
- dir = 4
+ set_dir(4)
obj/machinery/atmospherics/pipe/zpipe/Del()
if(node1)
diff --git a/code/TriDimension/Structures.dm b/code/TriDimension/Structures.dm
index fa91ccd5bb..554853535a 100644
--- a/code/TriDimension/Structures.dm
+++ b/code/TriDimension/Structures.dm
@@ -256,8 +256,8 @@
initialise_stair_connection(S, src, inv_dir)
proc/initialise_stair_connection(var/obj/multiz/stairs/top, var/obj/multiz/stairs/bottom, var/dir)
- top.dir = dir
- bottom.dir = dir
+ top.set_dir(dir)
+ bottom.set_dir(dir)
top.connected = bottom
bottom.connected = top
top.icon_state = "ramptop"
diff --git a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm
index 95f7c26556..7e350dc3a0 100644
--- a/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Jungle/jungle_temple.dm
@@ -368,7 +368,7 @@
var/predir = M.dir
step(M, throw_dir)
- M.dir = predir
+ M.set_dir(predir)
//gives turf a different description, to try and trick players
/obj/effect/step_trigger/trap/fake
diff --git a/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm b/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm
index ffc1265b7d..7ae07059f7 100644
--- a/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Jungle/misc_helpers.dm
@@ -62,7 +62,7 @@
continue moving
var/turf/X = new T.type(B)
- X.dir = old_dir1
+ X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm
index b012d1c360..0c12ed23a0 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_assembly_port_construction.dm
@@ -39,7 +39,7 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
- dir = ndir
+ set_dir(ndir)
else
has_electronics = 3
opened = 0
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm
index fab9eb87d5..3d2e32f971 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_compressor_construction.dm
@@ -39,7 +39,7 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
- dir = ndir
+ set_dir(ndir)
else
has_electronics = 3
opened = 0
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm
index e3441dafd8..ad7ea622e2 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/fuel_injector.dm
@@ -294,7 +294,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
/obj/machinery/power/rust_fuel_injector/verb/rotate_anticlock()
set category = "Object"
@@ -304,4 +304,4 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, -90)
\ No newline at end of file
+ src.set_dir(turn(src.dir, -90))
\ No newline at end of file
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm
index f375716b21..0fff75bb50 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/gyrotron.dm
@@ -95,7 +95,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
- A.dir = src.dir
+ A.set_dir(src.dir)
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
@@ -125,7 +125,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()*/
- A.dir = src.dir
+ A.set_dir(src.dir)
if(src.dir == 1)//Up
A.yo = 20
A.xo = 0
diff --git a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm
index 155ef23c5c..b94127ffa2 100644
--- a/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Rust/radiation.dm
@@ -26,7 +26,7 @@
if(!dir)
RadiateParticleRand(energy, ionizing)
var/obj/effect/accelerated_particle/particle = new
- particle.dir = dir
+ particle.set_dir(dir)
particle.ionizing = ionizing
if(energy)
particle.energy = energy
diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm
index 38032c459c..3782e76209 100644
--- a/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/Laser2.dm
@@ -22,7 +22,7 @@
if(!first)
src.first = new /obj/beam/e_beam(src.loc)
src.first.master = src
- src.first.dir = src.dir
+ src.first.set_dir(src.dir)
src.first.power = src.power
src.first.freq = src.freq
src.first.phase = src.phase
@@ -61,7 +61,7 @@
if(!next)
if(get_step(src.loc,src.dir))
var/obj/beam/e_beam/e = new /obj/beam/e_beam(src.loc)
- e.dir = src.dir
+ e.set_dir(src.dir)
src.next = e
e.master = src.master
e.power = src.power
diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm
index 04c07733df..66ccf181bd 100644
--- a/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm
+++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/ZeroPointLaser.dm
@@ -34,7 +34,7 @@
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
return 1
/obj/machinery/zero_point_emitter/New()
@@ -98,7 +98,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
- A.dir = src.dir
+ A.set_dir(src.dir)
switch(dir)
if(NORTH)
A.yo = 20
diff --git a/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm b/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm
index 85bcc084b7..9ebc5fa5de 100644
--- a/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm
+++ b/code/WorkInProgress/Cael_Aislinn/meteor_battery.dm
@@ -13,7 +13,7 @@
/obj/item/projectile/missile/process(var/turf/newtarget)
target = newtarget
- dir = get_dir(src.loc, target)
+ set_dir(get_dir(src.loc, target))
walk_towards(src, target, MISSILE_SPEED)
/obj/item/projectile/missile/Bump(atom/A)
@@ -164,7 +164,7 @@
/obj/machinery/meteor_battery/proc/target()
while(src && enabled && !stat)
- src.dir = get_dir(src, cur_target)
+ src.set_dir(get_dir(src, cur_target))
shootAt(cur_target)
sleep(shot_delay)
return
diff --git a/code/WorkInProgress/Cael_Aislinn/sculpture.dm b/code/WorkInProgress/Cael_Aislinn/sculpture.dm
index 639c2c8487..808e968f55 100644
--- a/code/WorkInProgress/Cael_Aislinn/sculpture.dm
+++ b/code/WorkInProgress/Cael_Aislinn/sculpture.dm
@@ -56,7 +56,7 @@
continue
turfs += thisturf
var/turf/target_turf = pick(turfs)
- src.dir = get_dir(src, target_turf)
+ src.set_dir(get_dir(src, target_turf))
src.loc = target_turf
hibernate = 1
@@ -193,7 +193,7 @@
if(!next_turf.CanPass(src, next_turf))
break
src.loc = next_turf
- src.dir = get_dir(src, target_mob)
+ src.set_dir(get_dir(src, target_mob))
next_turf = get_step(src, get_dir(next_turf,target_mob))
num_turfs--
@@ -233,7 +233,7 @@
if(!next_turf.CanPass(src, next_turf))
break
src.loc = next_turf
- src.dir = get_dir(src, target_mob)
+ src.set_dir(get_dir(src, target_mob))
next_turf = get_step(src, get_dir(next_turf,target_turf))
num_turfs--
else if(G)
diff --git a/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm b/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm
index b26e721638..44a7dcb84f 100644
--- a/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm
+++ b/code/WorkInProgress/Chinsky/overmap/ships/engines/thermal.dm
@@ -89,7 +89,7 @@
anchored = 1
New(var/turf/nloc, var/ndir, var/temp)
- dir = ndir
+ set_dir(ndir)
..(nloc)
if(nloc)
diff --git a/code/WorkInProgress/Cib/amorph/amorph_hud.dm b/code/WorkInProgress/Cib/amorph/amorph_hud.dm
index c9a4ef0cc9..41a3adc9f5 100644
--- a/code/WorkInProgress/Cib/amorph/amorph_hud.dm
+++ b/code/WorkInProgress/Cib/amorph/amorph_hud.dm
@@ -46,7 +46,7 @@
using = new /obj/screen( src )
using.name = "act_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
@@ -105,7 +105,7 @@
using = new /obj/screen( src )
using.name = "mov_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
@@ -123,7 +123,7 @@
using = new /obj/screen( src )
using.name = "r_hand"
- using.dir = WEST
+ using.set_dir(WEST)
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
@@ -135,7 +135,7 @@
using = new /obj/screen( src )
using.name = "l_hand"
- using.dir = EAST
+ using.set_dir(EAST)
using.icon = ui_style
using.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
@@ -147,7 +147,7 @@
using = new /obj/screen( src )
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
@@ -156,7 +156,7 @@
using = new /obj/screen( src )
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
@@ -165,7 +165,7 @@
using = new /obj/screen( src )
using.name = "mask"
- using.dir = NORTH
+ using.set_dir(NORTH)
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_monkey_mask
@@ -174,7 +174,7 @@
using = new /obj/screen( src )
using.name = "back"
- using.dir = NORTHEAST
+ using.set_dir(NORTHEAST)
using.icon = ui_style
using.icon_state = "equip"
using.screen_loc = ui_back
@@ -291,19 +291,19 @@
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
+ mymob.gun_setting_icon.set_dir(2)
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
+ mymob.item_use_icon.set_dir(1)
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
+ mymob.gun_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
+ mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
diff --git a/code/WorkInProgress/Tastyfish/livestock.dm b/code/WorkInProgress/Tastyfish/livestock.dm
index f17265ba04..0befcb4c61 100644
--- a/code/WorkInProgress/Tastyfish/livestock.dm
+++ b/code/WorkInProgress/Tastyfish/livestock.dm
@@ -63,15 +63,15 @@
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if (movement_target.loc.x < src.x)
- dir = WEST
+ set_dir(WEST)
else if (movement_target.loc.x > src.x)
- dir = EAST
+ set_dir(EAST)
else if (movement_target.loc.y < src.y)
- dir = SOUTH
+ set_dir(SOUTH)
else if (movement_target.loc.y > src.y)
- dir = NORTH
+ set_dir(NORTH)
else
- dir = SOUTH
+ set_dir(SOUTH)
if(isturf(movement_target.loc))
movement_target.attack_animal(src)
diff --git a/code/WorkInProgress/Tastyfish/wallmount_frame.dm b/code/WorkInProgress/Tastyfish/wallmount_frame.dm
index 16bdb12d6c..28b6101a75 100644
--- a/code/WorkInProgress/Tastyfish/wallmount_frame.dm
+++ b/code/WorkInProgress/Tastyfish/wallmount_frame.dm
@@ -25,7 +25,7 @@
del(src)
return
- dir = get_dir(T, loc)
+ set_dir(get_dir(T, loc))
/obj/machinery/constructable_frame/wallmount_frame/attackby(obj/item/P as obj, mob/user as mob)
if(P.crit_fail)
@@ -109,7 +109,7 @@
if(component_check)
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
var/obj/machinery/new_machine = new src.circuit.build_path(src.loc)
- new_machine.dir = dir
+ new_machine.set_dir(dir)
if(istype(circuit, /obj/item/weapon/circuitboard/status_display))
new_machine.pixel_x = pixel_x * 1.33
new_machine.pixel_y = pixel_y * 1.33
diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm
index d93d45fec5..acd442355a 100644
--- a/code/WorkInProgress/buildmode.dm
+++ b/code/WorkInProgress/buildmode.dm
@@ -48,15 +48,15 @@
Click()
switch(dir)
if(NORTH)
- dir = EAST
+ set_dir(EAST)
if(EAST)
- dir = SOUTH
+ set_dir(SOUTH)
if(SOUTH)
- dir = WEST
+ set_dir(WEST)
if(WEST)
- dir = NORTHWEST
+ set_dir(NORTHWEST)
if(NORTHWEST)
- dir = NORTH
+ set_dir(NORTH)
return 1
/obj/effect/bmode/buildhelp
@@ -219,19 +219,19 @@
switch(holder.builddir.dir)
if(NORTH)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = NORTH
+ WIN.set_dir(NORTH)
if(SOUTH)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = SOUTH
+ WIN.set_dir(SOUTH)
if(EAST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = EAST
+ WIN.set_dir(EAST)
if(WEST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = WEST
+ WIN.set_dir(WEST)
if(NORTHWEST)
var/obj/structure/window/reinforced/WIN = new/obj/structure/window/reinforced(get_turf(object))
- WIN.dir = NORTHWEST
+ WIN.set_dir(NORTHWEST)
if(2)
if(pa.Find("left"))
if(ispath(holder.buildmode.objholder,/turf))
@@ -239,7 +239,7 @@
T.ChangeTurf(holder.buildmode.objholder)
else
var/obj/A = new holder.buildmode.objholder (get_turf(object))
- A.dir = holder.builddir.dir
+ A.set_dir(holder.builddir.dir)
else if(pa.Find("right"))
if(isobj(object)) del(object)
diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm
index 24aa1d2a51..babce84126 100644
--- a/code/ZAS/Fire.dm
+++ b/code/ZAS/Fire.dm
@@ -161,7 +161,7 @@ turf/simulated/hotspot_expose(exposed_temperature, exposed_volume, soh)
if(!istype(loc, /turf))
del src
- dir = pick(cardinal)
+ set_dir(pick(cardinal))
SetLuminosity(3)
firelevel = fl
air_master.active_hotspots.Add(src)
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index 4a21302777..d78f3e7a9d 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -623,7 +623,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
//The variables should be apparent enough.
var/atom/movable/overlay/animation = new(location)
if(direction)
- animation.dir = direction
+ animation.set_dir(direction)
animation.icon = a_icon
animation.layer = target:layer+1
if(a_icon_state)
@@ -854,7 +854,7 @@ proc/anim(turf/location as turf,target as mob|obj,a_icon,a_icon_state as text,fl
var/old_icon1 = T.icon
var/turf/X = B.ChangeTurf(T.type)
- X.dir = old_dir1
+ X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
@@ -1027,7 +1027,7 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
continue moving
var/turf/X = new T.type(B)
- X.dir = old_dir1
+ X.set_dir(old_dir1)
X.icon_state = old_icon_state1
X.icon = old_icon1 //Shuttle floors are in shuttle.dmi while the defaults are floors.dmi
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index eadc657a9c..5ab826fa86 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -350,7 +350,5 @@
else
if(dx > 0) direction = EAST
else direction = WEST
- dir = direction
- if(buckled && buckled.movable)
- buckled.dir = direction
- buckled.handle_rotation()
\ No newline at end of file
+ if(direction != dir)
+ facedir(direction)
diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm
index 5037353ff1..6c5da7817a 100644
--- a/code/_onclick/hud/alien_larva.dm
+++ b/code/_onclick/hud/alien_larva.dm
@@ -7,7 +7,7 @@
using = new /obj/screen()
using.name = "mov_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_alien.dmi'
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_acti
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index 8b3fe14134..33a14d2e4d 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -34,7 +34,7 @@
inv_box.icon_state = slot_data["state"]
if(slot_data["dir"])
- inv_box.dir = slot_data["dir"]
+ inv_box.set_dir(slot_data["dir"])
if(slot_data["toggle"])
src.other += inv_box
@@ -58,7 +58,7 @@
using = new /obj/screen()
using.name = "act_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = "intent_"+mymob.a_intent
using.screen_loc = ui_acti
@@ -125,7 +125,7 @@
if(hud_data.has_m_intent)
using = new /obj/screen()
using.name = "mov_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
@@ -160,7 +160,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
- inv_box.dir = WEST
+ inv_box.set_dir(WEST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
@@ -176,7 +176,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
- inv_box.dir = EAST
+ inv_box.set_dir(EAST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
@@ -191,7 +191,7 @@
using = new /obj/screen/inventory()
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
@@ -202,7 +202,7 @@
using = new /obj/screen/inventory()
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
@@ -358,7 +358,7 @@
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
+ mymob.gun_setting_icon.set_dir(2)
mymob.client.screen = null
diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm
index 7ca8216bf2..65924284b5 100644
--- a/code/_onclick/hud/monkey.dm
+++ b/code/_onclick/hud/monkey.dm
@@ -8,7 +8,7 @@
using = new /obj/screen()
using.name = "act_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
@@ -67,7 +67,7 @@
using = new /obj/screen()
using.name = "mov_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = ui_style
using.icon_state = (mymob.m_intent == "run" ? "running" : "walking")
using.screen_loc = ui_movi
@@ -85,7 +85,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "r_hand"
- inv_box.dir = WEST
+ inv_box.set_dir(WEST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
@@ -98,7 +98,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "l_hand"
- inv_box.dir = EAST
+ inv_box.set_dir(EAST)
inv_box.icon = ui_style
inv_box.icon_state = "hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
@@ -111,7 +111,7 @@
using = new /obj/screen/inventory()
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand1"
using.screen_loc = ui_swaphand1
@@ -120,7 +120,7 @@
using = new /obj/screen/inventory()
using.name = "hand"
- using.dir = SOUTH
+ using.set_dir(SOUTH)
using.icon = ui_style
using.icon_state = "hand2"
using.screen_loc = ui_swaphand2
@@ -129,7 +129,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "mask"
- inv_box.dir = NORTH
+ inv_box.set_dir(NORTH)
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_monkey_mask
@@ -139,7 +139,7 @@
inv_box = new /obj/screen/inventory()
inv_box.name = "back"
- inv_box.dir = NORTHEAST
+ inv_box.set_dir(NORTHEAST)
inv_box.icon = ui_style
inv_box.icon_state = "equip"
inv_box.screen_loc = ui_back
@@ -224,19 +224,19 @@
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
+ mymob.gun_setting_icon.set_dir(2)
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
+ mymob.item_use_icon.set_dir(1)
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
+ mymob.gun_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
+ mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm
index c696308d2d..644b811376 100644
--- a/code/_onclick/hud/robot.dm
+++ b/code/_onclick/hud/robot.dm
@@ -11,7 +11,7 @@ var/obj/screen/robot_inventory
//Radio
using = new /obj/screen()
using.name = "radio"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "radio"
using.screen_loc = ui_movi
@@ -22,7 +22,7 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module1"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv1"
using.screen_loc = ui_inv1
@@ -32,7 +32,7 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module2"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv2"
using.screen_loc = ui_inv2
@@ -42,7 +42,7 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module3"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = "inv3"
using.screen_loc = ui_inv3
@@ -55,7 +55,7 @@ var/obj/screen/robot_inventory
//Intent
using = new /obj/screen()
using.name = "act_intent"
- using.dir = SOUTHWEST
+ using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
using.screen_loc = ui_acti
@@ -155,19 +155,19 @@ var/obj/screen/robot_inventory
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
if (mymob.client)
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
- mymob.gun_setting_icon.dir = 2
+ mymob.gun_setting_icon.set_dir(2)
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
if (G.target)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
- mymob.item_use_icon.dir = 1
+ mymob.item_use_icon.set_dir(1)
src.adding += mymob.item_use_icon
mymob.gun_move_icon = new /obj/screen/gun/move(null)
if (mymob.client.target_can_move)
- mymob.gun_move_icon.dir = 1
+ mymob.gun_move_icon.set_dir(1)
mymob.gun_run_icon = new /obj/screen/gun/run(null)
if (mymob.client.target_can_run)
- mymob.gun_run_icon.dir = 1
+ mymob.gun_run_icon.set_dir(1)
src.adding += mymob.gun_run_icon
src.adding += mymob.gun_move_icon
diff --git a/code/_onclick/oldcode.dm b/code/_onclick/oldcode.dm
index 2d52a26390..8585eb8e5f 100644
--- a/code/_onclick/oldcode.dm
+++ b/code/_onclick/oldcode.dm
@@ -23,16 +23,16 @@
if(dy || dx)
if(abs(dx) < abs(dy))
- if(dy > 0) usr.dir = NORTH
- else usr.dir = SOUTH
+ if(dy > 0) usr.set_dir(NORTH)
+ else usr.set_dir(SOUTH)
else
- if(dx > 0) usr.dir = EAST
- else usr.dir = WEST
+ if(dx > 0) usr.set_dir(EAST)
+ else usr.set_dir(WEST)
else
- if(pixel_y > 16) usr.dir = NORTH
- else if(pixel_y < -16) usr.dir = SOUTH
- else if(pixel_x > 16) usr.dir = EAST
- else if(pixel_x < -16) usr.dir = WEST
+ if(pixel_y > 16) usr.set_dir(NORTH)
+ else if(pixel_y < -16) usr.set_dir(SOUTH)
+ else if(pixel_x > 16) usr.set_dir(EAST)
+ else if(pixel_x < -16) usr.set_dir(WEST)
diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm
index 3f74cbd0ea..88c9feca36 100644
--- a/code/_onclick/telekinesis.dm
+++ b/code/_onclick/telekinesis.dm
@@ -167,7 +167,7 @@ var/const/tk_maxrange = 15
O.anchored = 1
O.density = 0
O.layer = FLY_LAYER
- O.dir = pick(cardinal)
+ O.set_dir(pick(cardinal))
O.icon = 'icons/effects/effects.dmi'
O.icon_state = "nothing"
flick("empdisable",O)
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index a51ac42ee2..e69ed4b5dd 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -670,8 +670,8 @@ client
return
switch(href_list["rotatedir"])
- if("right") A.dir = turn(A.dir, -45)
- if("left") A.dir = turn(A.dir, 45)
+ if("right") A.set_dir(turn(A.dir, -45))
+ if("left") A.set_dir(turn(A.dir, 45))
href_list["datumrefresh"] = href_list["rotatedatum"]
else if(href_list["makemonkey"])
diff --git a/code/datums/spells/dumbfire.dm b/code/datums/spells/dumbfire.dm
index 4a466d1663..53df7d1f92 100644
--- a/code/datums/spells/dumbfire.dm
+++ b/code/datums/spells/dumbfire.dm
@@ -43,7 +43,7 @@
projectile:linked_spells += proj_type
projectile.icon = proj_icon
projectile.icon_state = proj_icon_state
- projectile.dir = get_dir(projectile, target)
+ projectile.set_dir(get_dir(projectile, target))
projectile.name = proj_name
var/current_loc = usr.loc
diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm
index 5d5ba5e1f8..9bd1a34f18 100644
--- a/code/datums/spells/projectile.dm
+++ b/code/datums/spells/projectile.dm
@@ -34,7 +34,7 @@
projectile:linked_spells += proj_type
projectile.icon = proj_icon
projectile.icon_state = proj_icon_state
- projectile.dir = get_dir(target,projectile)
+ projectile.set_dir(get_dir(target,projectile))
projectile.name = proj_name
var/current_loc = usr.loc
@@ -47,7 +47,7 @@
if(proj_homing)
if(proj_insubstantial)
- projectile.dir = get_dir(projectile,target)
+ projectile.set_dir(get_dir(projectile,target))
projectile.loc = get_step_to(projectile,target)
else
step_to(projectile,target)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index adaaa5b963..93cb08b5a0 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -138,7 +138,7 @@ its easier to just keep the beam vertical.
//of range or to another z-level, then the beam will stop. Otherwise it will
//continue to draw.
- dir=get_dir(src,BeamTarget) //Causes the source of the beam to rotate to continuosly face the BeamTarget.
+ set_dir(get_dir(src,BeamTarget)) //Causes the source of the beam to rotate to continuosly face the BeamTarget.
for(var/obj/effect/overlay/beam/O in orange(10,src)) //This section erases the previously drawn beam because I found it was easier to
if(O.BeamSource==src) //just draw another instance of the beam instead of trying to manipulate all the
@@ -209,6 +209,11 @@ its easier to just keep the beam vertical.
/atom/proc/relaymove()
return
+//called to set the atom's dir and used to add behaviour to dir-changes
+/atom/proc/set_dir(new_dir)
+ . = new_dir != dir
+ dir = new_dir
+
/atom/proc/ex_act()
return
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index 82c7eb3016..21e8b5d9a9 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -14,16 +14,6 @@
var/moved_recently = 0
var/mob/pulledby = null
-/atom/movable/Move()
- var/atom/A = src.loc
- . = ..()
- src.move_speed = world.time - src.l_move_time
- src.l_move_time = world.time
- src.m_flag = 1
- if ((A != src.loc && A && A.z == src.z))
- src.last_move = get_dir(A, src.loc)
- return
-
/atom/movable/Bump(var/atom/A as mob|obj|turf|area, yes)
if(src.throwing)
src.throw_impact(A)
diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm
index 51b321528e..f6351c8480 100644
--- a/code/game/gamemodes/blob/theblob.dm
+++ b/code/game/gamemodes/blob/theblob.dm
@@ -25,7 +25,7 @@
New(loc, var/h = 30)
blobs += src
src.health = h
- src.dir = pick(1,2,4,8)
+ src.set_dir(pick(1,2,4,8))
src.update_icon()
..(loc)
return
@@ -195,7 +195,7 @@
New(loc, var/h = 10)
src.health = h
- src.dir = pick(1,2,4,8)
+ src.set_dir(pick(1,2,4,8))
src.update_idle()
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index 36137a74a9..50ae7b9fc1 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -30,7 +30,7 @@
if(!the_disk)
icon_state = "pinonnull"
return
- dir = get_dir(src,the_disk)
+ set_dir(get_dir(src,the_disk))
switch(get_dist(src,the_disk))
if(0)
icon_state = "pinondirect"
@@ -79,7 +79,7 @@
if(!location)
icon_state = "pinonnull"
return
- dir = get_dir(src,location)
+ set_dir(get_dir(src,location))
switch(get_dist(src,location))
if(0)
icon_state = "pinondirect"
@@ -98,7 +98,7 @@
if(!target)
icon_state = "pinonnull"
return
- dir = get_dir(src,target)
+ set_dir(get_dir(src,target))
switch(get_dist(src,target))
if(0)
icon_state = "pinondirect"
@@ -215,7 +215,7 @@
// if(loc.z != the_disk.z) //If you are on a different z-level from the disk
// icon_state = "pinonnull"
// else
- dir = get_dir(src, the_disk)
+ set_dir(get_dir(src, the_disk))
switch(get_dist(src, the_disk))
if(0)
icon_state = "pinondirect"
@@ -248,7 +248,7 @@
if(loc.z != home.z) //If you are on a different z-level from the shuttle
icon_state = "pinonnull"
else
- dir = get_dir(src, home)
+ set_dir(get_dir(src, home))
switch(get_dist(src, home))
if(0)
icon_state = "pinondirect"
diff --git a/code/game/jobs/job/civilian_chaplain.dm b/code/game/jobs/job/civilian_chaplain.dm
index d7b4b1f96c..34fe340a12 100644
--- a/code/game/jobs/job/civilian_chaplain.dm
+++ b/code/game/jobs/job/civilian_chaplain.dm
@@ -84,7 +84,7 @@
for(var/area/chapel/main/A in world)
for(var/turf/T in A.contents)
if(T.icon_state == "carpetsymbol")
- T.dir = 4
+ T.set_dir(4)
if("Scrapbook")
B.icon_state = "scrapbook"
B.item_state = "scrapbook"
@@ -103,7 +103,7 @@
for(var/area/chapel/main/A in world)
for(var/turf/T in A.contents)
if(T.icon_state == "carpetsymbol")
- T.dir = 10
+ T.set_dir(10)
if("Tome")
B.icon_state = "tome"
B.item_state = "syringe_kit"
@@ -119,7 +119,7 @@
for(var/area/chapel/main/A in world)
for(var/turf/T in A.contents)
if(T.icon_state == "carpetsymbol")
- T.dir = 8
+ T.set_dir(8)
if("the bible melts")
B.icon_state = "melted"
B.item_state = "melted"
@@ -133,7 +133,7 @@
for(var/area/chapel/main/A in world)
for(var/turf/T in A.contents)
if(T.icon_state == "carpetsymbol")
- T.dir = 2
+ T.set_dir(2)
H.update_inv_l_hand() // so that it updates the bible's item_state in his hand
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index e87b3c36ec..326f705a5d 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -422,7 +422,7 @@ var/global/datum/controller/occupations/job_master
// Moving wheelchair if they have one
if(H.buckled && istype(H.buckled, /obj/structure/stool/bed/chair/wheelchair))
H.buckled.loc = H.loc
- H.buckled.dir = H.dir
+ H.buckled.set_dir(H.dir)
//give them an account in the station database
var/datum/money_account/M = create_account(H.real_name, rand(50,500)*10, null)
@@ -516,7 +516,7 @@ var/global/datum/controller/occupations/job_master
var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair(H.loc)
H.buckled = W
H.update_canmove()
- W.dir = H.dir
+ W.set_dir(H.dir)
W.buckled_mob = H
W.add_fingerprint(H)
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index f8074755a8..0c7e738cff 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -104,7 +104,7 @@
src.loc = loc
if(dir)
- src.dir = dir
+ src.set_dir(dir)
buildstage = 0
wiresexposed = 1
@@ -1274,7 +1274,7 @@ FIRE ALARM
src.loc = loc
if(dir)
- src.dir = dir
+ src.set_dir(dir)
if(building)
buildstage = 0
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 9f98f89dee..c4007c6994 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -120,7 +120,7 @@
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
+ pulse2.set_dir(pick(cardinal))
spawn(10)
pulse2.delete()
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index a2436f9de4..e7f766a5b4 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -526,14 +526,14 @@
var/obj/effect/decal/cleanable/blood/tracks/B = new(loc)
var/newdir = get_dir(next, loc)
if(newdir == dir)
- B.dir = newdir
+ B.set_dir(newdir)
else
newdir = newdir | dir
if(newdir == 3)
newdir = 1
else if(newdir == 12)
newdir = 4
- B.dir = newdir
+ B.set_dir(newdir)
bloodiness--
diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm
index 84f3efb167..744c246851 100644
--- a/code/game/machinery/bots/secbot.dm
+++ b/code/game/machinery/bots/secbot.dm
@@ -878,7 +878,7 @@ Auto Patrol: []"},
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
+ pulse2.set_dir(pick(cardinal))
spawn(10)
pulse2.delete()
var/list/mob/living/carbon/targets = new
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 140659a0e5..4b60d58a3f 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -234,13 +234,13 @@
//If someone knows a better way to do this, let me know. -Giacom
switch(i)
if(NORTH)
- src.dir = SOUTH
+ src.set_dir(SOUTH)
if(SOUTH)
- src.dir = NORTH
+ src.set_dir(NORTH)
if(WEST)
- src.dir = EAST
+ src.set_dir(EAST)
if(EAST)
- src.dir = WEST
+ src.set_dir(WEST)
break
//Return a working camera that can see a given mob
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 4e5b64c631..03fa91212f 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -294,7 +294,7 @@ obj/item/weapon/circuitboard/rdserver
/obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U)
//TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up.
- U.dir = src.machine_dir
+ U.set_dir(src.machine_dir)
U.initialize_directions = src.init_dirs
U.initialize()
U.build_network()
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index bb23176478..7328c7b8f3 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -899,7 +899,7 @@ About the new airlock wires panel:
var/obj/structure/door_assembly/da = new assembly_type(src.loc)
if (istype(da, /obj/structure/door_assembly/multi_tile))
- da.dir = src.dir
+ da.set_dir(src.dir)
da.anchored = 1
if(mineral)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index 37966deea6..720fbdc822 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -29,7 +29,7 @@
var/hitsound = 'sound/weapons/smash.ogg' //sound door makes when hit with a weapon
//Multi-tile doors
- dir = EAST
+ set_dir(EAST)
var/width = 1
/obj/machinery/door/New()
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index f2e8168485..209b993788 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -194,7 +194,7 @@
wa.name = "Wired Windoor Assembly"
if (src.base_state == "right" || src.base_state == "rightsecure")
wa.facing = "r"
- wa.dir = src.dir
+ wa.set_dir(src.dir)
wa.state = "02"
wa.update_icon()
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index fab5bbea6e..b7cf118287 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -152,7 +152,7 @@ Class Procs:
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
+ pulse2.set_dir(pick(cardinal))
spawn(10)
pulse2.delete()
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 205cc1cede..210948bbd3 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -67,7 +67,7 @@ Buildable meters
/obj/item/pipe/New(var/loc, var/pipe_type as num, var/dir as num, var/obj/machinery/atmospherics/make_from = null)
..()
if (make_from)
- src.dir = make_from.dir
+ src.set_dir(make_from.dir)
src.pipename = make_from.name
color = make_from.pipe_color
var/is_bent
@@ -180,7 +180,7 @@ Buildable meters
///// Z-Level stuff
else
src.pipe_type = pipe_type
- src.dir = dir
+ src.set_dir(dir)
if (pipe_type == 29 || pipe_type == 30 || pipe_type == 33 || pipe_type == 35 || pipe_type == 37 || pipe_type == 39 || pipe_type == 41)
connect_types = list(2)
src.color = PIPE_COLOR_BLUE
@@ -314,28 +314,28 @@ Buildable meters
if ( usr.stat || usr.restrained() )
return
- src.dir = turn(src.dir, -90)
+ src.set_dir(turn(src.dir, -90))
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
- dir = 1
+ set_dir(1)
else if(dir==8)
- dir = 4
+ set_dir(4)
else if (pipe_type in list (PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W))
- dir = 2
- //src.pipe_dir = get_pipe_dir()
+ set_dir(2)
+ //src.pipe_set_dir(get_pipe_dir())
return
/obj/item/pipe/Move()
..()
if ((pipe_type in list (PIPE_SIMPLE_BENT, PIPE_SUPPLY_BENT, PIPE_SCRUBBERS_BENT, PIPE_HE_BENT, PIPE_INSULATED_BENT)) \
&& (src.dir in cardinal))
- src.dir = src.dir|turn(src.dir, 90)
+ src.set_dir(src.dir|turn(src.dir, 90))
else if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_UNIVERSAL, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
- dir = 1
+ set_dir(1)
else if(dir==8)
- dir = 4
+ set_dir(4)
return
// returns all pipe's endpoints
@@ -427,11 +427,11 @@ Buildable meters
return 1
if (pipe_type in list (PIPE_SIMPLE_STRAIGHT, PIPE_SUPPLY_STRAIGHT, PIPE_SCRUBBERS_STRAIGHT, PIPE_HE_STRAIGHT, PIPE_INSULATED_STRAIGHT, PIPE_MVALVE))
if(dir==2)
- dir = 1
+ set_dir(1)
else if(dir==8)
- dir = 4
+ set_dir(4)
else if (pipe_type in list(PIPE_MANIFOLD4W, PIPE_SUPPLY_MANIFOLD4W, PIPE_SCRUBBERS_MANIFOLD4W, PIPE_OMNI_MIXER, PIPE_OMNI_FILTER))
- dir = 2
+ set_dir(2)
var/pipe_dir = get_pipe_dir()
for(var/obj/machinery/atmospherics/M in src.loc)
@@ -447,7 +447,7 @@ Buildable meters
if(PIPE_SIMPLE_STRAIGHT, PIPE_SIMPLE_BENT)
var/obj/machinery/atmospherics/pipe/simple/P = new( src.loc )
P.pipe_color = color
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
@@ -466,7 +466,7 @@ Buildable meters
if(PIPE_SUPPLY_STRAIGHT, PIPE_SUPPLY_BENT)
var/obj/machinery/atmospherics/pipe/simple/hidden/supply/P = new( src.loc )
P.color = color
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
@@ -485,7 +485,7 @@ Buildable meters
if(PIPE_SCRUBBERS_STRAIGHT, PIPE_SCRUBBERS_BENT)
var/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers/P = new( src.loc )
P.color = color
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
@@ -504,7 +504,7 @@ Buildable meters
if(PIPE_UNIVERSAL)
var/obj/machinery/atmospherics/pipe/simple/hidden/universal/P = new( src.loc )
P.color = color
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
@@ -522,7 +522,7 @@ Buildable meters
if(PIPE_HE_STRAIGHT, PIPE_HE_BENT)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/P = new ( src.loc )
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir //this var it's used to know if the pipe is bent or not
P.initialize_directions_he = pipe_dir
//var/turf/T = P.loc
@@ -541,7 +541,7 @@ Buildable meters
if(PIPE_CONNECTOR) // connector
var/obj/machinery/atmospherics/portables_connector/C = new( src.loc )
- C.dir = dir
+ C.set_dir(dir)
C.initialize_directions = pipe_dir
if (pipename)
C.name = pipename
@@ -557,7 +557,7 @@ Buildable meters
if(PIPE_MANIFOLD) //manifold
var/obj/machinery/atmospherics/pipe/manifold/M = new( src.loc )
M.pipe_color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
@@ -580,7 +580,7 @@ Buildable meters
if(PIPE_SUPPLY_MANIFOLD) //manifold
var/obj/machinery/atmospherics/pipe/manifold/hidden/supply/M = new( src.loc )
M.color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
@@ -603,7 +603,7 @@ Buildable meters
if(PIPE_SCRUBBERS_MANIFOLD) //manifold
var/obj/machinery/atmospherics/pipe/manifold/hidden/scrubbers/M = new( src.loc )
M.color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
@@ -626,7 +626,7 @@ Buildable meters
if(PIPE_MANIFOLD4W) //4-way manifold
var/obj/machinery/atmospherics/pipe/manifold4w/M = new( src.loc )
M.pipe_color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
//M.New()
var/turf/T = M.loc
@@ -652,7 +652,7 @@ Buildable meters
if(PIPE_SUPPLY_MANIFOLD4W) //4-way manifold
var/obj/machinery/atmospherics/pipe/manifold4w/hidden/supply/M = new( src.loc )
M.color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
M.connect_types = src.connect_types
//M.New()
@@ -679,7 +679,7 @@ Buildable meters
if(PIPE_SCRUBBERS_MANIFOLD4W) //4-way manifold
var/obj/machinery/atmospherics/pipe/manifold4w/hidden/scrubbers/M = new( src.loc )
M.color = color
- M.dir = dir
+ M.set_dir(dir)
M.initialize_directions = pipe_dir
M.connect_types = src.connect_types
//M.New()
@@ -705,7 +705,7 @@ Buildable meters
if(PIPE_JUNCTION)
var/obj/machinery/atmospherics/pipe/simple/heat_exchanging/junction/P = new ( src.loc )
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = src.get_pdir()
P.initialize_directions_he = src.get_hdir()
//var/turf/T = P.loc
@@ -724,7 +724,7 @@ Buildable meters
if(PIPE_UVENT) //unary vent
var/obj/machinery/atmospherics/unary/vent_pump/V = new( src.loc )
- V.dir = dir
+ V.set_dir(dir)
V.initialize_directions = pipe_dir
if (pipename)
V.name = pipename
@@ -739,7 +739,7 @@ Buildable meters
if(PIPE_MVALVE) //manual valve
var/obj/machinery/atmospherics/valve/V = new( src.loc)
- V.dir = dir
+ V.set_dir(dir)
V.initialize_directions = pipe_dir
if (pipename)
V.name = pipename
@@ -758,7 +758,7 @@ Buildable meters
if(PIPE_PUMP) //gas pump
var/obj/machinery/atmospherics/binary/pump/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -775,7 +775,7 @@ Buildable meters
if(PIPE_GAS_FILTER) //gas filter
var/obj/machinery/atmospherics/trinary/filter/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -795,7 +795,7 @@ Buildable meters
if(PIPE_GAS_MIXER) //gas mixer
var/obj/machinery/atmospherics/trinary/mixer/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -815,7 +815,7 @@ Buildable meters
if(PIPE_GAS_FILTER_M) //gas filter mirrored
var/obj/machinery/atmospherics/trinary/filter/m_filter/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -835,7 +835,7 @@ Buildable meters
if(PIPE_GAS_MIXER_T) //gas mixer-t
var/obj/machinery/atmospherics/trinary/mixer/t_mixer/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -855,7 +855,7 @@ Buildable meters
if(PIPE_GAS_MIXER_M) //gas mixer mirrored
var/obj/machinery/atmospherics/trinary/mixer/m_mixer/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -875,7 +875,7 @@ Buildable meters
if(PIPE_SCRUBBER) //scrubber
var/obj/machinery/atmospherics/unary/vent_scrubber/S = new(src.loc)
- S.dir = dir
+ S.set_dir(dir)
S.initialize_directions = pipe_dir
if (pipename)
S.name = pipename
@@ -889,7 +889,7 @@ Buildable meters
if(PIPE_INSULATED_STRAIGHT, PIPE_INSULATED_BENT)
var/obj/machinery/atmospherics/pipe/simple/insulated/P = new( src.loc )
- P.dir = src.dir
+ P.set_dir(src.dir)
P.initialize_directions = pipe_dir
var/turf/T = P.loc
P.level = T.intact ? 2 : 1
@@ -907,7 +907,7 @@ Buildable meters
if(PIPE_MTVALVE) //manual t-valve
var/obj/machinery/atmospherics/tvalve/V = new(src.loc)
- V.dir = dir
+ V.set_dir(dir)
V.initialize_directions = pipe_dir
if (pipename)
V.name = pipename
@@ -927,7 +927,7 @@ Buildable meters
if(PIPE_CAP)
var/obj/machinery/atmospherics/pipe/cap/C = new(src.loc)
- C.dir = dir
+ C.set_dir(dir)
C.initialize_directions = pipe_dir
C.initialize()
C.build_network()
@@ -937,7 +937,7 @@ Buildable meters
if(PIPE_SUPPLY_CAP)
var/obj/machinery/atmospherics/pipe/cap/hidden/supply/C = new(src.loc)
- C.dir = dir
+ C.set_dir(dir)
C.initialize_directions = pipe_dir
C.initialize()
C.build_network()
@@ -947,7 +947,7 @@ Buildable meters
if(PIPE_SCRUBBERS_CAP)
var/obj/machinery/atmospherics/pipe/cap/hidden/scrubbers/C = new(src.loc)
- C.dir = dir
+ C.set_dir(dir)
C.initialize_directions = pipe_dir
C.initialize()
C.build_network()
@@ -957,7 +957,7 @@ Buildable meters
if(PIPE_PASSIVE_GATE) //passive gate
var/obj/machinery/atmospherics/binary/passive_gate/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -974,7 +974,7 @@ Buildable meters
if(PIPE_VOLUME_PUMP) //volume pump
var/obj/machinery/atmospherics/binary/pump/high_power/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -991,7 +991,7 @@ Buildable meters
if(PIPE_HEAT_EXCHANGE) // heat exchanger
var/obj/machinery/atmospherics/unary/heat_exchanger/C = new( src.loc )
- C.dir = dir
+ C.set_dir(dir)
C.initialize_directions = pipe_dir
if (pipename)
C.name = pipename
@@ -1005,7 +1005,7 @@ Buildable meters
///// Z-Level stuff
if(PIPE_UP)
var/obj/machinery/atmospherics/pipe/zpipe/up/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -1021,7 +1021,7 @@ Buildable meters
P.node2.build_network()
if(PIPE_DOWN)
var/obj/machinery/atmospherics/pipe/zpipe/down/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -1037,7 +1037,7 @@ Buildable meters
P.node2.build_network()
if(PIPE_SUPPLY_UP)
var/obj/machinery/atmospherics/pipe/zpipe/up/supply/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -1053,7 +1053,7 @@ Buildable meters
P.node2.build_network()
if(PIPE_SUPPLY_DOWN)
var/obj/machinery/atmospherics/pipe/zpipe/down/supply/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -1069,7 +1069,7 @@ Buildable meters
P.node2.build_network()
if(PIPE_SCRUBBERS_UP)
var/obj/machinery/atmospherics/pipe/zpipe/up/scrubbers/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
@@ -1085,7 +1085,7 @@ Buildable meters
P.node2.build_network()
if(PIPE_SCRUBBERS_DOWN)
var/obj/machinery/atmospherics/pipe/zpipe/down/scrubbers/P = new(src.loc)
- P.dir = dir
+ P.set_dir(dir)
P.initialize_directions = pipe_dir
if (pipename)
P.name = pipename
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index b0b8df60c8..8acc0726a4 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -525,7 +525,7 @@
if(target && (target.stat != DEAD) && (!(target.lying) || emagged))
spawn()
popUp() //pop the turret up if it's not already up.
- dir = get_dir(src, target) //even if you can't shoot, follow the target
+ set_dir(get_dir(src, target)) //even if you can't shoot, follow the target
spawn()
shootAt(target)
return 1
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index acd89ee17c..b014ece92a 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -25,11 +25,11 @@
if(istype(station))
station.com = hub
- station.dir = dir
+ station.set_dir(dir)
if(istype(hub))
hub.com = src
- hub.dir = dir
+ hub.set_dir(dir)
/obj/machinery/computer/teleporter/attackby(I as obj, mob/living/user as mob)
if(istype(I, /obj/item/weapon/card/data/))
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 567afc0d6d..29811e1a18 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -232,7 +232,7 @@
/obj/machinery/turret/proc/target()
while(src && enabled && !stat && check_target(cur_target))
- src.dir = get_dir(src, cur_target)
+ src.set_dir(get_dir(src, cur_target))
shootAt(cur_target)
sleep(shot_delay)
return
@@ -487,7 +487,7 @@
if(!target)
cur_target = null
return
- src.dir = get_dir(src,target)
+ src.set_dir(get_dir(src,target))
var/turf/targloc = get_turf(target)
var/target_x = targloc.x
var/target_y = targloc.y
diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm
index 6857891381..470159e06f 100644
--- a/code/game/mecha/equipment/tools/unused_tools.dm
+++ b/code/game/mecha/equipment/tools/unused_tools.dm
@@ -61,7 +61,7 @@
if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST))
move_result = step_rand(chassis)
else if(chassis.dir!=direction)
- chassis.dir = direction
+ chassis.set_dir(direction)
move_result = 1
else
move_result = step(chassis,direction)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index c8f8f261a2..031077d2ea 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -316,7 +316,7 @@
return 0
/obj/mecha/proc/mechturn(direction)
- dir = direction
+ set_dir(direction)
playsound(src,'sound/mecha/mechturn.ogg',40,1)
return 1
@@ -1014,7 +1014,7 @@
src.forceMove(src.loc)
src.log_append_to_last("[H] moved in as pilot.")
src.icon_state = src.reset_icon()
- dir = dir_in
+ set_dir(dir_in)
playsound(src, 'sound/machines/windowdoor.ogg', 50, 1)
if(!hasInternalDamage())
src.occupant << sound('sound/mecha/nominal.ogg',volume=50)
@@ -1073,7 +1073,7 @@
src.Entered(mmi_as_oc)
src.Move(src.loc)
src.icon_state = src.reset_icon()
- dir = dir_in
+ set_dir(dir_in)
src.log_message("[mmi_as_oc] moved in as pilot.")
if(!hasInternalDamage())
src.occupant << sound('sound/mecha/nominal.ogg',volume=50)
@@ -1162,7 +1162,7 @@
src.verbs += /obj/mecha/verb/eject
src.occupant = null
src.icon_state = src.reset_icon()+"-open"
- src.dir = dir_in
+ src.set_dir(dir_in)
return
/////////////////////////
diff --git a/code/game/mecha/medical/medical.dm b/code/game/mecha/medical/medical.dm
index 7fe4c45695..027c9f84af 100644
--- a/code/game/mecha/medical/medical.dm
+++ b/code/game/mecha/medical/medical.dm
@@ -7,7 +7,7 @@
/obj/mecha/medical/mechturn(direction)
- dir = direction
+ set_dir(direction)
playsound(src,'sound/mecha/mechmove01.ogg',40,1)
return 1
diff --git a/code/game/mecha/working/hoverpod.dm b/code/game/mecha/working/hoverpod.dm
index 5f775d619b..5736e00b4f 100644
--- a/code/game/mecha/working/hoverpod.dm
+++ b/code/game/mecha/working/hoverpod.dm
@@ -56,7 +56,7 @@
//these three procs overriden to play different sounds
/obj/mecha/working/hoverpod/mechturn(direction)
- dir = direction
+ set_dir(direction)
//playsound(src,'sound/machines/hiss.ogg',40,1)
return 1
diff --git a/code/game/objects/effects/biomass_rift.dm b/code/game/objects/effects/biomass_rift.dm
index 247f485b57..c619ccb1e7 100644
--- a/code/game/objects/effects/biomass_rift.dm
+++ b/code/game/objects/effects/biomass_rift.dm
@@ -30,7 +30,7 @@
if(!IsValidBiomassLoc(T))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
- starting.dir = get_dir(src,starting)
+ starting.set_dir(get_dir(src,starting))
starting.originalRift = src
linkedBiomass += starting
spawn(1) //DEBUG
@@ -53,13 +53,13 @@
return
switch(dir)
if(NORTHWEST)
- dir = NORTH
+ set_dir(NORTH)
if(NORTHEAST)
- dir = EAST
+ set_dir(EAST)
if(SOUTHWEST)
- dir = WEST
+ set_dir(WEST)
if(SOUTHEAST)
- dir = SOUTH
+ set_dir(SOUTH)
sleep(spreadDelay)
Spread()
@@ -93,7 +93,7 @@
var/obj/effect/biomass/newBiomass = new /obj/effect/biomass(get_step(src,direction))
newBiomass.curDistance = curDistance + 1
newBiomass.maxDistance = maxDistance
- newBiomass.dir = direction
+ newBiomass.set_dir(direction)
newBiomass.originalRift = originalRift
newBiomass.icon_state = "[originalRift.newicon]" //DEBUG
originalRift.linkedBiomass += newBiomass
@@ -110,7 +110,7 @@
if(!IsValidBiomassLoc(T,src))
continue
var/obj/effect/biomass/starting = new /obj/effect/biomass(T)
- starting.dir = get_dir(src,starting)
+ starting.set_dir(get_dir(src,starting))
starting.maxDistance = maxDistance
/proc/IsValidBiomassLoc(turf/location,obj/effect/biomass/source = null)
diff --git a/code/game/objects/effects/chemsmoke.dm b/code/game/objects/effects/chemsmoke.dm
index fb9b049a3e..e62623e2ec 100644
--- a/code/game/objects/effects/chemsmoke.dm
+++ b/code/game/objects/effects/chemsmoke.dm
@@ -192,7 +192,7 @@
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
smoke.icon = I
smoke.layer = 6
- smoke.dir = pick(cardinal)
+ smoke.set_dir(pick(cardinal))
smoke.pixel_x = -32 + rand(-8,8)
smoke.pixel_y = -32 + rand(-8,8)
walk_to(smoke, T)
diff --git a/code/game/objects/effects/decals/Cleanable/fuel.dm b/code/game/objects/effects/decals/Cleanable/fuel.dm
index 6b7ef0242e..5162d0f6df 100644
--- a/code/game/objects/effects/decals/Cleanable/fuel.dm
+++ b/code/game/objects/effects/decals/Cleanable/fuel.dm
@@ -40,7 +40,7 @@ obj/effect/decal/cleanable/liquid_fuel
icon_state = "mustard"
anchored = 0
New(newLoc, amt = 1, d = 0)
- dir = d //Setting this direction means you won't get torched by your own flamethrower.
+ set_dir(d) //Setting this direction means you won't get torched by your own flamethrower.
. = ..()
Spread()
diff --git a/code/game/objects/effects/effect_system.dm b/code/game/objects/effects/effect_system.dm
index 5b209e0423..db7abda850 100644
--- a/code/game/objects/effects/effect_system.dm
+++ b/code/game/objects/effects/effect_system.dm
@@ -402,7 +402,7 @@ steam.start() -- spawns the effect
if(istype(T, /turf/space))
var/obj/effect/effect/ion_trails/I = new /obj/effect/effect/ion_trails(src.oldposition)
src.oldposition = T
- I.dir = src.holder.dir
+ I.set_dir(src.holder.dir)
flick("ion_fade", I)
I.icon_state = "blank"
spawn( 20 )
@@ -449,7 +449,7 @@ steam.start() -- spawns the effect
var/obj/effect/effect/steam/I = new /obj/effect/effect/steam(src.oldposition)
src.number++
src.oldposition = get_turf(holder)
- I.dir = src.holder.dir
+ I.set_dir(src.holder.dir)
spawn(10)
I.delete()
src.number--
diff --git a/code/game/objects/effects/glowshroom.dm b/code/game/objects/effects/glowshroom.dm
index 68285d4f98..f7a6795e84 100644
--- a/code/game/objects/effects/glowshroom.dm
+++ b/code/game/objects/effects/glowshroom.dm
@@ -28,7 +28,7 @@
..()
- dir = CalcDir()
+ set_dir(CalcDir())
if(!floor)
switch(dir) //offset to make it be on the wall rather than on the floor
diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm
index cd9142bdc0..59a71ddaa8 100644
--- a/code/game/objects/effects/step_triggers.dm
+++ b/code/game/objects/effects/step_triggers.dm
@@ -71,7 +71,7 @@
var/predir = AM.dir
step(AM, direction)
if(!facedir)
- AM.dir = predir
+ AM.set_dir(predir)
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index b97ef5746c..af350bd56b 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -95,7 +95,7 @@
icon = new_icon
icon_state = new_iconstate
overlays = new_overlays
- dir = O.dir
+ set_dir(O.dir)
M.loc = src
master = C
master.active_dummy = src
diff --git a/code/game/objects/items/devices/floor_painter.dm b/code/game/objects/items/devices/floor_painter.dm
index d0bb6b93c0..27b4054fa5 100644
--- a/code/game/objects/items/devices/floor_painter.dm
+++ b/code/game/objects/items/devices/floor_painter.dm
@@ -29,7 +29,7 @@
switch(tile_dir_mode)
if(1) // All directions accepted
- F.dir = D
+ F.set_dir(D)
F.icon_state = mode
if(2) // Corner mode - diagonal directions converted CW around.
switch(D)
@@ -41,7 +41,7 @@
D = WEST
if(NORTHWEST)
D = NORTH
- F.dir = D
+ F.set_dir(D)
F.icon_state = mode
if(3) // cardinal directions only. I've adjusted diagonals the same way the facing code does.
switch(D)
@@ -53,7 +53,7 @@
D = WEST
if(NORTHWEST)
D = WEST
- F.dir = D
+ F.set_dir(D)
F.icon_state = mode
if(4) // floors.dmi icon_states "warningcorner" and "warnwhitecorner" are incorrect, this fixes it
var/D2
@@ -66,16 +66,16 @@
D2 = NORTH
if(NORTHWEST)
D2 = EAST
- F.dir = D2
+ F.set_dir(D2)
F.icon_state = mode
if(5)
- F.dir = 0
+ F.set_dir(0)
if(D == NORTH || D == SOUTH || D == NORTHEAST || D == SOUTHWEST)
F.icon_state = mode
else
F.icon_state = "[mode]_inv"
else
- F.dir = 0
+ F.set_dir(0)
F.icon_state = mode
else
usr << "You can't paint that!"
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index 54c159d8db..2f0b67d31d 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -116,7 +116,7 @@
if(Proj.damage >= 20 || istype(Proj, /obj/item/projectile/beam/practice))
bmark.icon_state = "scorch"
- bmark.dir = pick(NORTH,SOUTH,EAST,WEST) // random scorch design
+ bmark.set_dir(pick(NORTH,SOUTH,EAST,WEST)) // random scorch design
else
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index aa93aec8ba..c3fa049b17 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -131,7 +131,7 @@
if (src.amount < R.req_amount*multiplier)
return
var/atom/O = new R.result_type( usr.loc )
- O.dir = usr.dir
+ O.set_dir(usr.dir)
if (R.max_res_amount>1)
var/obj/item/stack/new_item = O
new_item.amount = R.res_amount*multiplier
diff --git a/code/game/objects/items/weapons/grenades/grenade.dm b/code/game/objects/items/weapons/grenades/grenade.dm
index 2ff3114423..46854c6a2a 100644
--- a/code/game/objects/items/weapons/grenades/grenade.dm
+++ b/code/game/objects/items/weapons/grenades/grenade.dm
@@ -35,7 +35,7 @@
spawn(det_time)
prime()
return
- user.dir = get_dir(user, target)
+ user.set_dir(get_dir(user, target))
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 6bb08bb451..70485e67a2 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -169,7 +169,7 @@
if((wielded) && prob(50))
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2))
- user.dir = i
+ user.set_dir(i)
sleep(1)
/obj/item/weapon/twohanded/dualsaber/IsShield()
diff --git a/code/game/objects/structures/electricchair.dm b/code/game/objects/structures/electricchair.dm
index 2330e63ecc..28d9ebc623 100644
--- a/code/game/objects/structures/electricchair.dm
+++ b/code/game/objects/structures/electricchair.dm
@@ -15,7 +15,7 @@
if(istype(W, /obj/item/weapon/wrench))
var/obj/structure/stool/bed/chair/C = new /obj/structure/stool/bed/chair(loc)
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
- C.dir = dir
+ C.set_dir(dir)
part.loc = loc
part.master = null
part = null
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index b12a1a74d0..535b73d3b5 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -170,14 +170,14 @@
/obj/structure/stool/bed/chair/janicart/New()
- handle_rotation()
create_reagents(100)
+ update_layer()
/obj/structure/stool/bed/chair/janicart/examine(mob/user)
if(!..(user, 1))
return
-
+
user << "\icon[src] This [callme] contains [reagents.total_volume] unit\s of water!"
if(mybag)
user << "\A [mybag] is hanging on the [callme]."
@@ -215,7 +215,6 @@
if(istype(user.l_hand, /obj/item/key) || istype(user.r_hand, /obj/item/key))
step(src, direction)
update_mob()
- handle_rotation()
else
user << "You'll need the keys in one of your hands to drive this [callme]."
@@ -238,13 +237,20 @@
"You climb onto the [callme]!")
M.buckled = src
M.loc = loc
- M.dir = dir
+ M.set_dir(dir)
M.update_canmove()
buckled_mob = M
update_mob()
add_fingerprint(user)
+/obj/structure/stool/bed/chair/janicart/update_layer()
+ if(dir == SOUTH)
+ layer = FLY_LAYER
+ else
+ layer = OBJ_LAYER
+
+
/obj/structure/stool/bed/chair/janicart/unbuckle()
if(buckled_mob)
buckled_mob.pixel_x = 0
@@ -252,12 +258,9 @@
..()
-/obj/structure/stool/bed/chair/janicart/handle_rotation()
- if(dir == SOUTH)
- layer = FLY_LAYER
- else
- layer = OBJ_LAYER
-
+/obj/structure/stool/bed/chair/janicart/set_dir()
+ ..()
+ update_layer()
if(buckled_mob)
if(buckled_mob.loc != loc)
buckled_mob.buckled = null //Temporary, so Move() succeeds.
@@ -268,7 +271,7 @@
/obj/structure/stool/bed/chair/janicart/proc/update_mob()
if(buckled_mob)
- buckled_mob.dir = dir
+ buckled_mob.set_dir(dir)
switch(dir)
if(SOUTH)
buckled_mob.pixel_x = 0
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 3db68575c9..e1c8427ecf 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -77,7 +77,7 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.connected.loc
src.connected.icon_state = "morguet"
- src.connected.dir = src.dir
+ src.connected.set_dir(src.dir)
else
//src.connected = null
del(src.connected)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
index 3c5bbfc1ca..3d21575c74 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
@@ -56,7 +56,7 @@
"You hear squelching...")
M.buckled = src
M.loc = src.loc
- M.dir = src.dir
+ M.set_dir(src.dir)
M.update_canmove()
M.pixel_y = 6
M.old_y = 6
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index a3f99324b7..8902dbc8ec 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -33,9 +33,6 @@
manual_unbuckle(user)
return
-/obj/structure/stool/bed/proc/handle_rotation()
- return
-
/obj/structure/stool/bed/MouseDrop(atom/over_object)
return
@@ -104,7 +101,7 @@
"You hear metal clanking")
M.buckled = src
M.loc = src.loc
- M.dir = src.dir
+ M.set_dir(src.dir)
M.update_canmove()
src.buckled_mob = M
src.add_fingerprint(user)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index 5db6d2f206..0e8e7d5850 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -11,7 +11,7 @@
/obj/structure/stool/bed/chair/New()
..()
spawn(3) //sorry. i don't think there's a better way to do this.
- handle_rotation()
+ update_layer()
return
/obj/structure/stool/bed/chair/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -24,7 +24,7 @@
user.drop_item()
var/obj/structure/stool/bed/chair/e_chair/E = new /obj/structure/stool/bed/chair/e_chair(src.loc)
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
- E.dir = dir
+ E.set_dir(dir)
E.part = SK
SK.loc = E
SK.master = E
@@ -37,13 +37,17 @@
rotate()
return
-/obj/structure/stool/bed/chair/handle_rotation() //making this into a seperate proc so office chairs can call it on Move()
+/obj/structure/stool/bed/chair/proc/update_layer()
if(src.dir == NORTH)
src.layer = FLY_LAYER
else
src.layer = OBJ_LAYER
+
+/obj/structure/stool/bed/chair/set_dir()
+ ..()
+ update_layer()
if(buckled_mob)
- buckled_mob.dir = dir
+ buckled_mob.set_dir(dir)
/obj/structure/stool/bed/chair/verb/rotate()
set name = "Rotate Chair"
@@ -51,8 +55,7 @@
set src in oview(1)
if(config.ghost_interaction)
- src.dir = turn(src.dir, 90)
- handle_rotation()
+ src.set_dir(turn(src.dir, 90))
return
else
if(istype(usr,/mob/living/simple_animal/mouse))
@@ -62,8 +65,7 @@
if(usr.stat || usr.restrained())
return
- src.dir = turn(src.dir, 90)
- handle_rotation()
+ src.set_dir(turn(src.dir, 90))
return
/obj/structure/stool/bed/chair/MouseDrop_T(mob/M as mob, mob/user as mob)
@@ -142,7 +144,6 @@
Bump(O)
else
unbuckle()
- handle_rotation()
/obj/structure/stool/bed/chair/office/Bump(atom/A)
..()
diff --git a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
index 8e801de6e2..0ed780ebdd 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
@@ -10,12 +10,13 @@
var/bloodiness
-/obj/structure/stool/bed/chair/wheelchair/handle_rotation()
+/obj/structure/stool/bed/chair/wheelchair/set_dir()
+ ..()
overlays = null
var/image/O = image(icon = 'icons/obj/objects.dmi', icon_state = "w_overlay", layer = FLY_LAYER, dir = src.dir)
overlays += O
if(buckled_mob)
- buckled_mob.dir = dir
+ buckled_mob.set_dir(dir)
/obj/structure/stool/bed/chair/wheelchair/relaymove(mob/user, direction)
// Redundant check?
@@ -64,8 +65,7 @@
step(src, direction)
if(buckled_mob) // Make sure it stays beneath the occupant
Move(buckled_mob.loc)
- dir = direction
- handle_rotation()
+ set_dir(direction)
if(pulling) // Driver
if(pulling.loc == src.loc) // We moved onto the wheelchair? Revert!
pulling.loc = T
@@ -74,7 +74,7 @@
if(get_dist(src, pulling) > 1) // We are too far away? Losing control.
pulling = null
user.pulledby = null
- pulling.dir = get_dir(pulling, src) // When everything is right, face the wheelchair
+ pulling.set_dir(get_dir(pulling, src)) // When everything is right, face the wheelchair
if(bloodiness)
create_track()
driving = 0
@@ -101,7 +101,6 @@
else
if (occupant && (src.loc != occupant.loc))
src.loc = occupant.loc // Failsafe to make sure the wheelchair stays beneath the occupant after driving
- handle_rotation()
/obj/structure/stool/bed/chair/wheelchair/attack_hand(mob/user as mob)
if (pulling)
@@ -122,7 +121,7 @@
usr.pulledby = src
if(usr.pulling)
usr.stop_pulling()
- usr.dir = get_dir(usr, src)
+ usr.set_dir(get_dir(usr, src))
usr << "You grip \the [name]'s handles."
else
if(usr != pulling)
@@ -176,14 +175,14 @@
var/obj/effect/decal/cleanable/blood/tracks/B = new(loc)
var/newdir = get_dir(get_step(loc, dir), loc)
if(newdir == dir)
- B.dir = newdir
+ B.set_dir(newdir)
else
newdir = newdir | dir
if(newdir == 3)
newdir = 1
else if(newdir == 12)
newdir = 4
- B.dir = newdir
+ B.set_dir(newdir)
bloodiness--
/obj/structure/stool/bed/chair/wheelchair/buckle_mob(mob/M as mob, mob/user as mob)
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index bcd09a51cd..2dc9ae8057 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -250,9 +250,9 @@
if(6)
icon_state = "tabledir3"
if (dir_sum in list(1,2,4,8,5,6,9,10))
- dir = dir_sum
+ set_dir(dir_sum)
else
- dir = 2
+ set_dir(2)
/obj/structure/table/attack_tk() // no telehulk sorry
return
@@ -445,7 +445,7 @@
spawn(0)
A.throw_at(pick(targets),1,1)
- dir = direction
+ set_dir(direction)
if(dir != NORTH)
layer = 5
climbable = 0 //flipping tables allows them to be used as makeshift barriers
diff --git a/code/game/objects/structures/transit_tubes.dm b/code/game/objects/structures/transit_tubes.dm
index aed971b20d..2c8c534dd4 100644
--- a/code/game/objects/structures/transit_tubes.dm
+++ b/code/game/objects/structures/transit_tubes.dm
@@ -170,7 +170,7 @@ obj/structure/ex_act(severity)
nexttube = tube
break
if(!nexttube)
- pod.dir = turn(pod.dir, 180)
+ pod.set_dir(turn(pod.dir, 180))
if(icon_state == "closed" && pod)
pod.follow_tube()
@@ -320,13 +320,13 @@ obj/structure/ex_act(severity)
break
if(current_tube == null)
- dir = next_dir
+ set_dir(next_dir)
Move(get_step(loc, dir)) // Allow collisions when leaving the tubes.
break
last_delay = current_tube.enter_delay(src, next_dir)
sleep(last_delay)
- dir = next_dir
+ set_dir(next_dir)
loc = next_loc // When moving from one tube to another, skip collision and such.
density = current_tube.density
@@ -429,14 +429,14 @@ obj/structure/ex_act(severity)
station.open_animation()
else if(direction in station.directions())
- dir = direction
+ set_dir(direction)
station.launch_pod()
return
for(var/obj/structure/transit_tube/tube in loc)
if(dir in tube.directions())
if(tube.has_exit(direction))
- dir = direction
+ set_dir(direction)
return
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 9e1b47a0b1..c115f230e2 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -32,9 +32,9 @@ obj/structure/windoor_assembly/New(Loc, start_dir=NORTH, constructed=0)
anchored = 0
switch(start_dir)
if(NORTH, SOUTH, EAST, WEST)
- dir = start_dir
+ set_dir(start_dir)
else //If the user is facing northeast. northwest, southeast, southwest or north, default to north
- dir = NORTH
+ set_dir(NORTH)
update_nearby_tiles(need_rebuild=1)
@@ -220,7 +220,7 @@ obj/structure/windoor_assembly/Del()
else
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
- windoor.dir = src.dir
+ windoor.set_dir(src.dir)
windoor.density = 0
if(src.electronics.one_access)
@@ -238,7 +238,7 @@ obj/structure/windoor_assembly/Del()
else
windoor.icon_state = "rightopen"
windoor.base_state = "right"
- windoor.dir = src.dir
+ windoor.set_dir(src.dir)
windoor.density = 0
if(src.electronics.one_access)
@@ -272,7 +272,7 @@ obj/structure/windoor_assembly/Del()
if(src.state != "01")
update_nearby_tiles(need_rebuild=1) //Compel updates before
- src.dir = turn(src.dir, 270)
+ src.set_dir(turn(src.dir, 270))
if(src.state != "01")
update_nearby_tiles(need_rebuild=1)
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index a8492748a3..73ec443e0a 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -246,7 +246,7 @@
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
- dir = turn(dir, 90)
+ set_dir(turn(dir, 90))
// updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
@@ -262,7 +262,7 @@
return 0
update_nearby_tiles(need_rebuild=1) //Compel updates before
- dir = turn(dir, 270)
+ set_dir(turn(dir, 270))
// updateSilicate()
update_nearby_tiles(need_rebuild=1)
return
@@ -292,7 +292,7 @@
anchored = 0
if (start_dir)
- dir = start_dir
+ set_dir(start_dir)
health = maxhealth
@@ -313,7 +313,7 @@
var/ini_dir = dir
update_nearby_tiles(need_rebuild=1)
..()
- dir = ini_dir
+ set_dir(ini_dir)
update_nearby_tiles(need_rebuild=1)
//checks if this window is full-tile one
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index db622996da..6c417a35e1 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -1769,7 +1769,7 @@
else
var/atom/O = new path(target)
if(O)
- O.dir = obj_dir
+ O.set_dir(obj_dir)
if(obj_name)
O.name = obj_name
if(istype(O,/mob))
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index 50b2c86205..3a70e85399 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -60,7 +60,7 @@
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam((holder ? holder.loc : loc) )
I.master = src
I.density = 1
- I.dir = dir
+ I.set_dir(dir)
step(I, I.dir)
if(I)
I.density = 0
@@ -85,14 +85,14 @@
Move()
var/t = dir
..()
- dir = t
+ set_dir(t)
del(first)
return
holder_movement()
if(!holder) return 0
-// dir = holder.dir
+// set_dir(holder.dir)
del(first)
return 1
@@ -151,7 +151,7 @@
set category = "Object"
set src in usr
- dir = turn(dir, 90)
+ set_dir(turn(dir, 90))
return
@@ -213,7 +213,7 @@
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(loc)
I.master = master
I.density = 1
- I.dir = dir
+ I.set_dir(dir)
//world << "created new beam \ref[I] at [I.x] [I.y] [I.z]"
step(I, I.dir)
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 20864c641e..04c255b94e 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -120,13 +120,13 @@ obj/machinery/gateway/centerstation/process()
if(!awaygate) return
if(awaygate.calibrated)
M.loc = get_step(awaygate.loc, SOUTH)
- M.dir = SOUTH
+ M.set_dir(SOUTH)
return
else
var/obj/effect/landmark/dest = pick(awaydestinations)
if(dest)
M.loc = dest.loc
- M.dir = SOUTH
+ M.set_dir(SOUTH)
use_power(5000)
return
@@ -222,7 +222,7 @@ obj/machinery/gateway/centerstation/process()
M << "\black The station gate has detected your exile implant and is blocking your entry."
return
M.loc = get_step(stationgate.loc, SOUTH)
- M.dir = SOUTH
+ M.set_dir(SOUTH)
/obj/machinery/gateway/centeraway/attackby(obj/item/device/W as obj, mob/user as mob)
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index c6487cc9d2..79a3fb2835 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -144,7 +144,7 @@
desc = O.desc
icon = O.icon
icon_state = O.icon_state
- dir = O.dir
+ set_dir(O.dir)
/obj/item/clothing/ears/earmuffs
name = "earmuffs"
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index bd3d93ae72..fe6c3ea031 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -295,7 +295,7 @@ proc/check_panel(mob/M)
collapse()
continue
if(get_dist(src,my_target) > 1)
- src.dir = get_dir(src,my_target)
+ src.set_dir(get_dir(src,my_target))
step_towards(src,my_target)
updateimage()
else
diff --git a/code/modules/mining/drilling/drill.dm b/code/modules/mining/drilling/drill.dm
index 4ed2cd0867..7f9d331aac 100644
--- a/code/modules/mining/drilling/drill.dm
+++ b/code/modules/mining/drilling/drill.dm
@@ -388,5 +388,5 @@
usr << "It is anchored in place!"
return 0
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
return 1
\ No newline at end of file
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index 0f3c764878..c5e1afbc4c 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -182,7 +182,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
/mob/dead/observer/Move(NewLoc, direct)
following = null
- dir = direct
+ set_dir(direct)
if(NewLoc)
loc = NewLoc
for(var/obj/effect/step_trigger/S in NewLoc)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index eb96d51512..6719756744 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -130,9 +130,9 @@
hud_used.l_hand_hud_object.icon_state = "hand_inactive"
hud_used.r_hand_hud_object.icon_state = "hand_active"
/*if (!( src.hand ))
- src.hands.dir = NORTH
+ src.hands.set_dir(NORTH)
else
- src.hands.dir = SOUTH*/
+ src.hands.set_dir(SOUTH)*/
return
/mob/living/carbon/proc/activate_hand(var/selhand) //0 or "r" or "right" for right hand; 1 or "l" or "left" for left hand.
diff --git a/code/modules/mob/living/carbon/monkey/npc.dm b/code/modules/mob/living/carbon/monkey/npc.dm
index f863558605..a7d4bfc7ae 100644
--- a/code/modules/mob/living/carbon/monkey/npc.dm
+++ b/code/modules/mob/living/carbon/monkey/npc.dm
@@ -53,7 +53,7 @@ mob/living/carbon/monkey/proc/npc_act()
hiding_behind = null
hid_behind = 0
- if(loc == prevloc) dir = get_dir(src, npc_fleeing)
+ if(loc == prevloc) set_dir(get_dir(src, npc_fleeing))
else
if(prob(33) && canmove && isturf(loc))
step(src, pick(cardinal))
diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm
index 2b632c70f5..162038dd07 100644
--- a/code/modules/mob/living/simple_animal/friendly/corgi.dm
+++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm
@@ -297,15 +297,15 @@
if(movement_target) //Not redundant due to sleeps, Item can be gone in 6 decisecomds
if (movement_target.loc.x < src.x)
- dir = WEST
+ set_dir(WEST)
else if (movement_target.loc.x > src.x)
- dir = EAST
+ set_dir(EAST)
else if (movement_target.loc.y < src.y)
- dir = SOUTH
+ set_dir(SOUTH)
else if (movement_target.loc.y > src.y)
- dir = NORTH
+ set_dir(NORTH)
else
- dir = SOUTH
+ set_dir(SOUTH)
if(isturf(movement_target.loc) )
UnarmedAttack(movement_target)
@@ -316,7 +316,7 @@
visible_emote(pick("dances around","chases their tail"))
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2))
- dir = i
+ set_dir(i)
sleep(1)
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
@@ -369,7 +369,7 @@
M.show_message("\blue [user] baps [name] on the nose with the rolled up [O]")
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2))
- dir = i
+ set_dir(i)
sleep(1)
else
..()
@@ -471,5 +471,5 @@
visible_emote(pick("dances around","chases her tail"))
spawn(0)
for(var/i in list(1,2,4,8,4,2,1,2,4,8,4,2,1,2,4,8,4,2))
- dir = i
+ set_dir(i)
sleep(1)
diff --git a/code/modules/mob/living/simple_animal/hostile/bear.dm b/code/modules/mob/living/simple_animal/hostile/bear.dm
index fa3e8c2385..5bc3d41afc 100644
--- a/code/modules/mob/living/simple_animal/hostile/bear.dm
+++ b/code/modules/mob/living/simple_animal/hostile/bear.dm
@@ -74,7 +74,7 @@
stance_step = max(0, stance_step) //If we have not seen a mob in a while, the stance_step will be negative, we need to reset it to 0 as soon as we see a mob again.
stance_step++
found_mob = 1
- src.dir = get_dir(src,target_mob) //Keep staring at the mob
+ src.set_dir(get_dir(src,target_mob)) //Keep staring at the mob
if(stance_step in list(1,4,7)) //every 3 ticks
var/action = pick( list( "growls at [target_mob]", "stares angrily at [target_mob]", "prepares to attack [target_mob]", "closely watches [target_mob]" ) )
diff --git a/code/modules/mob/living/simple_animal/worm.dm b/code/modules/mob/living/simple_animal/worm.dm
index 6dad3655e3..0df4f5c7c4 100644
--- a/code/modules/mob/living/simple_animal/worm.dm
+++ b/code/modules/mob/living/simple_animal/worm.dm
@@ -75,7 +75,7 @@
if(stat == CONSCIOUS || stat == UNCONSCIOUS)
icon_state = "spacewormhead[previous?1:0]"
if(previous)
- dir = get_dir(previous,src)
+ set_dir(get_dir(previous,src))
else
icon_state = "spacewormheaddead"
@@ -129,7 +129,7 @@
icon_state = "spaceworm[get_dir(src,previous) | get_dir(src,next)]" //see 3 lines below
else //tail
icon_state = "spacewormtail"
- dir = get_dir(src,next) //next will always be present since it's not a head and if it's dead, it goes in the other if branch
+ set_dir(get_dir(src,next)) //next will always be present since it's not a head and if it's dead, it goes in the other if branch
else
icon_state = "spacewormdead"
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index fa70ccbfc5..6bf10756d0 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -905,10 +905,9 @@ note dizziness decrements automatically in the mob's Life() proc.
/mob/proc/facedir(var/ndir)
if(!canface()) return 0
- dir = ndir
+ set_dir(ndir)
if(buckled && buckled.movable)
- buckled.dir = ndir
- buckled.handle_rotation()
+ buckled.set_dir(ndir)
client.move_delay += movement_delay()
return 1
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index f999b26ec0..da6d01de79 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -110,8 +110,8 @@
*/
return
-
-/atom/movable/Move(NewLoc, direct)
+//This proc should never be overridden elsewhere at /atom/movable to keep directions sane.
+/atom/movable/Move(newloc, direct)
if (direct & (direct - 1))
if (direct & 1)
if (direct & 4)
@@ -143,9 +143,20 @@
if (step(src, WEST))
step(src, SOUTH)
else
- . = ..()
- return
+ var/atom/A = src.loc
+ var/olddir = dir //we can't override this without sacrificing the rest of movable/New()
+ . = ..()
+ if(direct != olddir)
+ dir = olddir
+ set_dir(direct)
+
+ src.move_speed = world.time - src.l_move_time
+ src.l_move_time = world.time
+ src.m_flag = 1
+ if ((A != src.loc && A && A.z == src.z))
+ src.last_move = get_dir(A, src.loc)
+ return
/client/proc/Move_object(direct)
if(mob && mob.control_object)
diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm
index 48d0140d90..00c6f9d05e 100644
--- a/code/modules/mob/new_player/new_player.dm
+++ b/code/modules/mob/new_player/new_player.dm
@@ -334,7 +334,7 @@
// Moving wheelchair if they have one
if(character.buckled && istype(character.buckled, /obj/structure/stool/bed/chair/wheelchair))
character.buckled.loc = character.loc
- character.buckled.dir = character.dir
+ character.buckled.set_dir(character.dir)
ticker.mode.latespawn(character)
diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm
index 6d830d1559..7816b914cf 100644
--- a/code/modules/organs/organ_external.dm
+++ b/code/modules/organs/organ_external.dm
@@ -1037,7 +1037,7 @@ obj/item/weapon/organ/New(loc, mob/living/carbon/human/H)
base.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD)
icon = base
- dir = SOUTH
+ set_dir(SOUTH)
src.transform = turn(src.transform, rand(70,130))
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index 510602122f..45114d9e78 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -143,9 +143,9 @@
// offset 24 pixels in direction of dir
// this allows the APC to be embedded in a wall, yet still inside an area
if (building)
- dir = ndir
+ set_dir(ndir)
src.tdir = dir // to fix Vars bug
- dir = SOUTH
+ set_dir(SOUTH)
pixel_x = (src.tdir & 3)? 0 : (src.tdir == 4 ? 24 : -24)
pixel_y = (src.tdir & 3)? (src.tdir ==1 ? 24 : -24) : 0
@@ -184,7 +184,7 @@
// create a terminal object at the same position as original turf loc
// wires will attach to this
terminal = new/obj/machinery/power/terminal(src.loc)
- terminal.dir = tdir
+ terminal.set_dir(tdir)
terminal.master = src
/obj/machinery/power/apc/proc/init()
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index e6bd2151c8..c574c37ef8 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -191,7 +191,7 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
/obj/machinery/power/generator/verb/rotate_anticlock()
set category = "Object"
@@ -201,4 +201,4 @@
if (usr.stat || usr.restrained() || anchored)
return
- src.dir = turn(src.dir, -90)
\ No newline at end of file
+ src.set_dir(turn(src.dir, -90))
\ No newline at end of file
diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm
index 4ae6e0b254..59e93c23b6 100644
--- a/code/modules/power/singularity/emitter.dm
+++ b/code/modules/power/singularity/emitter.dm
@@ -33,7 +33,7 @@
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
return 1
/obj/machinery/power/emitter/initialize()
@@ -137,7 +137,7 @@
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
- A.dir = src.dir
+ A.set_dir(src.dir)
switch(dir)
if(NORTH)
A.yo = 20
diff --git a/code/modules/power/singularity/field_generator.dm b/code/modules/power/singularity/field_generator.dm
index cf339eff30..501ccd989a 100644
--- a/code/modules/power/singularity/field_generator.dm
+++ b/code/modules/power/singularity/field_generator.dm
@@ -299,7 +299,7 @@ field_generator power level display
fields += CF
G.fields += CF
CF.loc = T
- CF.dir = field_dir
+ CF.set_dir(field_dir)
var/listcheck = 0
for(var/obj/machinery/field_generator/FG in connected_gens)
if (isnull(FG))
diff --git a/code/modules/power/singularity/particle_accelerator/particle.dm b/code/modules/power/singularity/particle_accelerator/particle.dm
index 0fc32904ab..cbec31306b 100644
--- a/code/modules/power/singularity/particle_accelerator/particle.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle.dm
@@ -29,7 +29,7 @@
/obj/effect/accelerated_particle/New(loc, dir = 2)
src.loc = loc
- src.dir = dir
+ src.set_dir(dir)
if(movement_range > 20)
movement_range = 20
spawn(0)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
index a122fd12f3..6739bd165e 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_accelerator.dm
@@ -91,7 +91,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 270)
+ src.set_dir(turn(src.dir, 270))
return 1
/obj/structure/particle_accelerator/verb/rotateccw()
@@ -102,7 +102,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
return 1
/obj/structure/particle_accelerator/examine(mob/user)
@@ -282,7 +282,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 270)
+ src.set_dir(turn(src.dir, 270))
return 1
/obj/machinery/particle_accelerator/verb/rotateccw()
@@ -293,7 +293,7 @@ So, hopefully this is helpful if any more icons are to be added/changed/wonderin
if (src.anchored || usr:stat)
usr << "It is fastened to the floor!"
return 0
- src.dir = turn(src.dir, 90)
+ src.set_dir(turn(src.dir, 90))
return 1
/obj/machinery/particle_accelerator/update_icon()
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index 5b30c000c7..26239ff567 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -157,7 +157,7 @@
/obj/machinery/particle_accelerator/control_box/proc/part_scan()
for(var/obj/structure/particle_accelerator/fuel_chamber/F in orange(1,src))
- src.dir = F.dir
+ src.set_dir(F.dir)
connected_parts = list()
var/tally = 0
var/ldir = turn(dir,-90)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
index 01666774a9..ff6a444a53 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_emitter.dm
@@ -44,6 +44,6 @@
if(2)
A = new/obj/effect/accelerated_particle/strong(T, dir)
if(A)
- A.dir = src.dir
+ A.set_dir(src.dir)
return 1
return 0
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index f18aa2eb2a..611c8546f3 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -207,7 +207,7 @@
user << "You start adding cable to the [src]."
if(do_after(user, 50))
terminal = new /obj/machinery/power/terminal(tempLoc)
- terminal.dir = tempDir
+ terminal.set_dir(tempDir)
terminal.master = src
return 0
return 1
diff --git a/code/modules/power/solar.dm b/code/modules/power/solar.dm
index a3cf39280d..861665b462 100644
--- a/code/modules/power/solar.dm
+++ b/code/modules/power/solar.dm
@@ -102,7 +102,7 @@ var/list/solars_list = list()
overlays += image('icons/obj/power.dmi', icon_state = "solar_panel-b", layer = FLY_LAYER)
else
overlays += image('icons/obj/power.dmi', icon_state = "solar_panel", layer = FLY_LAYER)
- src.dir = angle2dir(adir)
+ src.set_dir(angle2dir(adir))
return
//calculates the fraction of the sunlight that the panel recieves
diff --git a/code/modules/power/tracker.dm b/code/modules/power/tracker.dm
index 92b6d2924c..38824dec5d 100644
--- a/code/modules/power/tracker.dm
+++ b/code/modules/power/tracker.dm
@@ -52,7 +52,7 @@
sun_angle = angle
//set icon dir to show sun illumination
- dir = turn(NORTH, -angle - 22.5) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
+ set_dir(turn(NORTH, -angle - 22.5)) // 22.5 deg bias ensures, e.g. 67.5-112.5 is EAST
if(powernet && (powernet == control.powernet)) //update if we're still in the same powernet
control.cdir = angle
diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm
index 972f6206ae..610c0f28a3 100644
--- a/code/modules/projectiles/ammunition.dm
+++ b/code/modules/projectiles/ammunition.dm
@@ -18,7 +18,7 @@
BB = new projectile_type(src)
pixel_x = rand(-10.0, 10)
pixel_y = rand(-10.0, 10)
- dir = pick(cardinal)
+ set_dir(pick(cardinal))
/obj/item/ammo_casing/attackby(obj/item/weapon/W as obj, mob/user as mob)
diff --git a/code/modules/projectiles/targeting.dm b/code/modules/projectiles/targeting.dm
index ddacdbead5..496455f24e 100644
--- a/code/modules/projectiles/targeting.dm
+++ b/code/modules/projectiles/targeting.dm
@@ -48,7 +48,7 @@
//Lets not spam it.
if(lock_time > world.time - 2) return
- user.dir = get_cardinal_dir(src, A)
+ user.set_dir(get_cardinal_dir(src, A))
if(isliving(A) && !(A in target))
Aim(A) //Clicked a mob, aim at them
return 1
@@ -103,7 +103,7 @@
else
click_empty(M)
- usr.dir = get_cardinal_dir(src, T)
+ usr.set_dir(get_cardinal_dir(src, T))
if (!firerate) // If firerate is set to lower aim after one shot, untarget the target
T.NotTargeted(src)
diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm
index 314e6dbccf..2244e98bf1 100644
--- a/code/modules/recycling/conveyor2.dm
+++ b/code/modules/recycling/conveyor2.dm
@@ -24,7 +24,7 @@
/obj/machinery/conveyor/New(loc, newdir, on = 0)
..(loc)
if(newdir)
- dir = newdir
+ set_dir(newdir)
switch(dir)
if(NORTH)
forwards = NORTH
diff --git a/code/modules/recycling/disposal-construction.dm b/code/modules/recycling/disposal-construction.dm
index b4c8cfc2f5..8b26dd3133 100644
--- a/code/modules/recycling/disposal-construction.dm
+++ b/code/modules/recycling/disposal-construction.dm
@@ -111,7 +111,7 @@
usr << "You must unfasten the pipe before rotating it."
return
- dir = turn(dir, -90)
+ set_dir(turn(dir, -90))
update()
verb/flip()
@@ -125,7 +125,7 @@
usr << "You must unfasten the pipe before flipping it."
return
- dir = turn(dir, 180)
+ set_dir(turn(dir, 180))
switch(ptype)
if(2)
ptype = 3
@@ -260,7 +260,7 @@
var/obj/structure/disposalpipe/P = new pipetype(src.loc)
src.transfer_fingerprints_to(P)
P.base_icon_state = base_state
- P.dir = dir
+ P.set_dir(dir)
P.dpdir = dpdir
P.updateicon()
@@ -278,7 +278,7 @@
var/obj/structure/disposaloutlet/P = new /obj/structure/disposaloutlet(src.loc)
src.transfer_fingerprints_to(P)
- P.dir = dir
+ P.set_dir(dir)
var/obj/structure/disposalpipe/trunk/Trunk = CP
Trunk.linked = P
@@ -286,7 +286,7 @@
var/obj/machinery/disposal/deliveryChute/P = new /obj/machinery/disposal/deliveryChute(src.loc)
src.transfer_fingerprints_to(P)
- P.dir = dir
+ P.set_dir(dir)
del(src)
return
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 3b5d5a197a..2bfac53547 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -543,7 +543,7 @@
loc = D.trunk
active = 1
- dir = DOWN
+ set_dir(DOWN)
spawn(1)
move() // spawn off the movement process
@@ -702,7 +702,7 @@
//
proc/transfer(var/obj/structure/disposalholder/H)
var/nextdir = nextdir(H.dir)
- H.dir = nextdir
+ H.set_dir(nextdir)
var/turf/T = H.nextloc()
var/obj/structure/disposalpipe/P = H.findpipe(T)
@@ -808,7 +808,7 @@
for(var/D in cardinal)
if(D & dpdir)
var/obj/structure/disposalpipe/broken/P = new(src.loc)
- P.dir = D
+ P.set_dir(D)
src.invisibility = 101 // make invisible (since we won't delete the pipe immediately)
var/obj/structure/disposalholder/H = locate() in src
@@ -919,7 +919,7 @@
if("pipe-tagger-partial")
C.ptype = 14
src.transfer_fingerprints_to(C)
- C.dir = dir
+ C.set_dir(dir)
C.density = 0
C.anchored = 1
C.update()
@@ -965,7 +965,7 @@
transfer(var/obj/structure/disposalholder/H)
var/nextdir = nextdir(H.dir)
- H.dir = nextdir
+ H.set_dir(nextdir)
var/turf/T
var/obj/structure/disposalpipe/P
@@ -1229,7 +1229,7 @@
transfer(var/obj/structure/disposalholder/H)
var/nextdir = nextdir(H.dir, H.destinationTag)
- H.dir = nextdir
+ H.set_dir(nextdir)
var/turf/T = H.nextloc()
var/obj/structure/disposalpipe/P = H.findpipe(T)
diff --git a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
index 9b461b5d19..9f498d3faa 100644
--- a/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
+++ b/code/modules/research/xenoarchaeology/tools/suspension_generator.dm
@@ -322,7 +322,7 @@
if(anchored)
usr << "\red You cannot rotate [src], it has been firmly fixed to the floor."
else
- dir = turn(dir, 90)
+ set_dir(turn(dir, 90))
/obj/machinery/suspension_gen/verb/rotate_cw()
set src in view(1)
@@ -332,7 +332,7 @@
if(anchored)
usr << "\red You cannot rotate [src], it has been firmly fixed to the floor."
else
- dir = turn(dir, -90)
+ set_dir(turn(dir, -90))
/obj/effect/suspension_field
name = "energy field"
diff --git a/code/modules/research/xenoarchaeology/tools/tools_locater.dm b/code/modules/research/xenoarchaeology/tools/tools_locater.dm
index dfecd5979b..ad84f0e010 100644
--- a/code/modules/research/xenoarchaeology/tools/tools_locater.dm
+++ b/code/modules/research/xenoarchaeology/tools/tools_locater.dm
@@ -22,7 +22,7 @@
/obj/item/device/beacon_locator/process()
if(target_radio)
- dir = get_dir(src,target_radio)
+ set_dir(get_dir(src,target_radio))
switch(get_dist(src,target_radio))
if(0 to 3)
icon_state = "pinondirect"
diff --git a/code/modules/shieldgen/emergency_shield.dm b/code/modules/shieldgen/emergency_shield.dm
index 8ecb5fb3b1..a361631960 100644
--- a/code/modules/shieldgen/emergency_shield.dm
+++ b/code/modules/shieldgen/emergency_shield.dm
@@ -13,7 +13,7 @@
var/shield_idle_power = 1500 //how much power we use when just being sustained.
/obj/machinery/shield/New()
- src.dir = pick(1,2,3,4)
+ src.set_dir(pick(1,2,3,4))
..()
update_nearby_tiles(need_rebuild=1)
diff --git a/code/modules/shieldgen/sheldwallgen.dm b/code/modules/shieldgen/sheldwallgen.dm
index 9bce6c3597..d2d8148c13 100644
--- a/code/modules/shieldgen/sheldwallgen.dm
+++ b/code/modules/shieldgen/sheldwallgen.dm
@@ -154,7 +154,7 @@
T2 = T
var/obj/machinery/shieldwall/CF = new/obj/machinery/shieldwall/(src, G) //(ref to this gen, ref to connected gen)
CF.loc = T
- CF.dir = field_dir
+ CF.set_dir(field_dir)
/obj/machinery/shieldwallgen/attackby(obj/item/W, mob/user)
diff --git a/code/modules/shieldgen/shield_capacitor.dm b/code/modules/shieldgen/shield_capacitor.dm
index 2893f11b89..0c26178314 100644
--- a/code/modules/shieldgen/shield_capacitor.dm
+++ b/code/modules/shieldgen/shield_capacitor.dm
@@ -149,5 +149,5 @@
if (src.anchored)
usr << "It is fastened to the floor!"
return
- src.dir = turn(src.dir, 270)
+ src.set_dir(turn(src.dir, 270))
return
diff --git a/code/modules/vehicles/train.dm b/code/modules/vehicles/train.dm
index d8e372d818..c323eed809 100644
--- a/code/modules/vehicles/train.dm
+++ b/code/modules/vehicles/train.dm
@@ -155,7 +155,7 @@
//latch with src as the follower
lead = T
T.tow = src
- dir = lead.dir
+ set_dir(lead.dir)
if(user)
user << "\blue You hitch [src] to [T]."
diff --git a/code/modules/vehicles/vehicle.dm b/code/modules/vehicles/vehicle.dm
index 5b40c9e5fc..b674655204 100644
--- a/code/modules/vehicles/vehicle.dm
+++ b/code/modules/vehicles/vehicle.dm
@@ -55,7 +55,7 @@
if(load)
load.forceMove(loc)// = loc
- load.dir = dir
+ load.set_dir(dir)
return 1
else
@@ -140,7 +140,7 @@
pulse2.icon_state = "empdisable"
pulse2.name = "emp sparks"
pulse2.anchored = 1
- pulse2.dir = pick(cardinal)
+ pulse2.set_dir(pick(cardinal))
spawn(10)
pulse2.delete()
@@ -154,9 +154,6 @@
/obj/vehicle/attack_ai(mob/user as mob)
return
-/obj/vehicle/proc/handle_rotation()
- return
-
//-------------------------------------------
// Vehicle procs
//-------------------------------------------
@@ -273,7 +270,7 @@
crate.close()
C.forceMove(loc)
- C.dir = dir
+ C.set_dir(dir)
C.anchored = 1
load = C
@@ -325,7 +322,7 @@
return 0
load.forceMove(dest)
- load.dir = get_dir(loc, dest)
+ load.set_dir(get_dir(loc, dest))
load.anchored = initial(load.anchored)
load.pixel_x = initial(load.pixel_x)
load.pixel_y = initial(load.pixel_y)
diff --git a/code/unused/Agouri_stuff.dm b/code/unused/Agouri_stuff.dm
index bb5e7d3b35..e204fbd7d3 100644
--- a/code/unused/Agouri_stuff.dm
+++ b/code/unused/Agouri_stuff.dm
@@ -539,7 +539,7 @@
var/turf/simulated/floor/W = new /turf/simulated/floor( locate(src.x, src.y, src.z) )
W.RemoveLattice()
- W.dir = old_dir
+ W.set_dir(old_dir)
if(prior_icon) W.icon_state = prior_icon
else W.icon_state = "floor"
@@ -557,7 +557,7 @@
var/turf/simulated/floor/plating/W = new /turf/simulated/floor/plating( locate(src.x, src.y, src.z) )
W.RemoveLattice()
- W.dir = old_dir
+ W.set_dir(old_dir)
if(prior_icon) W.icon_state = prior_icon
else W.icon_state = "plating"
W.opacity = 1
@@ -570,7 +570,7 @@
var/turf/simulated/floor/engine/E = new /turf/simulated/floor/engine( locate(src.x, src.y, src.z) )
- E.dir = old_dir
+ E.set_dir(old_dir)
E.icon_state = "engine"
/turf/simulated/Entered(atom/A, atom/OL)
@@ -633,13 +633,13 @@
/turf/proc/ReplaceWithSpace()
var/old_dir = dir
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
- S.dir = old_dir
+ S.set_dir(old_dir)
return S
/turf/proc/ReplaceWithLattice()
var/old_dir = dir
var/turf/space/S = new /turf/space( locate(src.x, src.y, src.z) )
- S.dir = old_dir
+ S.set_dir(old_dir)
new /obj/structure/lattice( locate(src.x, src.y, src.z) )
return S
diff --git a/code/unused/_debug.dm b/code/unused/_debug.dm
index 6b8bb9c3e3..fb4a994f28 100644
--- a/code/unused/_debug.dm
+++ b/code/unused/_debug.dm
@@ -502,7 +502,7 @@ Doing this because FindTurfs() isn't even used
set category = "Debug"
if(Debug)
var/obj/effect/smoke/O = new /obj/effect/smoke( src.loc )
- O.dir = pick(NORTH, SOUTH, EAST, WEST)
+ O.set_dir(pick(NORTH, SOUTH, EAST, WEST))
spawn( 0 )
O.Life()
else
diff --git a/code/unused/assemblies.dm b/code/unused/assemblies.dm
index 8f7d0f71e1..2c6909287a 100644
--- a/code/unused/assemblies.dm
+++ b/code/unused/assemblies.dm
@@ -480,8 +480,8 @@
set category = "Object"
set src in usr
- src.dir = turn(src.dir, 90)
- src.part2.dir = src.dir
+ src.set_dir(turn(src.dir, 90))
+ src.part2.set_dir(src.dir)
src.add_fingerprint(usr)
return
@@ -489,7 +489,7 @@
var/t = src.dir
..()
- src.dir = t
+ src.set_dir(t)
//src.part2.first = null
del(src.part2.first)
return
diff --git a/code/unused/asteroiddevice.dm b/code/unused/asteroiddevice.dm
index f9c6aa9185..57a5747cfe 100644
--- a/code/unused/asteroiddevice.dm
+++ b/code/unused/asteroiddevice.dm
@@ -47,7 +47,7 @@
var/atom/cur_loc = src.loc
if(cur_loc.z == beacon.z)
- src.dir = get_dir(cur_loc,beacon)
+ src.set_dir(get_dir(cur_loc,beacon))
else
var/list/beacon_global_loc = beacon.get_global_map_pos()
var/list/src_global_loc = cur_loc.get_global_map_pos()
@@ -64,7 +64,7 @@
else if(beacon_global_loc["y"]