Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tramstation random failure cherrypick #359

Merged
merged 2 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions _maps/shuttles/emergency_tram.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,6 @@
},
/turf/open/floor/mineral/titanium/yellow,
/area/shuttle/escape)
"aU" = (
/turf/open/openspace/airless,
/area/template_noop)
"aV" = (
/obj/machinery/light/directional/east,
/obj/item/radio/intercom/directional/north,
Expand Down Expand Up @@ -426,7 +423,7 @@ ak
aQ
ak
aj
aU
aa
aj
ak
aW
Expand All @@ -435,7 +432,7 @@ aW
ak
ak
aj
aU
aa
aj
ak
ak
Expand All @@ -460,7 +457,7 @@ aO
aE
aS
ak
aU
aa
ak
aE
aE
Expand All @@ -469,7 +466,7 @@ aE
aE
aP
ak
aU
aa
ak
aX
bc
Expand Down Expand Up @@ -664,7 +661,7 @@ aE
aE
aE
ak
aU
aa
ak
aV
aE
Expand All @@ -673,7 +670,7 @@ aE
aE
aE
ak
aU
aa
ak
bb
bd
Expand All @@ -698,7 +695,7 @@ ab
ab
ak
aj
aU
aa
aj
ak
ab
Expand All @@ -707,7 +704,7 @@ ab
ab
ak
aj
aU
aa
aj
ak
ak
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/dcs/signals/signals_atom/signals_atom_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// All signals send the source datum of the signal as the first argument

// /atom signals
///from base of atom/proc/Initialize(): sent any time a new atom is created in this atom
#define COMSIG_ATOM_INITIALIZED_ON "atom_initialized_on"
//from SSatoms InitAtom - Only if the atom was not deleted or failed initialization
#define COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE "atom_init_success"
//from SSatoms InitAtom - Only if the atom was not deleted or failed initialization and has a loc
#define COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON "atom_init_success_on"
///from base of atom/examine(): (/mob, list/examine_text)
#define COMSIG_PARENT_EXAMINE "atom_examine"
///from base of atom/get_examine_name(): (/mob, list/overrides)
Expand Down
7 changes: 6 additions & 1 deletion code/controllers/subsystem/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,12 @@ SUBSYSTEM_DEF(atoms)
else if(!(A.flags_1 & INITIALIZED_1))
BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT
else
SEND_SIGNAL(A,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE)
SEND_SIGNAL(A, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZE)
// SEND_GLOBAL_SIGNAL(COMSIG_GLOB_ATOM_AFTER_POST_INIT, A)
var/atom/location = A.loc
if(location)
/// Sends a signal that the new atom `src`, has been created at `loc`
SEND_SIGNAL(location, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, A, arguments[1])
if(created_atoms && from_template && ispath(the_type, /atom/movable))//we only want to populate the list with movables
created_atoms += A.get_all_contents()

Expand Down
2 changes: 1 addition & 1 deletion code/datums/proximity_monitor/proximity_monitor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
COMSIG_ATOM_EXITED = PROC_REF(on_uncrossed),
COMSIG_ATOM_INITIALIZED_ON = PROC_REF(on_entered),
COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(on_entered),
)

/datum/proximity_monitor/New(atom/_host, range, _ignore_if_not_on_turf = TRUE)
Expand Down
3 changes: 0 additions & 3 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,6 @@
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags_1 |= INITIALIZED_1

if(loc)
SEND_SIGNAL(loc, COMSIG_ATOM_INITIALIZED_ON, src) /// Sends a signal that the new atom `src`, has been created at `loc`

SET_PLANE_IMPLICIT(src, plane)

if(greyscale_config && greyscale_colors) //we'll check again at item/init for inhand/belt/worn configs.
Expand Down
6 changes: 4 additions & 2 deletions code/game/turfs/open/openspace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
// I am so sorry
/turf/open/openspace/Initialize(mapload) // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
. = ..()
RegisterSignal(src, COMSIG_ATOM_INITIALIZED_ON, PROC_REF(on_atom_created))
if(PERFORM_ALL_TESTS(focus_only/openspace_clear) && !SSmapping.get_turf_below(src, DOWN))
stack_trace("[src] was inited as openspace with nothing below it at ([x], [y], [z])")
RegisterSignal(src, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, PROC_REF(on_atom_created))
var/area/our_area = loc
if(istype(our_area, /area/space))
force_no_gravity = TRUE
Expand All @@ -34,7 +36,7 @@
AddElement(/datum/element/turf_z_transparency)

/turf/open/openspace/ChangeTurf(path, list/new_baseturfs, flags)
UnregisterSignal(src, COMSIG_ATOM_INITIALIZED_ON)
UnregisterSignal(src, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON)
return ..()

