[MIRROR] Fixes lateload map template cable loading (#9851)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-01-12 08:03:47 -07:00
committed by GitHub
parent c1cd7dc3f0
commit f19a517d0f
17 changed files with 28 additions and 25 deletions

View File

@@ -35,7 +35,7 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
#define NOREACT (1<<6) // Reagents don't react inside this container.
#define OVERLAY_QUEUED (1<<7)// Atom queued to SSoverlay for COMPILE_OVERLAYS
#define IS_BUSY (1<<8) // Atom has a TASK_TARGET_EXCLUSIVE do_after with it as the target.
#define ATOM_INITIALIZED (1<<14) // Atom has been initialized. Using a flag instead of a variable saves ~25mb total. //CHOMPEdit
#define ATOM_INITIALIZED (1<<23) // Atom has been initialized. Using a flag instead of a variable saves ~25mb total.
//Flags for items (equipment) - Used in /obj/item/var/item_flags
#define THICKMATERIAL (1<<0) // Prevents syringes, parapens and hyposprays if equipped to slot_suit or slot_head.

View File

@@ -114,11 +114,12 @@
#define AREA_BLOCK_SUIT_SENSORS 0x800 // If suit sensors are blocked in the area.
#define AREA_BLOCK_TRACKING 0x1000 // If camera tracking is blocked in the area.
#define AREA_BLOCK_GHOST_SIGHT 0x2000 // If an area blocks sight for ghosts
// The 0x800000 is blocked by INITIALIZED, do NOT use it!
// CHOMPAdd Start/area
#define PHASE_SHIELDED 0x200000 // A less rough way to prevent phase shifting without blocking access
#define AREA_LIMIT_DARK_RESPITE 0x400000// Shadekin will die normally in those areas
#define AREA_ALLOW_CLOCKOUT 0x800000 //The PDA timeclock app can only be used in these areas
#define PHASE_SHIELDED 0x100000 // A less rough way to prevent phase shifting without blocking access
#define AREA_LIMIT_DARK_RESPITE 0x200000// Shadekin will die normally in those areas
#define AREA_ALLOW_CLOCKOUT 0x400000 //The PDA timeclock app can only be used in these areas
// CHOMPAdd End
// OnTopic return values

View File

@@ -8,6 +8,7 @@
#define TURF_HAS_CORNERS 128
#define TURF_IS_FRAGILE 256
#define TURF_ACID_IMMUNE 512
// The 0x800000 is blocked by INITIALIZED, do NOT use it!
//Used for floor/wall smoothing
#define SMOOTH_NONE 0 //Smooth only with itself

View File

@@ -39,7 +39,7 @@ SUBSYSTEM_DEF(atoms)
created_atoms = list()
count = atoms.len
for(var/atom/A as anything in atoms)
if(!(A.flags & ATOM_INITIALIZED)) //CHOMPEdit
if(!(A.flags & ATOM_INITIALIZED))
if(InitAtom(A, mapload_arg))
atoms -= A
CHECK_TICK

View File

@@ -39,7 +39,7 @@
//Detective Work, used for the duplicate data points kept in the scanners
var/list/original_atom
// Track if we are already had initialize() called to prevent double-initialization.
//var/initialized = FALSE CHOMPEdit moved to flag
//var/initialized = FALSE // using the atom flags
/// Last name used to calculate a color for the chatmessage overlays
var/chat_color_name
@@ -91,9 +91,9 @@
/atom/proc/Initialize(mapload, ...)
if(QDELETED(src))
stack_trace("GC: -- [type] had initialize() called after qdel() --")
if(flags & ATOM_INITIALIZED) //CHOMPEdit moved initialized to flag
if(flags & ATOM_INITIALIZED)
stack_trace("Warning: [src]([type]) initialized multiple times!")
flags |= ATOM_INITIALIZED //CHOMPEdit moved initialized to flag
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_NORMAL
/atom/Destroy()

View File

@@ -15,7 +15,7 @@
var/list/blend_objects = null // Objects which to blend with //CHOMPEdit default null
var/list/noblend_objects = null //Objects to avoid blending with (such as children of listed blend objects. //CHOMPEdit default null
/obj/structure/Initialize()
/obj/structure/Initialize(mapload)
. = ..()
if(climbable)
verbs += /obj/structure/proc/climb_on

View File

@@ -58,7 +58,7 @@
activated = 1
for(var/obj/effect/wingrille_spawn/other in neighbours)
if(!other.activated) other.activate()
if((flags & ATOM_INITIALIZED) && !QDELETED(src)) //CHOMPEdit
if((flags & ATOM_INITIALIZED) && !QDELETED(src))
qdel(src)
/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)

