[GBP: No Update] Fixes orbiting in vents and disposals (#17330)

This commit is contained in:
Luc
2022-01-18 19:05:44 +01:00
committed by GitHub
parent f85420ec01
commit b2704e06b2
8 changed files with 20 additions and 16 deletions
+2 -2
View File
@@ -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
+2
View File
@@ -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("<span class='warning'>[user] climbs onto \the [src]!</span>")
@@ -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
+1 -1
View File
@@ -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,"<span class='warning'>You can't fit inside while wearing that \the [user.get_item_by_slot(slot_id)].</span>")
to_chat(user,"<span class='warning'>You can't fit inside while wearing \the [user.get_item_by_slot(slot_id)].</span>")
return 0
return 1
@@ -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)
+3 -1
View File
@@ -497,7 +497,9 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
return
visible_message("<b>[src] scrambles into the ventilation ducts!</b>", "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
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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