diff --git a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm
index 42641865605..8db700d8f76 100644
--- a/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm
+++ b/code/__DEFINES/dcs/signals/signals_atom/signals_atom_movement.dm
@@ -1,2 +1,11 @@
+// Atom movement signals. Format:
+// When the signal is called: (signal arguments)
+// All signals send the source datum of the signal as the first argument
+
+///from base of atom/relaymove(): (mob/living/user, direction)
+#define COMSIG_ATOM_RELAYMOVE "atom_relaymove"
+ ///prevents the "you cannot move while buckled! message"
+ #define COMSIG_BLOCK_RELAYMOVE (1<<0)
+
///From base of /datum/move_loop/process() after attempting to move a movable: (datum/move_loop/loop, old_dir)
#define COMSIG_MOVABLE_MOVED_FROM_LOOP "movable_moved_from_loop"
diff --git a/code/game/atom/_atom.dm b/code/game/atom/_atom.dm
index e27e7d88676..e9068020fc4 100644
--- a/code/game/atom/_atom.dm
+++ b/code/game/atom/_atom.dm
@@ -123,6 +123,18 @@
return (!density || !height || air_group)
+/**
+ * An atom we are buckled or is contained within us has tried to move
+ */
+/atom/proc/relaymove(mob/living/user, direction)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_CALL_PARENT(TRUE)
+
+ if(SEND_SIGNAL(src, COMSIG_ATOM_RELAYMOVE, user, direction) & COMSIG_BLOCK_RELAYMOVE)
+ return FALSE
+ return TRUE
+
+
/**
* An atom has entered this atom's contents
*
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 39d93204ee0..ea6d08c9a5d 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -230,11 +230,6 @@
found += A.search_contents_for(path,filter_path)
return found
-// Called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled_to var set.
-// See code/modules/mob/mob_movement.dm for more.
-/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
diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 1c7316378ba..837bbc9ac57 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -54,8 +54,12 @@
/obj/item/stack/cable_coil = 2
)
-/obj/machinery/dna_scannernew/relaymove(mob/user as mob)
- if (user.stat)
+/obj/machinery/dna_scannernew/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
+ if(user.stat)
return
src.go_out()
return
diff --git a/code/game/gamemodes/technomancer/spells/phase_shift.dm b/code/game/gamemodes/technomancer/spells/phase_shift.dm
index 01389f39140..729f3799dd6 100644
--- a/code/game/gamemodes/technomancer/spells/phase_shift.dm
+++ b/code/game/gamemodes/technomancer/spells/phase_shift.dm
@@ -46,7 +46,11 @@
L.forceMove(get_turf(src))
L.visible_message(SPAN_WARNING("\The [src] ejects [L]!"))
-/obj/effect/phase_shift/relaymove(mob/user)
+/obj/effect/phase_shift/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat)
return
diff --git a/code/game/gamemodes/vampire/vampire_powers.dm b/code/game/gamemodes/vampire/vampire_powers.dm
index a1328e98756..6312df20d18 100644
--- a/code/game/gamemodes/vampire/vampire_powers.dm
+++ b/code/game/gamemodes/vampire/vampire_powers.dm
@@ -465,7 +465,11 @@
var/mob/M = A
M.reset_view(null)
-/obj/effect/dummy/veil_walk/relaymove(var/mob/user, direction)
+/obj/effect/dummy/veil_walk/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user != owner_mob)
return
if(ghost_last_move + ghost_move_delay > world.time)
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index d8da3f9bd10..ec5c97b64f0 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -294,7 +294,11 @@
LB.user_unbuckle(user)
go_in(target, user)
-/obj/machinery/sleeper/relaymove(var/mob/user)
+/obj/machinery/sleeper/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user == occupant)
go_out()
diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm
index ffec0222109..78d47bff4df 100644
--- a/code/game/machinery/body_scanner.dm
+++ b/code/game/machinery/body_scanner.dm
@@ -78,7 +78,11 @@
else
icon_state = initial(icon_state)
-/obj/machinery/bodyscanner/relaymove(mob/user as mob)
+/obj/machinery/bodyscanner/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if (user.stat)
return
go_out()
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index c677b969746..05dcef07d97 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -333,7 +333,11 @@
qdel(occupant)
return
-/obj/machinery/clonepod/relaymove(mob/user as mob)
+/obj/machinery/clonepod/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat)
return
go_out()
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index b61c3488b46..67bec58ee7a 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -110,7 +110,11 @@
return 1
-/obj/machinery/atmospherics/unary/cryo_cell/relaymove(mob/user as mob)
+/obj/machinery/atmospherics/unary/cryo_cell/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(src.occupant == user && !user.stat)
go_out()
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 89cd0320e68..9cc95c14e9a 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -560,7 +560,11 @@ GLOBAL_LIST_EMPTY(frozen_crew)
else
icon_state = initial(icon_state)
-/obj/machinery/cryopod/relaymove(var/mob/user)
+/obj/machinery/cryopod/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
go_out()
/obj/machinery/cryopod/proc/save_ipc_tag(var/mob/M)
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 96f9f74f723..46fb3651b9f 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -6,16 +6,33 @@
density = 1
anchored = 1
idle_power_usage = 75
- var/mob/occupant = null
+ /**
+ * The `/mob/living` that is currently occupying the charger
+ */
+ var/mob/living/occupant = null
+
+ /**
+ * The `/obj/item/cell` that is currently inside the charger
+ */
var/obj/item/cell/cell = null
+
var/icon_update_tick = 0 // Used to rebuild the overlay only once every 10 ticks
- var/charging = 0
- var/charging_efficiency = 1.3//Multiplier applied to all operations of giving power to cells, represents entropy. Efficiency increases with upgrades
- var/charging_power // W. Power rating drawn from internal cell to recharge occupant's cell 60 kW unupgraded
- var/restore_power_active // W. Power drawn from APC to recharge internal cell when an occupant is charging. 40 kW if un-upgraded
- var/restore_power_passive // W. Power drawn from APC to recharge internal cell when idle. 7 kW if un-upgraded
- var/weld_rate = 0 // How much brute damage is repaired per tick
- var/wire_rate = 0 // How much burn damage is repaired per tick
+
+ ///Multiplier applied to all operations of giving power to cells, represents entropy, efficiency increases with upgrades
+ var/charging_efficiency = 1.3
+
+ ///Watts, Power rating drawn from internal cell to recharge occupant's cell 60 kW unupgraded
+ var/charging_power
+
+ ///Watts, Power drawn from APC to recharge internal cell when an occupant is charging. 40 kW if un-upgraded
+ var/restore_power_active
+ ///Watts, Power drawn from APC to recharge internal cell when idle. 7 kW if un-upgraded
+ var/restore_power_passive
+
+ ///How much brute damage is repaired per second
+ var/weld_rate = 0
+ ///How much burn damage is repaired per second
+ var/wire_rate = 0
var/weld_power_use = 2300 // power used per point of brute damage repaired. 2.3 kW ~ about the same power usage of a handheld arc welder
var/wire_power_use = 500 // power used per point of burn damage repaired.
@@ -32,10 +49,15 @@
. = ..()
update_icon()
+/obj/machinery/recharge_station/Destroy()
+ QDEL_NULL(cell)
+
+ . = ..()
+
/obj/machinery/recharge_station/proc/has_cell_power()
return cell && cell.percent() > 0
-/obj/machinery/recharge_station/process()
+/obj/machinery/recharge_station/process(seconds_per_tick)
if(stat & (BROKEN))
return
if(!cell) // Shouldn't be possible, but sanity check
@@ -49,13 +71,13 @@
//First, draw from the internal power cell to recharge/repair/etc the occupant
if(occupant)
- process_occupant()
+ process_occupant(seconds_per_tick)
//Then, if external power is available, recharge the internal cell
var/recharge_amount = 0
if(!(stat & NOPOWER))
// Calculating amount of power to draw
- recharge_amount = (occupant ? restore_power_active : restore_power_passive) * CELLRATE
+ recharge_amount = (occupant ? restore_power_active : restore_power_passive) * CELLRATE * seconds_per_tick
recharge_amount = cell.give(recharge_amount*charging_efficiency)
use_power_oneoff(recharge_amount / CELLRATE)
@@ -71,7 +93,7 @@
update_icon()
//Processes the occupant, drawing from the internal power cell if needed.
-/obj/machinery/recharge_station/proc/process_occupant()
+/obj/machinery/recharge_station/proc/process_occupant(seconds_per_tick = 1)
if(!isrobot(occupant) && !ishuman(occupant))
return
@@ -80,14 +102,14 @@
var/mob/living/silicon/robot/R = occupant
if(R.module)
- R.module.respawn_consumable(R, charging_power * CELLRATE / 250) //consumables are magical, apparently
+ R.module.respawn_consumable(R, charging_power * CELLRATE * seconds_per_tick / 250) //consumables are magical, apparently
target = R.cell
//Lastly, attempt to repair the cyborg if enabled
- if(weld_rate && R.getBruteLoss() && cell.checked_use(weld_power_use * weld_rate * CELLRATE))
- R.adjustBruteLoss(-weld_rate)
- if(wire_rate && R.getFireLoss() && cell.checked_use(wire_power_use * wire_rate * CELLRATE))
- R.adjustFireLoss(-wire_rate)
+ if(weld_rate && R.getBruteLoss() && cell.checked_use(weld_power_use * weld_rate * CELLRATE * seconds_per_tick))
+ R.adjustBruteLoss(-weld_rate * seconds_per_tick)
+ if(wire_rate && R.getFireLoss() && cell.checked_use(wire_power_use * wire_rate * CELLRATE * seconds_per_tick))
+ R.adjustFireLoss(-wire_rate * seconds_per_tick)
if(ishuman(occupant))
var/mob/living/carbon/human/H = occupant
@@ -100,7 +122,7 @@
target = R.cell
if(target && !target.fully_charged())
- var/diff = min(target.maxcharge - target.charge, charging_power * CELLRATE) // Capped by charging_power / tick
+ var/diff = min(target.maxcharge - target.charge, charging_power * CELLRATE * seconds_per_tick) // Capped by charging_power / tick
var/charge_used = cell.use(diff)
target.give(charge_used*charging_efficiency)
@@ -119,7 +141,11 @@
return 0
return cell.percent()
-/obj/machinery/recharge_station/relaymove(mob/user as mob)
+/obj/machinery/recharge_station/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat)
return
go_out()
@@ -215,10 +241,11 @@
if(icon_update_tick == 0)
build_overlays()
-/obj/machinery/recharge_station/CollidedWith(var/mob/living/silicon/robot/R)
- go_in(R)
+/obj/machinery/recharge_station/CollidedWith(atom/movable/AM)
+ if(isliving(AM))
+ go_in(AM)
-/obj/machinery/recharge_station/proc/go_in(var/mob/M)
+/obj/machinery/recharge_station/proc/go_in(mob/living/M)
if(occupant)
return
if(!hascell(M))
@@ -230,9 +257,12 @@
M.reset_view(src)
occupant = M
update_icon()
- return 1
+ return TRUE
/obj/machinery/recharge_station/proc/hascell(var/mob/M)
+ SHOULD_NOT_SLEEP(TRUE)
+ SHOULD_BE_PURE(TRUE)
+
if(isrobot(M))
var/mob/living/silicon/robot/R = M
if(R.cell)
@@ -251,7 +281,7 @@
if(!occupant)
return
- occupant.forceMove(loc)
+ occupant.forceMove(get_turf(src))
occupant.reset_view()
occupant = null
update_icon()
@@ -269,27 +299,6 @@
to_chat(usr, SPAN_DANGER("Cancelled loading [R] into the charger. You and [R] must stay still!"))
return
-/obj/machinery/recharge_station/verb/move_eject()
- set category = "Object"
- set name = "Eject Recharger"
- set src in oview(1)
-
- if(usr.incapacitated())
- return
-
- go_out()
- add_fingerprint(usr)
- return
-
-/obj/machinery/recharge_station/verb/move_inside()
- set category = "Object"
- set name = "Enter Recharger"
- set src in oview(1)
-
- if(!usr.incapacitated())
- return
- go_in(usr)
-
/obj/machinery/recharge_station/MouseDrop_T(atom/dropping, mob/user)
if (istype(dropping, /mob/living/silicon/robot))
var/mob/living/silicon/robot/R = dropping
diff --git a/code/game/machinery/suit_cycler.dm b/code/game/machinery/suit_cycler.dm
index 4947878effc..c9dd7116848 100644
--- a/code/game/machinery/suit_cycler.dm
+++ b/code/game/machinery/suit_cycler.dm
@@ -142,7 +142,11 @@
else
set_light(0)
-/obj/machinery/suit_cycler/relaymove(var/mob/user)
+/obj/machinery/suit_cycler/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
eject_occupant(user)
/obj/machinery/suit_cycler/MouseDrop_T(atom/dropping, mob/user)
diff --git a/code/game/objects/items/devices/aicard.dm b/code/game/objects/items/devices/aicard.dm
index d8022701d25..8e3a0567cf2 100644
--- a/code/game/objects/items/devices/aicard.dm
+++ b/code/game/objects/items/devices/aicard.dm
@@ -175,7 +175,11 @@
carded_ai.show_message(rendered, type)
..()
-/obj/item/aicard/relaymove(var/mob/user, var/direction)
+/obj/item/aicard/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || user.stunned)
return
var/obj/item/rig/rig = src.get_rig()
diff --git a/code/game/objects/items/devices/chameleonproj.dm b/code/game/objects/items/devices/chameleonproj.dm
index 3ab6d5b0433..c531f2892f8 100644
--- a/code/game/objects/items/devices/chameleonproj.dm
+++ b/code/game/objects/items/devices/chameleonproj.dm
@@ -126,8 +126,13 @@
..()
master.disrupt()
-/obj/effect/dummy/chameleon/relaymove(var/mob/user, direction)
- if(istype(loc, /turf/space)) return //No magical space movement!
+/obj/effect/dummy/chameleon/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
+ if(istype(loc, /turf/space))
+ return //No magical space movement!
if(can_move)
can_move = 0
diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm
index e316ddf818f..34381a38f74 100644
--- a/code/game/objects/items/devices/paicard.dm
+++ b/code/game/objects/items/devices/paicard.dm
@@ -16,7 +16,11 @@
light_range = 1
light_color = COLOR_BRIGHT_GREEN
-/obj/item/device/paicard/relaymove(var/mob/user, var/direction)
+/obj/item/device/paicard/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || user.stunned)
return
if(istype(loc, /mob/living/bot))
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index ba531c42432..bfd7d6b9f7e 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -530,7 +530,11 @@
if(istype(user, /mob/living/silicon/robot) && Adjacent(user)) // Robots can open/close it, but not the AI.
attack_hand(user)
-/obj/structure/closet/relaymove(mob/user as mob)
+/obj/structure/closet/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || !isturf(loc))
return
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 78409f00aa0..1eec5b1d17c 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -152,7 +152,11 @@
/obj/structure/closet/statue/MouseDrop_T()
return
-/obj/structure/closet/statue/relaymove()
+/obj/structure/closet/statue/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
return
/obj/structure/closet/statue/attack_hand()
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index 3f65a7de442..408c1f8dfd2 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -358,7 +358,11 @@
has_items = 1
//Shamelessly copied from wheelchair code
-/obj/structure/janitorialcart/relaymove(mob/user, direction)
+/obj/structure/janitorialcart/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || user.stunned || user.weakened || user.paralysis || user.lying || user.restrained())
if(user==pulling)
pulling = null
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index 166a6eadac8..264925eafe5 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -106,7 +106,11 @@
add_fingerprint(user)
return
-/obj/structure/morgue/relaymove(mob/user)
+/obj/structure/morgue/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || locked)
return
var/turf/S = get_step(src, src.dir)
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 c4884d5100e..e9f9e215ec9 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/wheelchair.dm
@@ -20,7 +20,11 @@
if(buckled)
buckled.set_dir(dir)
-/obj/structure/bed/stool/chair/office/wheelchair/relaymove(mob/user, direction)
+/obj/structure/bed/stool/chair/office/wheelchair/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
// Redundant check?
if(user.stat || user.stunned || user.weakened || user.paralysis || user.lying || user.restrained())
if(user==pulling)
diff --git a/code/game/objects/structures/trash_pile.dm b/code/game/objects/structures/trash_pile.dm
index 42965307651..bdce73b0d81 100644
--- a/code/game/objects/structures/trash_pile.dm
+++ b/code/game/objects/structures/trash_pile.dm
@@ -41,7 +41,11 @@
H.take_overall_damage(5, 0, DAMAGE_FLAG_SHARP, src)
to_chat(user, SPAN_WARNING("You cut yourself while climbing into \the [src]!"))
-/obj/structure/trash_pile/relaymove(mob/user)
+/obj/structure/trash_pile/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || user.resting) // don't care too much about use_check here, checking these will suffice
return
user.forceMove(get_turf(src))
diff --git a/code/modules/cooking/machinery/gibber.dm b/code/modules/cooking/machinery/gibber.dm
index 7beb8acb6f2..2ae7553c1a5 100644
--- a/code/modules/cooking/machinery/gibber.dm
+++ b/code/modules/cooking/machinery/gibber.dm
@@ -65,7 +65,11 @@
else
AddOverlays("gridle")
-/obj/machinery/gibber/relaymove(mob/user as mob)
+/obj/machinery/gibber/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
go_out()
return
diff --git a/code/modules/heavy_vehicle/mech_interaction.dm b/code/modules/heavy_vehicle/mech_interaction.dm
index 3b9f0d8b4af..147490fe614 100644
--- a/code/modules/heavy_vehicle/mech_interaction.dm
+++ b/code/modules/heavy_vehicle/mech_interaction.dm
@@ -264,7 +264,11 @@
SIGNAL_HANDLER
INVOKE_ASYNC(src, TYPE_PROC_REF(/atom, relaymove), user, direction, TRUE)
-/mob/living/heavy_vehicle/relaymove(var/mob/living/user, var/direction, var/turn_only = FALSE)
+/mob/living/heavy_vehicle/relaymove(mob/living/user, direction, var/turn_only = FALSE)
+ . = ..()
+ if(!.)
+ return
+
if(!can_move(user))
return
diff --git a/code/modules/holidays/christmas/props.dm b/code/modules/holidays/christmas/props.dm
index c190cd40133..50c026dea97 100644
--- a/code/modules/holidays/christmas/props.dm
+++ b/code/modules/holidays/christmas/props.dm
@@ -76,7 +76,11 @@
qdel(src)
return
-/obj/effect/spresent/relaymove(mob/user as mob)
+/obj/effect/spresent/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if (user.stat)
return
to_chat(user, SPAN_WARNING("You can't move."))
diff --git a/code/modules/mob/living/carbon/brain/MMI.dm b/code/modules/mob/living/carbon/brain/MMI.dm
index a1184c60ec7..cef4479ca7d 100644
--- a/code/modules/mob/living/carbon/brain/MMI.dm
+++ b/code/modules/mob/living/carbon/brain/MMI.dm
@@ -201,7 +201,11 @@
if("Vaurca")
braintype = "vaurca"
-/obj/item/device/mmi/relaymove(var/mob/user, var/direction)
+/obj/item/device/mmi/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || user.stunned)
return
var/obj/item/rig/rig = get_rig()
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 7355de50252..e8d7a9d34e5 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -76,7 +76,11 @@
src.help_up_offer = 0
-/mob/living/carbon/relaymove(var/mob/living/user, direction)
+/mob/living/carbon/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if((user in contents) && istype(user))
if(user.last_special <= world.time)
user.last_special = world.time + 50
diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm
index ffd50ab59b8..3889d8e9443 100644
--- a/code/modules/mob/mob_movement.dm
+++ b/code/modules/mob/mob_movement.dm
@@ -242,8 +242,10 @@
var/old_move_delay = move_delay
- if(!mob)
- return // Moved here to avoid nullrefs below
+ if(!direct || !new_loc)
+ return FALSE
+ if(!mob?.loc)
+ return FALSE
if(mob.control_object)
Move_object(direct)
@@ -307,6 +309,10 @@
if(!mob.lastarea)
mob.lastarea = get_area(mob.loc)
+ if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we are moving out
+ var/atom/O = mob.loc
+ return O.relaymove(mob, direct)
+
if(isturf(mob.loc))
if(!mob.check_solid_ground())
var/allowmove = mob.Allow_Spacemove(0)
@@ -319,15 +325,15 @@
if(mob.restrained()) //Why being pulled while cuffed prevents you from moving
- for(var/mob/M in range(mob, 1))
- if(M.pulling == mob)
- if(!M.restrained() && M.stat == 0 && M.canmove && mob.Adjacent(M))
- to_chat(src, SPAN_NOTICE("You're restrained! You can't move!"))
- return FALSE
- else
- M.stop_pulling()
+ var/mob/puller = mob.pulledby
+ if(puller)
+ if(!puller.restrained() && puller.stat == 0 && puller.canmove && mob.Adjacent(puller))
+ to_chat(src, SPAN_NOTICE("You're restrained! You can't move!"))
+ return FALSE
+ else
+ puller.stop_pulling()
- if(mob.pinned.len)
+ if(length(mob.pinned))
to_chat(src, SPAN_WARNING("You're pinned to a wall by [mob.pinned[1]]!"))
move_delay = world.time + 1 SECOND // prevent spam
return FALSE
@@ -423,7 +429,7 @@
else
. = mob.SelfMove(new_loc, direct)
- for (var/obj/item/grab/G in list(mob:l_hand, mob:r_hand))
+ for (var/obj/item/grab/G in list(mob.l_hand, mob.r_hand))
if (G.state == GRAB_NECK)
mob.set_dir(GLOB.reverse_dir[direct])
G.adjust_position()
@@ -437,10 +443,6 @@
var/mob/living/carbon/human/H = mob
H.species.handle_sprint_cost(H, sprint_tally, FALSE)
- if(isobj(mob.loc) || ismob(mob.loc)) //Inside an object, tell it we moved
- var/atom/O = mob.loc
- return O.relaymove(mob, direct)
-
/mob/living/carbon/human/proc/get_crawl_tally()
var/obj/item/organ/external/rhand = organs_by_name[BP_R_HAND]
. += limb_check(rhand)
diff --git a/code/modules/overmap/ships/computers/helm.dm b/code/modules/overmap/ships/computers/helm.dm
index 3d0ad429a14..b8f1a7f1a28 100644
--- a/code/modules/overmap/ships/computers/helm.dm
+++ b/code/modules/overmap/ships/computers/helm.dm
@@ -109,7 +109,11 @@
PH.set_hud_maptext("| Ship Status | [connected.x]-[connected.y] |
Speed: [round(connected.get_speed()*1000, 0.01)] | Acceleration: [get_acceleration()]
ETA to Next Grid: [get_eta()]")
PH.check_ship_overlay(PH.loc, connected)
-/obj/machinery/computer/ship/helm/relaymove(var/mob/user, direction)
+/obj/machinery/computer/ship/helm/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(viewing_overmap(user) && connected)
connected.relaymove(user, direction, accellimit)
return 1
diff --git a/code/modules/overmap/ships/ship.dm b/code/modules/overmap/ships/ship.dm
index bd82a8faaa9..b4fe6404c1d 100644
--- a/code/modules/overmap/ships/ship.dm
+++ b/code/modules/overmap/ships/ship.dm
@@ -79,8 +79,12 @@ var/const/OVERMAP_SPEED_CONSTANT = (1 SECOND)
. = ..()
-/obj/effect/overmap/visitable/ship/relaymove(mob/user, direction, accel_limit)
- accelerate(direction, accel_limit)
+/obj/effect/overmap/visitable/ship/relaymove(mob/living/user, direction, accel_limit)
+ . = ..()
+ if(!.)
+ return
+
+ INVOKE_ASYNC(src, PROC_REF(accelerate), direction, accel_limit)
/obj/effect/overmap/visitable/ship/proc/is_still()
return !MOVING(speed[1]) && !MOVING(speed[2])
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index ee065638b78..aa5c9b251f4 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -310,7 +310,11 @@
return 1
// attempt to move while inside
-/obj/machinery/disposal/relaymove(mob/user as mob)
+/obj/machinery/disposal/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.stat || src.flushing)
return
if(user.loc == src)
@@ -746,7 +750,11 @@
// called when player tries to move while in a pipe
-/obj/disposalholder/relaymove(mob/user as mob)
+/obj/disposalholder/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(!istype(user,/mob/living))
return
diff --git a/code/modules/spell_system/spells/spell_list/self/generic/ethereal_jaunt.dm b/code/modules/spell_system/spells/spell_list/self/generic/ethereal_jaunt.dm
index eb7552a9698..0ab507fb225 100644
--- a/code/modules/spell_system/spells/spell_list/self/generic/ethereal_jaunt.dm
+++ b/code/modules/spell_system/spells/spell_list/self/generic/ethereal_jaunt.dm
@@ -96,7 +96,11 @@
AM.forceMove(get_turf(src))
return ..()
-/obj/effect/dummy/spell_jaunt/relaymove(var/mob/user, direction)
+/obj/effect/dummy/spell_jaunt/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if (!src.canmove || reappearing) return
var/turf/newLoc = get_step(src,direction)
if(!(newLoc.turf_flags & TURF_FLAG_NOJAUNT))
diff --git a/code/modules/vehicles/animal.dm b/code/modules/vehicles/animal.dm
index fd48035baaa..475663f61a9 100644
--- a/code/modules/vehicles/animal.dm
+++ b/code/modules/vehicles/animal.dm
@@ -90,7 +90,11 @@
return
..()
-/obj/vehicle/animal/relaymove(mob/user, direction)
+/obj/vehicle/animal/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user != load || user.incapacitated())
return
return Move(get_step(src, direction))
diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm
index 6510906d1f8..0d022a05269 100644
--- a/code/modules/vehicles/bike.dm
+++ b/code/modules/vehicles/bike.dm
@@ -189,7 +189,11 @@
to_chat(user, SPAN_NOTICE("\The [src] already has a key in it."))
..()
-/obj/vehicle/bike/relaymove(mob/user, direction)
+/obj/vehicle/bike/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user != load || !on || user.incapacitated())
return
return Move(get_step(src, direction))
diff --git a/code/modules/vehicles/unicycle.dm b/code/modules/vehicles/unicycle.dm
index 7801ad30fa4..8c6f863ff39 100644
--- a/code/modules/vehicles/unicycle.dm
+++ b/code/modules/vehicles/unicycle.dm
@@ -45,7 +45,11 @@
to_chat(user, "You remove [load] from \the [src]")
to_chat(load, "You were removed from \the [src] by [user]")
-/obj/vehicle/unicycle/relaymove(mob/user, direction)
+/obj/vehicle/unicycle/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user != load || !on || user.incapacitated())
return
return Move(get_step(src, direction))
diff --git a/code/modules/ventcrawl/ventcrawl_atmospherics.dm b/code/modules/ventcrawl/ventcrawl_atmospherics.dm
index 83d49a0de5e..da1ff2f138f 100644
--- a/code/modules/ventcrawl/ventcrawl_atmospherics.dm
+++ b/code/modules/ventcrawl/ventcrawl_atmospherics.dm
@@ -24,6 +24,10 @@
. = ..()
/obj/machinery/atmospherics/relaymove(mob/living/user, direction)
+ . = ..()
+ if(!.)
+ return
+
if(user.loc != src || !(direction & initialize_directions)) //can't go in a way we aren't connecting to
return
ventcrawl_to(user,findConnecting(direction, user.ventcrawl_layer),direction)
diff --git a/html/changelogs/fluffyghost-relaymovetweaks.yml b/html/changelogs/fluffyghost-relaymovetweaks.yml
new file mode 100644
index 00000000000..d5ea7311962
--- /dev/null
+++ b/html/changelogs/fluffyghost-relaymovetweaks.yml
@@ -0,0 +1,61 @@
+################################
+# Example Changelog File
+#
+# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
+#
+# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
+# When it is, any changes listed below will disappear.
+#
+# Valid Prefixes:
+# bugfix
+# - (fixes bugs)
+# wip
+# - (work in progress)
+# qol
+# - (quality of life)
+# soundadd
+# - (adds a sound)
+# sounddel
+# - (removes a sound)
+# rscadd
+# - (adds a feature)
+# rscdel
+# - (removes a feature)
+# imageadd
+# - (adds an image or sprite)
+# imagedel
+# - (removes an image or sprite)
+# spellcheck
+# - (fixes spelling or grammar)
+# experiment
+# - (experimental change)
+# balance
+# - (balance changes)
+# code_imp
+# - (misc internal code change)
+# refactor
+# - (refactors code)
+# config
+# - (makes a change to the config files)
+# admin
+# - (makes changes to administrator tools)
+# server
+# - (miscellaneous changes to server)
+#################################
+
+# Your name.
+author: FluffyGhost
+
+# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
+delete-after: True
+
+# Any changes you've made. See valid prefix list above.
+# INDENT WITH TWO SPACES. NOT TABS. SPACES.
+# SCREW THIS UP AND IT WON'T WORK.
+# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
+# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
+changes:
+ - code_imp: "Made relaymoves uniform in function header and non sleepable."
+ - code_imp: "Improved IPC/borg recharger, made it time constant."
+ - code_imp: "Tweaked client/Move() to avoid a range(), moved a relaymove around to fix a bug, some minor tweaks."
+ - bugfix: "Fixed IPC/borg recharge station not taking the IPC/Borg in on bump."