From b2704e06b26ecb6d901edf97616368a0b1e9339d Mon Sep 17 00:00:00 2001
From: Luc <89928798+lewcc@users.noreply.github.com>
Date: Tue, 18 Jan 2022 13:05:44 -0500
Subject: [PATCH] [GBP: No Update] Fixes orbiting in vents and disposals
(#17330)
---
code/datums/components/orbiter.dm | 4 ++--
code/game/objects/structures.dm | 2 ++
code/modules/atmospherics/machinery/atmospherics.dm | 11 +++++++----
code/modules/clothing/under/miscellaneous.dm | 2 +-
code/modules/mining/lavaland/loot/ashdragon_loot.dm | 9 +++------
code/modules/mob/living/carbon/carbon.dm | 4 +++-
code/modules/recycling/disposal.dm | 2 +-
code/modules/recycling/sortingmachinery.dm | 2 +-
8 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/code/datums/components/orbiter.dm b/code/datums/components/orbiter.dm
index 70278371563..053eeae8a8a 100644
--- a/code/datums/components/orbiter.dm
+++ b/code/datums/components/orbiter.dm
@@ -239,7 +239,7 @@
/datum/component/orbiter/proc/orbiter_move_react(atom/movable/orbiter, atom/oldloc, direction)
SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED
- if(get_turf(orbiter) == get_turf(parent) || get_turf(orbiter) == get_turf(oldloc) || get_turf(orbiter) == oldloc)
+ if(get_turf(orbiter) == get_turf(parent) || get_turf(orbiter) == get_turf(oldloc) || get_turf(orbiter) == oldloc || orbiter.loc == oldloc)
return
if(orbiter in orbiter_list)
@@ -269,7 +269,7 @@
if(isturf(start))
return
var/atom/cur_atom = start
- while(!isturf(cur_atom.loc) && !(cur_atom.loc in orbiter_list))
+ while(cur_atom.loc && !isturf(cur_atom.loc) && !(cur_atom.loc in orbiter_list))
RegisterSignal(cur_atom, COMSIG_MOVABLE_MOVED, .proc/on_intermediate_move, TRUE)
RegisterSignal(cur_atom, COMSIG_ATOM_EXITED, .proc/on_remove_child, TRUE)
cur_atom = cur_atom.loc
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 7f982c601fe..beb1968acbb 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -79,7 +79,9 @@
climber = null
return FALSE
+ var/old_loc = usr.loc
usr.loc = get_turf(src)
+ Moved(old_loc, get_dir(old_loc, usr.loc), FALSE)
if(get_turf(user) == get_turf(src))
usr.visible_message("[user] climbs onto \the [src]!")
diff --git a/code/modules/atmospherics/machinery/atmospherics.dm b/code/modules/atmospherics/machinery/atmospherics.dm
index af834970244..aa50720ae72 100644
--- a/code/modules/atmospherics/machinery/atmospherics.dm
+++ b/code/modules/atmospherics/machinery/atmospherics.dm
@@ -290,24 +290,27 @@ Pipelines + Other Objects -> Pipe network
return
var/obj/machinery/atmospherics/target_move = findConnecting(direction)
+ var/old_loc = user.loc
if(target_move)
if(is_type_in_list(target_move, GLOB.ventcrawl_machinery) && target_move.can_crawl_through())
user.remove_ventcrawl()
user.forceMove(target_move.loc) //handles entering and so on
- user.visible_message("You hear something squeezing through the ducts.", "You climb out the ventilation system.")
+ user.visible_message("You hear something squeezing through the ducts.", "You climb out of the ventilation system.")
else if(target_move.can_crawl_through())
if(returnPipenet() != target_move.returnPipenet())
user.update_pipe_vision(target_move)
user.loc = target_move
- user.client.eye = target_move //if we don't do this, Byond only updates the eye every tick - required for smooth movement
+ user.Moved(old_loc, get_dir(old_loc, user.loc), FALSE)
+ user.client.eye = target_move // if we don't do this, Byond only updates the eye every tick - required for smooth movement
if(world.time - user.last_played_vent > VENT_SOUND_DELAY)
user.last_played_vent = world.time
playsound(src, 'sound/machines/ventcrawl.ogg', 50, 1, -3)
else
if((direction & initialize_directions) || is_type_in_list(src, GLOB.ventcrawl_machinery)) //if we move in a way the pipe can connect, but doesn't - or we're in a vent
user.remove_ventcrawl()
- user.forceMove(src.loc)
- user.visible_message("You hear something squeezing through the pipes.", "You climb out the ventilation system.")
+ user.loc = target_move.loc
+ user.Moved(old_loc, get_dir(old_loc, user.loc), FALSE)
+ user.visible_message("You hear something squeezing through the pipes.", "You climb out of the ventilation system.")
user.canmove = 0
spawn(1)
user.canmove = 1
diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm
index 0a211ab698c..84b4d93558c 100644
--- a/code/modules/clothing/under/miscellaneous.dm
+++ b/code/modules/clothing/under/miscellaneous.dm
@@ -752,7 +752,7 @@
var/list/slot_must_be_empty = list(slot_back,slot_handcuffed,slot_legcuffed,slot_l_hand,slot_r_hand,slot_belt,slot_head,slot_wear_suit)
for(var/slot_id in slot_must_be_empty)
if(user.get_item_by_slot(slot_id))
- to_chat(user,"You can't fit inside while wearing that \the [user.get_item_by_slot(slot_id)].")
+ to_chat(user,"You can't fit inside while wearing \the [user.get_item_by_slot(slot_id)].")
return 0
return 1
diff --git a/code/modules/mining/lavaland/loot/ashdragon_loot.dm b/code/modules/mining/lavaland/loot/ashdragon_loot.dm
index e4981140462..9d16fd40dd5 100644
--- a/code/modules/mining/lavaland/loot/ashdragon_loot.dm
+++ b/code/modules/mining/lavaland/loot/ashdragon_loot.dm
@@ -108,8 +108,8 @@
UnregisterSignal(A, COMSIG_ATOM_ORBIT_BEGIN)
/obj/item/melee/ghost_sword/proc/register_signals(atom/A)
- RegisterSignal(A, COMSIG_ATOM_ORBIT_BEGIN, .proc/add_ghost)
- RegisterSignal(A, COMSIG_ATOM_ORBIT_STOP, .proc/remove_ghost)
+ RegisterSignal(A, COMSIG_ATOM_ORBIT_BEGIN, .proc/add_ghost, override = TRUE)
+ RegisterSignal(A, COMSIG_ATOM_ORBIT_STOP, .proc/remove_ghost, override = TRUE)
/**
* When moving into something's contents
@@ -123,12 +123,9 @@
remove_ghost(orbiter)
if(ismob(loc))
register_signals(loc)
- for(var/mob/dead/observer/orbiter in old_loc.get_orbiters())
+ for(var/mob/dead/observer/orbiter in loc.get_orbiters())
add_ghost(orbiter)
-/obj/item/melee/ghost_sword/proc/on_leave_item()
- SIGNAL_HANDLER // on move
-
/obj/item/melee/ghost_sword/attack(mob/living/target, mob/living/carbon/human/user)
force = 0
var/ghost_counter = length(spirits)
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 1d33fc25ec9..53e48bae7e0 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -497,7 +497,9 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
return
visible_message("[src] scrambles into the ventilation ducts!", "You climb into the ventilation system.")
- src.loc = vent_found
+ var/old_loc = loc
+ loc = vent_found
+ Moved(old_loc, get_dir(old_loc, loc), FALSE)
add_ventcrawl(vent_found)
else
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 9cf0e6e231c..95572b2c4df 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -406,7 +406,7 @@
flick("[icon_state]-flush", src)
var/wrapcheck = 0
- var/obj/structure/disposalholder/H = new() // virtual holder object which actually
+ var/obj/structure/disposalholder/H = new(src) // virtual holder object which actually
// travels through the pipes.
//Hacky test to get drones to mail themselves through disposals.
for(var/mob/living/silicon/robot/drone/D in src)
diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm
index edd3f4f1c60..ddbc5b97517 100755
--- a/code/modules/recycling/sortingmachinery.dm
+++ b/code/modules/recycling/sortingmachinery.dm
@@ -312,7 +312,7 @@
flushing = 1
flick("intake-closing", src)
var/deliveryCheck = 0
- var/obj/structure/disposalholder/H = new() // virtual holder object which actually
+ var/obj/structure/disposalholder/H = new(src) // virtual holder object which actually
// travels through the pipes.
for(var/obj/structure/bigDelivery/O in src)
deliveryCheck = 1