Files
Paradise/code/controllers/subsystem/non_firing/SSatoms.dm
Contrabang 3f87165a03 CI now bans files with the same name (PART 2) (#21051)
* CI change

* world.dm

* .dme world.dm

* subsystem renaming

* .dme for subsystems

* ai_laws.dm

* armor.dm

* emote.dm

* logging.dm

* spell.dm

* air_alarm.dm

* crew.dm

* decal.dm

* emissive_blocker.dm

* footstep.dm

* spawner.dm

* fire.dm

* carbon.dm

* living.dm

* mob.dm

* movement.dm

* thermal_drill.dm

* plasmamen.dm

* lavaland.dm

* chaplain.dm

* lightning.dm

* magnet.dm

* mimic.dm

* wizard.dm

* morph.dm

* vampire.dm

* click.dm

* self.dm

* radiation_storm.dm

* airlock.dm

* autolathe.dm

* mulebot.dm

* nuclearbomb.dm

* particle_accelerator.dm

* smartfridge.dm

* syndicatebomb.dm

* vending.dm

* wires.dm

* sound.dm

* mining.dm

* syndicate_space_base.dm

* monkey.dm

* guardian.dm

* bomb.dm

* standard.dm

* nuclear.dm

* pinpointer.dm

* access.dm

* departments.dm

* job.dm

* science.dm

* buttons.dm

* cloning.dm

* igniter.dm

* wishgranter.dm

* atmos_control.dm

* message.dm

* power_monitor.dm

* mecha.dm

* combat.dm

* mining_tools.dm

* meteors.dm

* spiders.dm

* contraband.dm

* aliens.dm

* uplinks.dm

* voice.dm

* intercom.dm

* lights.dm

* robot_items.dm

* mineral.dm

* dice.dm

* extinguisher.dm

* paint.dm

* signs.dm

* staff.dm

* smokebomb.dm

* boxes.dm

* random.dm

* janicart.dm

* statue.dm

* cargo.dm

* asteroid.dm

* headslug.dm

* fulton.dm

* atmospherics.dm

* pump.dm

* corpse.dm

* oldstation.dm

* gps.dm

* preferences.dm

* clothing.dm

* ears.dm

* glasses.dm

* boxing.dm

* color.dm

* renames ninja gear files

* recipes.dm

* error_handler.dm

* anomaly.dm

* floorcluwne.dm

* undead.dm

* overmind.dm

* shield.dm

* bottle.dm

* organ.dm

* piano.dm

* plasma_fist.dm

* language.dm

* mob_defines.dm

* mob_helpers.dm

* damage_procs.dm

* _defines.dm

* empress.dm and queen.dm

* brain.dm

* organ file renaming

* subsystems.dm

* constructs.dm

* bot.dm

* pet.dm

* nature.dm

* magic.dm

* colors.dm

* drugs.dm

* medicine.dm

* toxins.dm

* shuttle.dm

* surgery.dm

* moves a bunch of define files

* traits.dm

* names.dm

* other_mobs.dm

* flags.dm

* some final define files

* well turns out contractor_pinpointer.dm was  taken

* I forgot to remove this file

* how in the hell did this get unticked

* I DID INCLUDE IT, but there was a "w" there

* swaps the world definitions

* camera renamed to SScamera

* examine -> alien_examine
2023-06-02 14:30:17 -05:00

125 lines
3.0 KiB
Plaintext

#define BAD_INIT_QDEL_BEFORE 1
#define BAD_INIT_DIDNT_INIT 2
#define BAD_INIT_SLEPT 4
#define BAD_INIT_NO_HINT 8
SUBSYSTEM_DEF(atoms)
name = "Atoms"
init_order = INIT_ORDER_ATOMS
flags = SS_NO_FIRE
var/old_initialized
var/list/late_loaders
var/list/BadInitializeCalls = list()
/datum/controller/subsystem/atoms/Initialize()
setupgenetics()
initialized = INITIALIZATION_INNEW_MAPLOAD
InitializeAtoms()
/datum/controller/subsystem/atoms/proc/InitializeAtoms(list/atoms, noisy = TRUE)
if(initialized == INITIALIZATION_INSSATOMS)
return
initialized = INITIALIZATION_INNEW_MAPLOAD
LAZYINITLIST(late_loaders)
var/watch = start_watch()
if(noisy)
log_startup_progress("Initializing atoms...")
else
log_debug("Initializing atoms...")
var/count
var/list/mapload_arg = list(TRUE)
if(atoms)
count = atoms.len
for(var/I in atoms)
var/atom/A = I
if(A && !A.initialized)
InitAtom(I, mapload_arg)
CHECK_TICK
else
count = 0
for(var/atom/A in world)
if(!A.initialized)
InitAtom(A, mapload_arg)
++count
CHECK_TICK
if(noisy)
log_startup_progress("Initialized [count] atoms in [stop_watch(watch)]s")
else
log_debug(" Initialized [count] atoms in [stop_watch(watch)]s")
pass(count)
initialized = INITIALIZATION_INNEW_REGULAR
if(late_loaders.len)
watch = start_watch()
if(noisy)
log_startup_progress("Late-initializing atoms...")
else
log_debug("Late-initializing atoms...")
for(var/I in late_loaders)
var/atom/A = I
A.LateInitialize()
CHECK_TICK
if(noisy)
log_startup_progress("Late initialized [length(late_loaders)] atoms in [stop_watch(watch)]s")
else
log_debug(" Late initialized [length(late_loaders)] atoms in [stop_watch(watch)]s")
late_loaders.Cut()
/datum/controller/subsystem/atoms/proc/InitAtom(atom/A, list/arguments)
var/the_type = A.type
if(QDELING(A))
BadInitializeCalls[the_type] |= BAD_INIT_QDEL_BEFORE
return TRUE
var/start_tick = world.time
var/result = A.Initialize(arglist(arguments))
if(start_tick != world.time)
BadInitializeCalls[the_type] |= BAD_INIT_SLEPT
var/qdeleted = FALSE
if(result != INITIALIZE_HINT_NORMAL)
switch(result)
if(INITIALIZE_HINT_LATELOAD)
if(arguments[1]) //mapload
late_loaders += A
else
A.LateInitialize()
if(INITIALIZE_HINT_QDEL)
qdel(A)
qdeleted = TRUE
else
BadInitializeCalls[the_type] |= BAD_INIT_NO_HINT
if(!A) //possible harddel
qdeleted = TRUE
else if(!A.initialized)
BadInitializeCalls[the_type] |= BAD_INIT_DIDNT_INIT
return qdeleted || QDELING(A)
/datum/controller/subsystem/atoms/proc/map_loader_begin()
old_initialized = initialized
initialized = INITIALIZATION_INSSATOMS
/datum/controller/subsystem/atoms/proc/map_loader_stop()
initialized = old_initialized
/datum/controller/subsystem/atoms/Recover()
initialized = SSatoms.initialized
if(initialized == INITIALIZATION_INNEW_MAPLOAD)
InitializeAtoms()
old_initialized = SSatoms.old_initialized
BadInitializeCalls = SSatoms.BadInitializeCalls