/**
Expand Down
9 changes: 9 additions & 0 deletions code/game/turfs/open/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,8 @@

/turf/open/space/openspace/Initialize(mapload) // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
. = ..()
if(PERFORM_ALL_TESTS(focus_only/openspace_clear) && !SSmapping.get_turf_below(src, DOWN))
stack_trace("[src] was inited as openspace with nothing below it at ([x], [y], [z])")
icon_state = "pure_white"
// We make the assumption that the space plane will never be blacklisted, as an optimization
if(SSmapping.max_plane_offset)
Expand All @@ -261,6 +263,13 @@
. = ..()
AddElement(/datum/element/turf_z_transparency)

/turf/open/space/openspace/Destroy()
// Signals persist through destroy, GO HOME
var/turf/below = SSmapping.get_turf_below(src, DOWN)
if(below)
UnregisterSignal(below, COMSIG_TURF_CHANGE)
return ..()

/turf/open/space/openspace/zAirIn()
return TRUE

Expand Down
4 changes: 2 additions & 2 deletions code/modules/industrial_lift/industrial_lift.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ GLOBAL_LIST_EMPTY(lifts)
/obj/structure/industrial_lift/proc/set_movement_registrations(list/turfs_to_set)
for(var/turf/turf_loc as anything in turfs_to_set || locs)
RegisterSignal(turf_loc, COMSIG_ATOM_EXITED, PROC_REF(UncrossedRemoveItemFromLift))
RegisterSignals(turf_loc, list(COMSIG_ATOM_ENTERED,COMSIG_ATOM_INITIALIZED_ON), PROC_REF(AddItemOnLift))
RegisterSignals(turf_loc, list(COMSIG_ATOM_ENTERED,COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON), PROC_REF(AddItemOnLift))

///unset our movement registrations from turfs that no longer contain us (or every loc if turfs_to_unset is unspecified)
/obj/structure/industrial_lift/proc/unset_movement_registrations(list/turfs_to_unset)
var/static/list/registrations = list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_EXITED, COMSIG_ATOM_INITIALIZED_ON)
var/static/list/registrations = list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_EXITED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON)
for(var/turf/turf_loc as anything in turfs_to_unset || locs)
UnregisterSignal(turf_loc, registrations)

Expand Down
6 changes: 3 additions & 3 deletions code/modules/mining/machine_processing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
/obj/machinery/mineral/proc/register_input_turf()
input_turf = get_step(src, input_dir)
if(input_turf) // make sure there is actually a turf
RegisterSignals(input_turf, list(COMSIG_ATOM_INITIALIZED_ON, COMSIG_ATOM_ENTERED), PROC_REF(pickup_item))
RegisterSignals(input_turf, list(COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON, COMSIG_ATOM_ENTERED), PROC_REF(pickup_item))

/// Unregisters signals that are registered the machine's input turf, if it has one.
/obj/machinery/mineral/proc/unregister_input_turf()
if(input_turf)
UnregisterSignal(input_turf, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_INITIALIZED_ON))
UnregisterSignal(input_turf, list(COMSIG_ATOM_ENTERED, COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON))

/obj/machinery/mineral/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
Expand All @@ -46,7 +46,7 @@
/**
Base proc for all `/mineral` subtype machines to use. Place your item pickup behavior in this proc when you override it for your specific machine.

Called when the COMSIG_ATOM_ENTERED and COMSIG_ATOM_INITIALIZED_ON signals are sent.
Called when the COMSIG_ATOM_ENTERED and COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON signals are sent.

Arguments:
* source - the turf that is listening for the signals.
Expand Down
2 changes: 1 addition & 1 deletion code/modules/recycling/conveyor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
var/static/list/loc_connections = list(
COMSIG_ATOM_EXITED = PROC_REF(conveyable_exit),
COMSIG_ATOM_ENTERED = PROC_REF(conveyable_enter),
COMSIG_ATOM_INITIALIZED_ON = PROC_REF(conveyable_enter)
COMSIG_ATOM_AFTER_SUCCESSFUL_INITIALIZED_ON = PROC_REF(conveyable_enter)
)
AddElement(/datum/element/connect_loc, loc_connections)
update_move_direction()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/unit_tests/create_and_destroy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
ignore += subtypesof(/obj/machinery/airlock_controller)
// Always ought to have an associated escape menu. Any references it could possibly hold would need one regardless.
ignore += subtypesof(/atom/movable/screen/escape_menu)
// Can't spawn openspace above nothing, it'll get pissy at me
ignore += typesof(/turf/open/space/openspace)
ignore += typesof(/turf/open/openspace)

var/list/cached_contents = spawn_at.contents.Copy()
var/original_turf_type = spawn_at.type
Expand Down
3 changes: 3 additions & 0 deletions code/modules/unit_tests/focus_only_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,6 @@

/// Checks for bad icon / icon state setups in cooking crafting menu
/datum/unit_test/focus_only/bad_cooking_crafting_icons

/// Ensures openspace never spawns on the bottom of a z stack
/datum/unit_test/focus_only/openspace_clear