View File

@@ -21,7 +21,7 @@ var/list/floor_decals = list()
// abstract handler that explicitly doesn't invoke any obj behavior.
/obj/effect/floor_decal/Initialize()
add_to_turf_decals()
flags |= ATOM_INITIALIZED //CHOMPEdit
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_QDEL
// This is a separate proc from initialize() to facilitiate its caching and other stuff. Look into it someday.

View File

@@ -7,7 +7,7 @@
/turf/unsimulated/Initialize(mapload)
if(skip_init)
flags |= ATOM_INITIALIZED //CHOMPEdit
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_NORMAL
. = ..()
@@ -17,7 +17,6 @@
icon = 'icons/turf/space.dmi'
icon_state = "0"
dynamic_lighting = FALSE
//initialized = FALSE CHOMP Removal (what the fuck)
/turf/unsimulated/fake_space/Initialize(mapload)
. = ..()

View File

@@ -8,7 +8,6 @@
icon = 'icons/turf/floors.dmi'
icon_state = "sky_slow"
dir = SOUTH
//initialized = FALSE CHOMPRemoval
var/does_skyfall = TRUE
var/list/skyfall_levels

View File

@@ -15,10 +15,11 @@
var/discard_prob = 0 // If non-zero, there is a chance that the map seeding algorithm will skip this template when selecting potential templates to use.
/datum/map_template/New(path = null, rename = null)
SHOULD_CALL_PARENT(TRUE)
. = ..()
if(path)
mappath = path
if(mappath)
spawn(1)
preload_size(mappath)
if(rename)
name = rename
@@ -46,7 +47,6 @@
var/list/turf/turfs = block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]),
locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ]))
for(var/turf/B as anything in turfs)
atoms += B
areas |= B.loc
for(var/A in B)
atoms += A
@@ -57,7 +57,7 @@
atoms |= areas
admin_notice(span_danger("Initializing newly created atom(s) in submap."), R_DEBUG)
SSatoms.InitializeAtoms(atoms)
SSatoms.InitializeAtoms(areas + turfs + atoms)
admin_notice(span_danger("Initializing atmos pipenets and machinery in submap."), R_DEBUG)
SSmachines.setup_atmos_machinery(atmos_machines)

View File

@@ -97,7 +97,7 @@
var/new_type = pickweight(sk_types)
new new_type(loc)
flags |= ATOM_INITIALIZED //CHOMPEdit
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_QDEL
if(icon_state == "map_example")

View File

@@ -31,7 +31,7 @@
else
forceMove(locate(1,1,1))
//CHOMPEdit End
flags |= ATOM_INITIALIZED // Explicitly don't use Initialize(). New players join super early and use New() //CHOMPEdit
flags |= ATOM_INITIALIZED // Explicitly don't use Initialize(). New players join super early and use New()
/mob/new_player/Destroy()

View File

@@ -89,7 +89,7 @@ var/list/possible_cable_coil_colours = list(
/obj/structure/cable/white
color = COLOR_WHITE
/obj/structure/cable/Initialize()
/obj/structure/cable/Initialize(mapload)
. = ..()
// ensure d1 & d2 reflect the icon_state for entering and exiting cable
@@ -158,6 +158,9 @@ var/list/possible_cable_coil_colours = list(
return 1
/obj/structure/cable/update_icon()
// We rely on the icon state for the wire Initialize(), prevent any updates to the icon before init passed
if(!(flags & ATOM_INITIALIZED))
return
icon_state = "[d1]-[d2]"
alpha = invisibility ? 127 : 255

View File

@@ -70,7 +70,7 @@
new /datum/random_map/automata/cave_system/no_cracks(null, 1, 1, Z_LEVEL_BEACH_CAVE, world.maxx, world.maxy)
new /datum/random_map/noise/ore/beachmine(null, 1, 1, Z_LEVEL_BEACH_CAVE, 64, 64)*/
initialized = TRUE
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_QDEL
// Two mob spawners that are placed on the map that spawn some mobs!

View File

@@ -45,7 +45,7 @@
name = "away mission initializer - debrisfield"
/obj/away_mission_init/debrisfield/Initialize()
initialized = TRUE
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_QDEL
/area/tether_away/debrisfield

View File

@@ -488,7 +488,7 @@
if(!LAZYLEN(mobs_to_pick_from))
error("Mob spawner at [x],[y],[z] ([get_area(src)]) had no mobs_to_pick_from set on it!")
initialized = TRUE
flags |= ATOM_INITIALIZED
return INITIALIZE_HINT_QDEL
START_PROCESSING(SSobj, src)