From be73b8c36adeb238acc637d2e28ff9efbf49fa06 Mon Sep 17 00:00:00 2001 From: Neerti Date: Sun, 29 Apr 2018 17:55:04 -0400 Subject: [PATCH] for(var/bad_code in world) Removes a very large amount of world loops. Adds a macro to painlessly generate a global list, and the needed code to modify the list when an object is made or deleted automatically. Cleans up some commented out code. --- code/__defines/misc.dm | 21 ++- code/_helpers/game.dm | 2 +- code/_helpers/unsorted.dm | 12 +- .../emergency_shuttle_controller.dm | 4 +- code/controllers/master_controller.dm | 59 --------- code/controllers/subsystems/air.dm | 2 +- code/controllers/subsystems/atoms.dm | 2 +- code/controllers/subsystems/xenoarch.dm | 2 +- code/game/antagonist/antagonist_panel.dm | 2 +- code/game/area/areas.dm | 4 +- code/game/atoms.dm | 2 + code/game/gamemodes/cult/ritual.dm | 2 +- code/game/gamemodes/cult/runes.dm | 12 +- code/game/gamemodes/events.dm | 16 +-- code/game/gamemodes/events/power_failure.dm | 10 +- code/game/gamemodes/events/wormholes.dm | 2 +- .../tree_interdiction.dm | 2 +- code/game/gamemodes/nuclear/nuclear.dm | 2 +- code/game/gamemodes/nuclear/pinpointer.dm | 2 +- code/game/gamemodes/objective.dm | 2 +- code/game/machinery/camera/presets.dm | 2 +- code/game/machinery/computer/ai_core.dm | 4 +- .../game/machinery/computer/communications.dm | 2 +- code/game/machinery/computer/medical.dm | 2 +- code/game/machinery/computer/pod.dm | 10 +- code/game/machinery/computer/prisoner.dm | 4 +- .../machinery/computer/specops_shuttle.dm | 10 +- .../machinery/computer3/computers/crew.dm | 2 +- .../machinery/computer3/computers/medical.dm | 2 +- .../machinery/computer3/computers/prisoner.dm | 4 +- code/game/machinery/cryopod.dm | 2 +- code/game/machinery/door_control.dm | 6 +- code/game/machinery/doors/airlock.dm | 2 +- code/game/machinery/doors/brigdoors.dm | 2 +- code/game/machinery/magnet.dm | 4 +- code/game/machinery/requests_console.dm | 2 +- code/game/machinery/syndicatebeacon.dm | 4 +- code/game/machinery/teleporter.dm | 4 +- code/game/machinery/turret_control.dm | 2 +- code/game/objects/effects/portals.dm | 2 + code/game/objects/explosion.dm | 2 +- code/game/objects/items.dm | 4 +- code/game/objects/items/devices/PDA/PDA.dm | 2 +- code/game/objects/items/devices/PDA/cart.dm | 8 +- code/game/objects/items/devices/paicard.dm | 2 + .../objects/items/devices/radio/beacon.dm | 2 + .../objects/items/weapons/implants/implant.dm | 4 + code/game/objects/items/weapons/mop.dm | 3 +- .../objects/items/weapons/teleportation.dm | 8 +- code/game/objects/objs.dm | 2 + .../crates_lockers/closets/secure/security.dm | 2 +- code/game/objects/structures/janicart.dm | 2 + code/game/objects/structures/mop_bucket.dm | 1 + code/game/objects/structures/morgue.dm | 4 +- .../secrets/fun_secrets/fix_all_lights.dm | 2 +- .../fun_secrets/remove_all_clothing.dm | 2 +- .../fun_secrets/remove_internal_clothing.dm | 2 +- .../admin/secrets/random_events/gravity.dm | 2 +- code/modules/admin/verbs/SDQL.dm | 22 ++-- code/modules/admin/verbs/adminjump.dm | 2 +- code/modules/admin/verbs/atmosdebug.dm | 8 +- code/modules/admin/verbs/debug.dm | 124 +++--------------- code/modules/admin/verbs/diagnostics.dm | 2 +- code/modules/admin/verbs/grief_fixers.dm | 2 +- code/modules/admin/verbs/mapping.dm | 12 +- code/modules/admin/verbs/massmodvar.dm | 48 +++---- code/modules/admin/verbs/playsound.dm | 10 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/admin/view_variables/topic.dm | 4 +- code/modules/assembly/signaler.dm | 8 -- code/modules/clothing/clothing.dm | 2 + code/modules/events/escaped_slimes.dm | 2 +- code/modules/events/gravity.dm | 4 +- code/modules/events/ion_storm.dm | 14 +- code/modules/events/money_hacker.dm | 4 +- code/modules/events/prison_break.dm | 4 +- code/modules/events/spider_infestation.dm | 2 +- code/modules/hydroponics/seed_controller.dm | 2 +- code/modules/hydroponics/seed_packets.dm | 2 + code/modules/lighting/lighting_setup.dm | 2 +- code/modules/maps/tg/reader.dm | 2 +- code/modules/mob/dead/observer/observer.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 8 +- code/modules/mob/living/silicon/ai/death.dm | 2 +- code/modules/mob/living/silicon/ai/logout.dm | 2 +- .../modules/mob/living/silicon/decoy/death.dm | 2 +- .../modules/mob/living/silicon/pai/recruit.dm | 2 +- .../mob/living/silicon/robot/drone/drone.dm | 5 +- .../silicon/robot/drone/drone_console.dm | 6 +- .../silicon/robot/drone/drone_manufacturer.dm | 7 +- code/modules/organs/internal/brain.dm | 2 + code/modules/power/fusion/_setup.dm | 4 +- code/modules/power/sensors/powernet_sensor.dm | 2 +- code/modules/power/singularity/singularity.dm | 2 + .../power/supermatter/setup_supermatter.dm | 10 +- code/modules/recycling/conveyor2.dm | 10 +- code/modules/recycling/disposal.dm | 4 +- .../security levels/keycard authentication.dm | 2 +- code/modules/shuttles/shuttle_specops.dm | 4 +- code/modules/xenoarcheaology/tools/tools.dm | 2 +- code/unit_tests/map_tests.dm | 2 +- code/world.dm | 23 +--- maps/~map_system/maps.dm | 2 +- 103 files changed, 274 insertions(+), 403 deletions(-) diff --git a/code/__defines/misc.dm b/code/__defines/misc.dm index 3a8ee870e5..a84d42dd29 100644 --- a/code/__defines/misc.dm +++ b/code/__defines/misc.dm @@ -236,4 +236,23 @@ #define USE_FAIL_DEAD 4 #define USE_FAIL_INCAPACITATED 5 #define USE_FAIL_NOT_IN_USER 6 -#define USE_FAIL_IS_SILICON 7 \ No newline at end of file +#define USE_FAIL_IS_SILICON 7 + + +// This creates a consistant definition for creating global lists, automatically inserting objects into it when they are created, and removing them when deleted. +// It is very good for removing the 'in world' junk that exists in the codebase painlessly. +// First argument is the list name/path desired, e.g. 'all_candles' would be 'var/list/all_candles = list()'. +// Second argument is the path the list is expected to contain. Note that children will also get added to the global list. +// If the GLOB system is ever ported, you can change this macro in one place and have less work to do than you otherwise would. +#define GLOBAL_LIST_BOILERPLATE(LIST_NAME, PATH)\ +var/global/list/##LIST_NAME = list();\ +##PATH/initialize(mapload, ...)\ + {\ + ##LIST_NAME += src;\ + return ..();\ + }\ +##PATH/Destroy(force, ...)\ + {\ + ##LIST_NAME -= src;\ + return ..();\ + }\ diff --git a/code/_helpers/game.dm b/code/_helpers/game.dm index 78c6944075..03f334b252 100644 --- a/code/_helpers/game.dm +++ b/code/_helpers/game.dm @@ -33,7 +33,7 @@ .= res /proc/get_area_name(N) //get area by its name - for(var/area/A in world) + for(var/area/A in all_areas) if(A.name == N) return A return 0 diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index fa72634bb8..468d91445f 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -503,9 +503,9 @@ Turf and target are seperate in case you want to teleport some distance from a t moblist.Add(M) for(var/mob/living/simple_animal/M in sortmob) moblist.Add(M) -// for(var/mob/living/silicon/hivebot/M in world) +// for(var/mob/living/silicon/hivebot/M in sortmob) // mob_list.Add(M) -// for(var/mob/living/silicon/hive_mainframe/M in world) +// for(var/mob/living/silicon/hive_mainframe/M in sortmob) // mob_list.Add(M) return moblist @@ -672,7 +672,7 @@ proc/GaussRandRound(var/sigma,var/roundto) //Returns: all the areas in the world /proc/return_areas() var/list/area/areas = list() - for(var/area/A in world) + for(var/area/A in all_areas) areas += A return areas @@ -690,7 +690,7 @@ proc/GaussRandRound(var/sigma,var/roundto) areatype = areatemp.type var/list/areas = new/list() - for(var/area/N in world) + for(var/area/N in all_areas) if(istype(N, areatype)) areas += N return areas @@ -704,7 +704,7 @@ proc/GaussRandRound(var/sigma,var/roundto) areatype = areatemp.type var/list/turfs = new/list() - for(var/area/N in world) + for(var/area/N in all_areas) if(istype(N, areatype)) for(var/turf/T in N) turfs += T return turfs @@ -719,7 +719,7 @@ proc/GaussRandRound(var/sigma,var/roundto) areatype = areatemp.type var/list/atoms = new/list() - for(var/area/N in world) + for(var/area/N in all_areas) if(istype(N, areatype)) for(var/atom/A in N) atoms += A diff --git a/code/controllers/emergency_shuttle_controller.dm b/code/controllers/emergency_shuttle_controller.dm index d7a91c9b4f..3ef7c9486f 100644 --- a/code/controllers/emergency_shuttle_controller.dm +++ b/code/controllers/emergency_shuttle_controller.dm @@ -84,7 +84,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle evac = 1 emergency_shuttle_called.Announce(replacetext(using_map.emergency_shuttle_called_message, "%ETA%", "[estimated_time] minute\s")) - for(var/area/A in world) + for(var/area/A in all_areas) if(istype(A, /area/hallway)) A.readyalert() @@ -116,7 +116,7 @@ var/global/datum/emergency_shuttle_controller/emergency_shuttle if (evac) emergency_shuttle_recalled.Announce(using_map.emergency_shuttle_recall_message) - for(var/area/A in world) + for(var/area/A in all_areas) if(istype(A, /area/hallway)) A.readyreset() evac = 0 diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm index 98ca642c82..e203650066 100644 --- a/code/controllers/master_controller.dm +++ b/code/controllers/master_controller.dm @@ -49,67 +49,8 @@ datum/controller/game_controller/proc/setup() // #endif datum/controller/game_controller/proc/setup_objects() - // #if !UNIT_TEST - // var/initialized_objects = 0 - // #endif - // Set up antagonists. populate_antag_type_list() //Set up spawn points. populate_spawn_points() - -/* - admin_notice("Initializing Floor Decals", R_DEBUG) - var/list/turfs_with_decals = list() - for(var/obj/effect/floor_decal/D in world) - var/T = D.add_to_turf_decals() - if(T) turfs_with_decals |= T - CHECK_SLEEP_MASTER - for(var/item in turfs_with_decals) - var/turf/T = item - if(T.decals) T.apply_decals() - CHECK_SLEEP_MASTER - floor_decals_initialized = TRUE - sleep(1) - - admin_notice("Initializing objects", R_DEBUG) - for(var/atom/movable/object in world) - if(!QDELETED(object)) - object.initialize() - CHECK_SLEEP_MASTER - sleep(1) - - admin_notice("Initializing areas", R_DEBUG) - for(var/area/area in all_areas) - area.initialize() - CHECK_SLEEP_MASTER - sleep(1) - - admin_notice("Initializing atmos machinery connections.", R_DEBUG) - for(var/obj/machinery/atmospherics/machine in machines) - machine.atmos_init() - CHECK_SLEEP_MASTER - - admin_notice("Initializing pipe networks", R_DEBUG) - for(var/obj/machinery/atmospherics/machine in machines) - machine.build_network() - CHECK_SLEEP_MASTER - - admin_notice("Initializing atmos machinery.", R_DEBUG) - for(var/obj/machinery/atmospherics/unary/U in machines) - if(istype(U, /obj/machinery/atmospherics/unary/vent_pump)) - var/obj/machinery/atmospherics/unary/vent_pump/T = U - T.broadcast_status() - else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber)) - var/obj/machinery/atmospherics/unary/vent_scrubber/T = U - T.broadcast_status() - CHECK_SLEEP_MASTER - - admin_notice("Initializing turbolifts", R_DEBUG) - for(var/thing in turbolifts) - var/obj/turbolift_map_holder/lift = thing - if(!QDELETED(lift)) - lift.initialize() - CHECK_SLEEP_MASTER - */ \ No newline at end of file diff --git a/code/controllers/subsystems/air.dm b/code/controllers/subsystems/air.dm index 13ed11a976..b7ab713d66 100644 --- a/code/controllers/subsystems/air.dm +++ b/code/controllers/subsystems/air.dm @@ -35,7 +35,7 @@ SUBSYSTEM_DEF(air) current_cycle = 0 var/simulated_turf_count = 0 - for(var/turf/simulated/S in world) + for(var/turf/simulated/S in turfs) simulated_turf_count++ S.update_air_properties() CHECK_TICK diff --git a/code/controllers/subsystems/atoms.dm b/code/controllers/subsystems/atoms.dm index 5b09b186bb..7dae153d66 100644 --- a/code/controllers/subsystems/atoms.dm +++ b/code/controllers/subsystems/atoms.dm @@ -46,7 +46,7 @@ SUBSYSTEM_DEF(atoms) CHECK_TICK else count = 0 - for(var/atom/A in world) + for(var/atom/A in world) // This must be world, since this operation adds all the atoms to their specific lists. if(!A.initialized) InitAtom(A, mapload_arg) ++count diff --git a/code/controllers/subsystems/xenoarch.dm b/code/controllers/subsystems/xenoarch.dm index eb6c97ea75..7f3e292c1a 100644 --- a/code/controllers/subsystems/xenoarch.dm +++ b/code/controllers/subsystems/xenoarch.dm @@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch) . = ..() /datum/controller/subsystem/xenoarch/proc/SetupXenoarch() - for(var/turf/simulated/mineral/M in world) + for(var/turf/simulated/mineral/M in turfs) if(!M.density) continue diff --git a/code/game/antagonist/antagonist_panel.dm b/code/game/antagonist/antagonist_panel.dm index fbe092a427..c8c754113f 100644 --- a/code/game/antagonist/antagonist_panel.dm +++ b/code/game/antagonist/antagonist_panel.dm @@ -39,7 +39,7 @@ if(flags & ANTAG_HAS_NUKE) dat += "
" - for(var/obj/item/weapon/disk/nuclear/N in world) + for(var/obj/item/weapon/disk/nuclear/N in nuke_disks) dat += "
Nuclear disk(s)
[N.name], " var/atom/disk_loc = N.loc while(!istype(disk_loc, /turf)) diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c7a653a4c3..98331ecfa8 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -373,7 +373,7 @@ var/list/mob/living/forced_ambiance_list = new var/list/teleportlocs = list() /hook/startup/proc/setupTeleportLocs() - for(var/area/AR in world) + for(var/area/AR in all_areas) if(istype(AR, /area/shuttle) || istype(AR, /area/syndicate_station) || istype(AR, /area/wizard_station)) continue if(teleportlocs.Find(AR.name)) continue var/turf/picked = pick(get_area_turfs(AR.type)) @@ -388,7 +388,7 @@ var/list/teleportlocs = list() var/list/ghostteleportlocs = list() /hook/startup/proc/setupGhostTeleportLocs() - for(var/area/AR in world) + for(var/area/AR in all_areas) if(ghostteleportlocs.Find(AR.name)) continue if(istype(AR, /area/aisat) || istype(AR, /area/derelict) || istype(AR, /area/tdome) || istype(AR, /area/shuttle/specops/centcom)) ghostteleportlocs += AR.name diff --git a/code/game/atoms.dm b/code/game/atoms.dm index dda3e0a6b5..d75a75fe31 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_atoms, /atom) // Use with care, its likely barely better than using world. + /atom layer = TURF_LAYER //This was here when I got here. Why though? var/level = 2 diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm index d91e2e1f47..0bc165adff 100644 --- a/code/game/gamemodes/cult/ritual.dm +++ b/code/game/gamemodes/cult/ritual.dm @@ -319,7 +319,7 @@ var/global/list/rnwords = list("ire","ego","nahlizet","certum","veri","jatkaa"," runerandom() if(iscultist(user)) var/C = 0 - for(var/obj/effect/rune/N in world) + for(var/obj/effect/rune/N in rune_list) C++ if (!istype(user.loc,/turf)) user << "You do not have enough space to write a proper rune." diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index d7579698d1..40008c5ecc 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -21,7 +21,7 @@ var/list/sacrificed = list() allrunesloc = new/list() var/index = 0 // var/tempnum = 0 - for(var/obj/effect/rune/R in world) + for(var/obj/effect/rune/R in rune_list) if(R == src) continue if(R.word1 == cultwords["travel"] && R.word2 == cultwords["self"] && R.word3 == key && isPlayerLevel(R.z)) @@ -59,7 +59,7 @@ var/list/sacrificed = list() var/runecount = 0 var/obj/effect/rune/IP = null var/mob/living/user = usr - for(var/obj/effect/rune/R in world) + for(var/obj/effect/rune/R in rune_list) if(R == src) continue if(R.word1 == cultwords["travel"] && R.word2 == cultwords["other"] && R.word3 == key) @@ -243,7 +243,7 @@ var/list/sacrificed = list() drain() var/drain = 0 - for(var/obj/effect/rune/R in world) + for(var/obj/effect/rune/R in rune_list) if(R.word1==cultwords["travel"] && R.word2==cultwords["blood"] && R.word3==cultwords["self"]) for(var/mob/living/carbon/D in R.loc) if(D.stat!=2) @@ -343,7 +343,7 @@ var/list/sacrificed = list() is_sacrifice_target = 0 find_sacrifice: - for(var/obj/effect/rune/R in world) + for(var/obj/effect/rune/R in rune_list) if(R.word1==cultwords["blood"] && R.word2==cultwords["join"] && R.word3==cultwords["hell"]) for(var/mob/living/carbon/human/N in R.loc) if(cult && N.mind && N.mind == cult.sacrifice_target) @@ -374,7 +374,7 @@ var/list/sacrificed = list() sleep(10 SECONDS) if(corpse_to_raise.client) - + var/datum/gender/TU = gender_datums[corpse_to_raise.get_visible_gender()] var/datum/gender/TT = gender_datums[body_to_sacrifice.get_visible_gender()] @@ -1049,7 +1049,7 @@ var/list/sacrificed = list() if(iscultist(C) && !C.stat) culcount++ if(culcount >= 5) - for(var/obj/effect/rune/R in world) + for(var/obj/effect/rune/R in rune_list) if(R.blood_DNA == src.blood_DNA) for(var/mob/living/M in orange(2,R)) M.take_overall_damage(0,15) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 0169cd3f00..d6e30e412c 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -54,11 +54,7 @@ if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") world << sound('sound/AI/spanomalies.ogg') - var/list/turfs = new var/turf/picked - for(var/turf/simulated/floor/T in world) - if(T.z in station_levels) - turfs += T for(var/turf/simulated/floor/T in turfs) if(prob(20)) spawn(50+rand(0,3000)) @@ -140,7 +136,7 @@ var/hadevent = 0 /proc/high_radiation_event() /* // Haha, this is way too laggy. I'll keep the prison break though. - for(var/obj/machinery/light/L in world) + for(var/obj/machinery/light/L in machines) if(isNotStationLevel(L.z)) continue L.flicker(50) @@ -173,7 +169,7 @@ var/hadevent = 0 var/list/area/areas = list() - for(var/area/A in world) + for(var/area/A in all_areas) if(istype(A, /area/security/prison) || istype(A, /area/security/brig)) areas += A @@ -366,21 +362,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing APCs" - for (var/obj/machinery/power/apc/APC in world) + for (var/obj/machinery/power/apc/APC in machines) if(APC.z in station_levels) APC.ion_act() apcnum++ world << "Finished processing APCs. Processed: [apcnum]" spawn(0) world << "Started processing SMES" - for (var/obj/machinery/power/smes/SMES in world) + for (var/obj/machinery/power/smes/SMES in machines) if(SMES.z in station_levels) SMES.ion_act() smesnum++ world << "Finished processing SMES. Processed: [smesnum]" spawn(0) world << "Started processing AIRLOCKS" - for (var/obj/machinery/door/airlock/D in world) + for (var/obj/machinery/door/airlock/D in machines) if(D.z in station_levels) //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks airlocknum++ @@ -389,7 +385,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is world << "Finished processing AIRLOCKS. Processed: [airlocknum]" spawn(0) world << "Started processing FIREDOORS" - for (var/obj/machinery/door/firedoor/D in world) + for (var/obj/machinery/door/firedoor/D in machines) if(D.z in station_levels) firedoornum++; spawn(0) diff --git a/code/game/gamemodes/events/power_failure.dm b/code/game/gamemodes/events/power_failure.dm index baba0ea4bb..2cd257e0bb 100644 --- a/code/game/gamemodes/events/power_failure.dm +++ b/code/game/gamemodes/events/power_failure.dm @@ -5,7 +5,7 @@ var/list/skipped_areas = list(/area/ai) - for(var/obj/machinery/power/smes/S in world) + for(var/obj/machinery/power/smes/S in machines) var/area/current_area = get_area(S) if(current_area.type in skipped_areas || !(S.z in using_map.station_levels)) continue @@ -19,7 +19,7 @@ S.power_change() - for(var/obj/machinery/power/apc/C in world) + for(var/obj/machinery/power/apc/C in machines) if(!C.is_critical && C.cell && (C.z in using_map.station_levels)) C.cell.charge = 0 @@ -28,10 +28,10 @@ if(announce) command_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') - for(var/obj/machinery/power/apc/C in world) + for(var/obj/machinery/power/apc/C in machines) if(C.cell && (C.z in using_map.station_levels)) C.cell.charge = C.cell.maxcharge - for(var/obj/machinery/power/smes/S in world) + for(var/obj/machinery/power/smes/S in machines) var/area/current_area = get_area(S) if(current_area.type in skipped_areas || isNotStationLevel(S.z)) continue @@ -45,7 +45,7 @@ if(announce) command_announcement.Announce("All SMESs on [station_name()] have been recharged. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg') - for(var/obj/machinery/power/smes/S in world) + for(var/obj/machinery/power/smes/S in machines) if(isNotStationLevel(S.z)) continue S.charge = S.capacity diff --git a/code/game/gamemodes/events/wormholes.dm b/code/game/gamemodes/events/wormholes.dm index dd9e72ce08..cece3f67f9 100644 --- a/code/game/gamemodes/events/wormholes.dm +++ b/code/game/gamemodes/events/wormholes.dm @@ -1,7 +1,7 @@ /proc/wormhole_event() spawn() var/list/pick_turfs = list() - for(var/turf/simulated/floor/T in world) + for(var/turf/simulated/floor/T in turfs) if(T.z in using_map.station_levels) pick_turfs += T diff --git a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm index dd809002e8..b8b15974db 100644 --- a/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm +++ b/code/game/gamemodes/malfunction/newmalf_ability_trees/tree_interdiction.dm @@ -82,7 +82,7 @@ if(!target) var/list/robots = list() var/list/robot_names = list() - for(var/mob/living/silicon/robot/R in world) + for(var/mob/living/silicon/robot/R in silicon_mob_list) if(istype(R, /mob/living/silicon/robot/drone)) // No drones. continue if(R.connected_ai != user) // No robots linked to other AIs diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index f7233c1266..fd9653a323 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -37,7 +37,7 @@ var/list/nuke_disks = list() ..() return var/disk_rescued = 1 - for(var/obj/item/weapon/disk/nuclear/D in world) + for(var/obj/item/weapon/disk/nuclear/D in nuke_disks) var/disk_area = get_area(D) if(!is_type_in_list(disk_area, centcom_areas)) disk_rescued = 0 diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm index bd140c3061..f6e113c5b2 100644 --- a/code/game/gamemodes/nuclear/pinpointer.dm +++ b/code/game/gamemodes/nuclear/pinpointer.dm @@ -45,7 +45,7 @@ examine(mob/user) ..(user) - for(var/obj/machinery/nuclearbomb/bomb in world) + for(var/obj/machinery/nuclearbomb/bomb in machines) if(bomb.timing) user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]" diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 5d5e3f1379..c458b9c00a 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -524,7 +524,7 @@ datum/objective/steal if(istype(M, /mob/living/silicon/ai) && M.stat != 2) //See if any AI's are alive inside that card. return 1 - for(var/mob/living/silicon/ai/ai in world) + for(var/mob/living/silicon/ai/ai in mob_list) var/turf/T = get_turf(ai) if(istype(T)) var/area/check_area = get_area(ai) diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index e210119445..d4b29b217e 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -162,7 +162,7 @@ var/global/list/engineering_networks = list( number = 1 var/area/A = get_area(src) if(A) - for(var/obj/machinery/camera/autoname/C in world) + for(var/obj/machinery/camera/autoname/C in machines) if(C == src) continue var/area/CA = get_area(C) if(CA.type == A.type) diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index 5c7ece8d05..fa491c20e7 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -181,6 +181,8 @@ feedback_inc("cyborg_ais_created",1) qdel(src) +GLOBAL_LIST_BOILERPLATE(all_deactivated_AI_cores, /obj/structure/AIcore/deactivated) + /obj/structure/AIcore/deactivated name = "inactive AI" icon = 'icons/mob/AI.dmi' @@ -255,7 +257,7 @@ set category = "Admin" var/list/cores = list() - for(var/obj/structure/AIcore/deactivated/D in world) + for(var/obj/structure/AIcore/deactivated/D in all_deactivated_AI_cores) cores["[D] ([D.loc.loc])"] = D var/id = input("Which core?", "Toggle AI Core Latejoin", null) as null|anything in cores diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index c95bd9879c..1f3b615cce 100644 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -420,7 +420,7 @@ return dat /proc/enable_prison_shuttle(var/mob/user) - for(var/obj/machinery/computer/prison_shuttle/PS in world) + for(var/obj/machinery/computer/prison_shuttle/PS in machines) PS.allowedtocall = !(PS.allowedtocall) /proc/call_shuttle_proc(var/mob/user) diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index b51fa788ab..30182937d4 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -122,7 +122,7 @@ dat += "Back" dat += "
Medical Robots:" var/bdat = null - for(var/mob/living/bot/medbot/M in world) + for(var/mob/living/bot/medbot/M in mob_list) if(M.z != src.z) continue //only find medibots on the same z-level as the computer var/turf/bl = get_turf(M) diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm index 7b34c026d4..ee42ed18bd 100644 --- a/code/game/machinery/computer/pod.dm +++ b/code/game/machinery/computer/pod.dm @@ -16,7 +16,7 @@ /obj/machinery/computer/pod/New() ..() spawn( 5 ) - for(var/obj/machinery/mass_driver/M in world) + for(var/obj/machinery/mass_driver/M in machines) if(M.id == id) connected = M else @@ -32,19 +32,19 @@ viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!" return - for(var/obj/machinery/door/blast/M in world) + for(var/obj/machinery/door/blast/M in machines) if(M.id == id) M.open() sleep(20) - for(var/obj/machinery/mass_driver/M in world) + for(var/obj/machinery/mass_driver/M in machines) if(M.id == id) M.power = connected.power M.drive() sleep(50) - for(var/obj/machinery/door/blast/M in world) + for(var/obj/machinery/door/blast/M in machines) if(M.id == id) M.close() return @@ -182,7 +182,7 @@ time += tp time = min(max(round(time), 0), 120) if(href_list["door"]) - for(var/obj/machinery/door/blast/M in world) + for(var/obj/machinery/door/blast/M in machines) if(M.id == id) if(M.density) M.open() diff --git a/code/game/machinery/computer/prisoner.dm b/code/game/machinery/computer/prisoner.dm index 1b34283d14..cc1d5d0482 100644 --- a/code/game/machinery/computer/prisoner.dm +++ b/code/game/machinery/computer/prisoner.dm @@ -29,7 +29,7 @@ else if(screen == 1) dat += "
Chemical Implants
" var/turf/Tr = null - for(var/obj/item/weapon/implant/chem/C in world) + for(var/obj/item/weapon/implant/chem/C in all_chem_implants) Tr = get_turf(C) if(!Tr) continue//Out of range if(!C.implanted) continue @@ -39,7 +39,7 @@ dat += "((10))
" dat += "********************************
" dat += "
Tracking Implants
" - for(var/obj/item/weapon/implant/tracking/T in world) + for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants) Tr = get_turf(T) if(!Tr) continue//Out of range if(!T.implanted) continue diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index 0a337f4df8..1f7c959db5 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -92,7 +92,7 @@ var/specops_shuttle_timeleft = 0 specops_shuttle_at_station = 0 - for(var/obj/machinery/computer/specops_shuttle/S in world) + for(var/obj/machinery/computer/specops_shuttle/S in machines) S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY qdel(announcer) @@ -159,10 +159,10 @@ var/specops_shuttle_timeleft = 0 sleep(10) var/spawn_marauder[] = new() - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name == "Marauder Entry") spawn_marauder.Add(L) - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name == "Marauder Exit") var/obj/effect/portal/P = new(L.loc) P.invisibility = 101//So it is not seen by anyone. @@ -233,7 +233,7 @@ var/specops_shuttle_timeleft = 0 var/mob/M = locate(/mob) in T M << "You have arrived to [station_name()]. Commence operation!" - for(var/obj/machinery/computer/specops_shuttle/S in world) + for(var/obj/machinery/computer/specops_shuttle/S in machines) S.specops_shuttle_timereset = world.time + SPECOPS_RETURN_DELAY qdel(announcer) @@ -241,7 +241,7 @@ var/specops_shuttle_timeleft = 0 /proc/specops_can_move() if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return 0 - for(var/obj/machinery/computer/specops_shuttle/S in world) + for(var/obj/machinery/computer/specops_shuttle/S in machines) if(world.timeofday <= S.specops_shuttle_timereset) return 0 return 1 diff --git a/code/game/machinery/computer3/computers/crew.dm b/code/game/machinery/computer3/computers/crew.dm index 2098d79f02..2f08a6cd88 100644 --- a/code/game/machinery/computer3/computers/crew.dm +++ b/code/game/machinery/computer3/computers/crew.dm @@ -57,7 +57,7 @@ proc/scan() - for(var/obj/item/clothing/under/C in world) + for(var/obj/item/clothing/under/C in all_clothing) if((C.has_sensor) && (istype(C.loc, /mob/living/carbon/human))) tracked |= C return 1 diff --git a/code/game/machinery/computer3/computers/medical.dm b/code/game/machinery/computer3/computers/medical.dm index bb4228397d..deeccc81b1 100644 --- a/code/game/machinery/computer3/computers/medical.dm +++ b/code/game/machinery/computer3/computers/medical.dm @@ -128,7 +128,7 @@ dat += "Back" dat += "
Medical Robots:" var/bdat = null - for(var/mob/living/bot/medbot/M in world) + for(var/mob/living/bot/medbot/M in mob_list) if(M.z != computer.z) continue //only find medibots on the same z-level as the computer var/turf/bl = get_turf(M) diff --git a/code/game/machinery/computer3/computers/prisoner.dm b/code/game/machinery/computer3/computers/prisoner.dm index 27943bb353..9bb7c1c2e0 100644 --- a/code/game/machinery/computer3/computers/prisoner.dm +++ b/code/game/machinery/computer3/computers/prisoner.dm @@ -27,7 +27,7 @@ else if(screen == 1) dat += "
Chemical Implants
" var/turf/Tr = null - for(var/obj/item/weapon/implant/chem/C in world) + for(var/obj/item/weapon/implant/chem/C in all_chem_implants) Tr = get_turf(C) if((Tr) && (Tr.z != computer.z)) continue//Out of range if(!C.implanted) continue @@ -37,7 +37,7 @@ dat += "((10))
" dat += "********************************
" dat += "
Tracking Implants
" - for(var/obj/item/weapon/implant/tracking/T in world) + for(var/obj/item/weapon/implant/tracking/T in all_tracking_implants) Tr = get_turf(T) if((Tr) && (Tr.z != computer.z)) continue//Out of range if(!T.implanted) continue diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index 5d6d7abdcc..57fbab5439 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -401,7 +401,7 @@ preserve = 1 if(istype(W,/obj/item/weapon/implant/health)) - for(var/obj/machinery/computer/cloning/com in world) + for(var/obj/machinery/computer/cloning/com in machines) for(var/datum/dna2/record/R in com.records) if(locate(R.implant) == W) qdel(R) diff --git a/code/game/machinery/door_control.dm b/code/game/machinery/door_control.dm index 7f7ce32e03..127eda6135 100644 --- a/code/game/machinery/door_control.dm +++ b/code/game/machinery/door_control.dm @@ -91,7 +91,7 @@ */ /obj/machinery/button/remote/airlock/trigger() - for(var/obj/machinery/door/airlock/D in world) + for(var/obj/machinery/door/airlock/D in machines) if(D.id_tag == id) if(specialfunctions & OPEN) if(D.density) @@ -135,7 +135,7 @@ desc = "It controls blast doors, remotely." /obj/machinery/button/remote/blast_door/trigger() - for(var/obj/machinery/door/blast/M in world) + for(var/obj/machinery/door/blast/M in machines) if(M.id == id) if(M.density) spawn(0) @@ -154,7 +154,7 @@ desc = "It controls emitters, remotely." /obj/machinery/button/remote/emitter/trigger(mob/user as mob) - for(var/obj/machinery/power/emitter/E in world) + for(var/obj/machinery/power/emitter/E in machines) if(E.id == id) spawn(0) E.activate(user) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 2d40396d91..23c5c9dcd8 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1175,7 +1175,7 @@ About the new airlock wires panel: /obj/machinery/door/airlock/initialize() if(src.closeOtherId != null) - for (var/obj/machinery/door/airlock/A in world) + for (var/obj/machinery/door/airlock/A in machines) if(A.closeOtherId == src.closeOtherId && A != src) src.closeOther = A break diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index e639571cb4..fe1d726d50 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -47,7 +47,7 @@ if(F.id == src.id) LAZYADD(targets,F) - for(var/obj/structure/closet/secure_closet/brig/C in world) + for(var/obj/structure/closet/secure_closet/brig/C in all_brig_closets) if(C.id == src.id) LAZYADD(targets,C) diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 8022235736..d21d751e7e 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -213,7 +213,7 @@ ..() if(autolink) - for(var/obj/machinery/magnetic_module/M in world) + for(var/obj/machinery/magnetic_module/M in machines) if(M.freq == frequency && M.code == code) magnets.Add(M) @@ -229,7 +229,7 @@ /obj/machinery/magnetic_controller/process() if(magnets.len == 0 && autolink) - for(var/obj/machinery/magnetic_module/M in world) + for(var/obj/machinery/magnetic_module/M in machines) if(M.freq == frequency && M.code == code) magnets.Add(M) diff --git a/code/game/machinery/requests_console.dm b/code/game/machinery/requests_console.dm index 6bf06e5e2f..ed731ad656 100644 --- a/code/game/machinery/requests_console.dm +++ b/code/game/machinery/requests_console.dm @@ -166,7 +166,7 @@ var/list/obj/machinery/requests_console/allConsoles = list() var/log_msg = message var/pass = 0 screen = RCS_SENTFAIL - for (var/obj/machinery/message_server/MS in world) + for (var/obj/machinery/message_server/MS in machines) if(!MS.active) continue MS.send_rc_message(ckey(href_list["department"]),department,log_msg,msgStamped,msgVerified,priority) pass = 1 diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm index cf2449f1d3..5befc59495 100644 --- a/code/game/machinery/syndicatebeacon.dm +++ b/code/game/machinery/syndicatebeacon.dm @@ -89,7 +89,7 @@ if(surplus() < 1500) if(user) user << "The connected wire doesn't have enough current." return - for(var/obj/singularity/singulo in world) + for(var/obj/singularity/singulo in all_singularities) if(singulo.z == z) singulo.target = src icon_state = "[icontype]1" @@ -99,7 +99,7 @@ user << "You activate the beacon." /obj/machinery/power/singularity_beacon/proc/Deactivate(mob/user = null) - for(var/obj/singularity/singulo in world) + for(var/obj/singularity/singulo in all_singularities) if(singulo.target == src) singulo.target = null icon_state = "[icontype]0" diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 7544c91bfe..be31a5aa56 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -95,7 +95,7 @@ var/list/L = list() var/list/areaindex = list() - for(var/obj/item/device/radio/beacon/R in world) + for(var/obj/item/device/radio/beacon/R in all_beacons) var/turf/T = get_turf(R) if(!T) continue @@ -108,7 +108,7 @@ areaindex[tmpname] = 1 L[tmpname] = R - for (var/obj/item/weapon/implant/tracking/I in world) + for (var/obj/item/weapon/implant/tracking/I in all_tracking_implants) if(!I.implanted || !ismob(I.loc)) continue else diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm index 8f90343284..fa75864b01 100644 --- a/code/game/machinery/turret_control.dm +++ b/code/game/machinery/turret_control.dm @@ -51,7 +51,7 @@ else if(ispath(control_area)) control_area = locate(control_area) else if(istext(control_area)) - for(var/area/A in world) + for(var/area/A in all_areas) if(A.name && A.name==control_area) control_area = A break diff --git a/code/game/objects/effects/portals.dm b/code/game/objects/effects/portals.dm index 702926d6ff..08f369d735 100644 --- a/code/game/objects/effects/portals.dm +++ b/code/game/objects/effects/portals.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_portals, /obj/effect/portal) + /obj/effect/portal name = "portal" desc = "Looks unstable. Best to test it with the clown." diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index f6eec0de71..9132cf4b12 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -46,7 +46,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa var/close = range(world.view+round(devastation_range,1), epicenter) // to all distanced mobs play a different sound - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.z == epicenter.z) if(!(M in close)) // check if the mob can hear diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 748a203cc4..d0bf0f2ee6 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_items, /obj/item) + /obj/item name = "item" icon = 'icons/obj/items.dmi' @@ -580,7 +582,7 @@ var/list/global/slot_flags_enumeration = list( I.Blend(new /icon('icons/effects/blood.dmi', "itemblood"),ICON_MULTIPLY) //adds blood and the remaining white areas become transparant //not sure if this is worth it. It attaches the blood_overlay to every item of the same type if they don't have one already made. - for(var/obj/item/A in world) + for(var/obj/item/A in all_items) if(A.type == type && !A.blood_overlay) A.blood_overlay = image(I) diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm index 78ee749ceb..a65d4dffdf 100644 --- a/code/game/objects/items/devices/PDA/PDA.dm +++ b/code/game/objects/items/devices/PDA/PDA.dm @@ -893,7 +893,7 @@ var/global/list/obj/item/device/pda/PDAs = list() if("Toggle Door") if(cartridge && cartridge.access_remote_door) - for(var/obj/machinery/door/blast/M in world) + for(var/obj/machinery/door/blast/M in machines) if(M.id == cartridge.remote_door_id) if(M.density) M.open() diff --git a/code/game/objects/items/devices/PDA/cart.dm b/code/game/objects/items/devices/PDA/cart.dm index 4b088f51b8..e13324a5f0 100644 --- a/code/game/objects/items/devices/PDA/cart.dm +++ b/code/game/objects/items/devices/PDA/cart.dm @@ -468,7 +468,7 @@ var/list/civilian_cartridges = list( else JaniData["user_loc"] = list("x" = 0, "y" = 0) var/MopData[0] - for(var/obj/item/weapon/mop/M in world) + for(var/obj/item/weapon/mop/M in all_mops) var/turf/ml = get_turf(M) if(ml) if(ml.z != cl.z) @@ -481,7 +481,7 @@ var/list/civilian_cartridges = list( var/BucketData[0] - for(var/obj/structure/mopbucket/B in world) + for(var/obj/structure/mopbucket/B in all_mopbuckets) var/turf/bl = get_turf(B) if(bl) if(bl.z != cl.z) @@ -493,7 +493,7 @@ var/list/civilian_cartridges = list( BucketData[++BucketData.len] = list("x" = 0, "y" = 0, dir=null, status = null) var/CbotData[0] - for(var/mob/living/bot/cleanbot/B in world) + for(var/mob/living/bot/cleanbot/B in mob_list) var/turf/bl = get_turf(B) if(bl) if(bl.z != cl.z) @@ -505,7 +505,7 @@ var/list/civilian_cartridges = list( if(!CbotData.len) CbotData[++CbotData.len] = list("x" = 0, "y" = 0, dir=null, status = null) var/CartData[0] - for(var/obj/structure/janitorialcart/B in world) + for(var/obj/structure/janitorialcart/B in all_janitorial_carts) var/turf/bl = get_turf(B) if(bl) if(bl.z != cl.z) diff --git a/code/game/objects/items/devices/paicard.dm b/code/game/objects/items/devices/paicard.dm index 2cf67da30c..8f2827c7ab 100644 --- a/code/game/objects/items/devices/paicard.dm +++ b/code/game/objects/items/devices/paicard.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_pai_cards, /obj/item/device/paicard) + /obj/item/device/paicard name = "personal AI device" icon = 'icons/obj/pda.dmi' diff --git a/code/game/objects/items/devices/radio/beacon.dm b/code/game/objects/items/devices/radio/beacon.dm index 7d41e25bc4..5bd91e81b6 100644 --- a/code/game/objects/items/devices/radio/beacon.dm +++ b/code/game/objects/items/devices/radio/beacon.dm @@ -6,6 +6,8 @@ var/code = "electronic" origin_tech = list(TECH_BLUESPACE = 1) +GLOBAL_LIST_BOILERPLATE(all_beacons, /obj/item/device/radio/beacon) + /obj/item/device/radio/beacon/hear_talk() return diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 3e656b844b..02e4cd48c4 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -69,6 +69,8 @@ else ..() +GLOBAL_LIST_BOILERPLATE(all_tracking_implants, /obj/item/weapon/implant/tracking) + /obj/item/weapon/implant/tracking name = "tracking implant" desc = "An implant normally given to dangerous criminals. Allows security to track your location." @@ -309,6 +311,8 @@ Implant Specifics:
"} explosion(get_turf(imp_in), -1, -1, 1, 3) qdel(src) +GLOBAL_LIST_BOILERPLATE(all_chem_implants, /obj/item/weapon/implant/chem) + /obj/item/weapon/implant/chem name = "chemical implant" desc = "Injects things." diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm index 3e46128d71..54f344eae1 100644 --- a/code/game/objects/items/weapons/mop.dm +++ b/code/game/objects/items/weapons/mop.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_mops, /obj/item/weapon/mop) + /obj/item/weapon/mop desc = "The world of janitalia wouldn't be complete without a mop." name = "mop" @@ -12,7 +14,6 @@ var/mopping = 0 var/mopcount = 0 - /obj/item/weapon/mop/New() create_reagents(30) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index c8af607576..3818ddac81 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -60,7 +60,7 @@ Frequency: if (sr) src.temp += "Located Beacons:
" - for(var/obj/item/device/radio/beacon/W in world) + for(var/obj/item/device/radio/beacon/W in all_beacons) if (W.frequency == src.frequency) var/turf/tr = get_turf(W) if (tr.z == sr.z && tr) @@ -78,7 +78,7 @@ Frequency: src.temp += "[W.code]-[dir2text(get_dir(sr, tr))]-[direct]
" src.temp += "Extranneous Signals:
" - for (var/obj/item/weapon/implant/tracking/W in world) + for (var/obj/item/weapon/implant/tracking/W in all_tracking_implants) if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc) || W.malfunction)) continue @@ -137,7 +137,7 @@ Frequency: user << "\The [src] is malfunctioning." return var/list/L = list( ) - for(var/obj/machinery/teleport/hub/R in world) + for(var/obj/machinery/teleport/hub/R in machines) var/obj/machinery/computer/teleporter/com = locate(/obj/machinery/computer/teleporter, locate(R.x - 2, R.y, R.z)) if (istype(com, /obj/machinery/computer/teleporter) && com.locked && !com.one_time_use) if(R.icon_state == "tele1") @@ -156,7 +156,7 @@ Frequency: if ((user.get_active_hand() != src || user.stat || user.restrained())) return var/count = 0 //num of portals from this teleport in world - for(var/obj/effect/portal/PO in world) + for(var/obj/effect/portal/PO in all_portals) if(PO.creator == src) count++ if(count >= 3) user.show_message("\The [src] is recharging!") diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 3835b2a24b..be067b620e 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_objs, /obj) + /obj layer = OBJ_LAYER plane = OBJ_PLANE diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm index cf70a40920..d55a521119 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm @@ -319,7 +319,7 @@ new /obj/item/weapon/reagent_containers/syringe/ld50_syringe/choral(src) return - +GLOBAL_LIST_BOILERPLATE(all_brig_closets, /obj/structure/closet/secure_closet/brig) /obj/structure/closet/secure_closet/brig name = "brig locker" diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm index b037ecf4e7..6923728564 100644 --- a/code/game/objects/structures/janicart.dm +++ b/code/game/objects/structures/janicart.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_janitorial_carts, /obj/structure/janitorialcart) + /obj/structure/janitorialcart name = "janitorial cart" desc = "The ultimate in janitorial carts! Has space for water, mops, signs, trash bags, and more!" diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm index e7b90cd657..714f2cbfc9 100644 --- a/code/game/objects/structures/mop_bucket.dm +++ b/code/game/objects/structures/mop_bucket.dm @@ -10,6 +10,7 @@ flags = OPENCONTAINER var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite +GLOBAL_LIST_BOILERPLATE(all_mopbuckets, /obj/structure/mopbucket) /obj/structure/mopbucket/New() create_reagents(300) diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index d0324c98bf..9322c8656e 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -196,6 +196,8 @@ * Crematorium */ +GLOBAL_LIST_BOILERPLATE(all_crematoriums, /obj/structure/morgue/crematorium) + /obj/structure/morgue/crematorium name = "crematorium" desc = "A human incinerator. Works well on barbeque nights." @@ -342,7 +344,7 @@ if(..()) return if(src.allowed(user)) - for (var/obj/structure/morgue/crematorium/C in world) + for (var/obj/structure/morgue/crematorium/C in all_crematoriums) if (C.id == id) if (!C.cremating) C.cremate(user) diff --git a/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm b/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm index 387f6d3ce7..622c68d2ea 100644 --- a/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm +++ b/code/modules/admin/secrets/fun_secrets/fix_all_lights.dm @@ -6,5 +6,5 @@ if(!.) return - for(var/obj/machinery/light/L in world) + for(var/obj/machinery/light/L in machines) L.fix() diff --git a/code/modules/admin/secrets/fun_secrets/remove_all_clothing.dm b/code/modules/admin/secrets/fun_secrets/remove_all_clothing.dm index 28e9497f53..45d6e646c4 100644 --- a/code/modules/admin/secrets/fun_secrets/remove_all_clothing.dm +++ b/code/modules/admin/secrets/fun_secrets/remove_all_clothing.dm @@ -6,5 +6,5 @@ if(!.) return - for(var/obj/item/clothing/O in world) + for(var/obj/item/clothing/O in all_clothing) qdel(O) diff --git a/code/modules/admin/secrets/fun_secrets/remove_internal_clothing.dm b/code/modules/admin/secrets/fun_secrets/remove_internal_clothing.dm index 73dba4ce4f..9509588c13 100644 --- a/code/modules/admin/secrets/fun_secrets/remove_internal_clothing.dm +++ b/code/modules/admin/secrets/fun_secrets/remove_internal_clothing.dm @@ -6,5 +6,5 @@ if(!.) return - for(var/obj/item/clothing/under/O in world) + for(var/obj/item/clothing/under/O in all_clothing) qdel(O) diff --git a/code/modules/admin/secrets/random_events/gravity.dm b/code/modules/admin/secrets/random_events/gravity.dm index 8d4cad4960..929d34601e 100644 --- a/code/modules/admin/secrets/random_events/gravity.dm +++ b/code/modules/admin/secrets/random_events/gravity.dm @@ -16,7 +16,7 @@ return gravity_is_on = !gravity_is_on - for(var/area/A in world) + for(var/area/A in all_areas) A.gravitychange(gravity_is_on,A) feedback_inc("admin_secrets_fun_used",1) diff --git a/code/modules/admin/verbs/SDQL.dm b/code/modules/admin/verbs/SDQL.dm index 7c8ae52312..da3e9a6bd5 100644 --- a/code/modules/admin/verbs/SDQL.dm +++ b/code/modules/admin/verbs/SDQL.dm @@ -85,57 +85,57 @@ else var/f2 = text2path(f) if(text_starts_with(f, "/mob")) - for(var/mob/m in world) + for(var/mob/m in mob_list) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/turf/space")) - for(var/turf/space/m in world) + for(var/turf/space/m in turfs) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/turf/simulated")) - for(var/turf/simulated/m in world) + for(var/turf/simulated/m in turfs) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/turf/unsimulated")) - for(var/turf/unsimulated/m in world) + for(var/turf/unsimulated/m in turfs) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/turf")) - for(var/turf/m in world) + for(var/turf/m in turfs) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/area")) - for(var/area/m in world) + for(var/area/m in all_areas) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/obj/item")) - for(var/obj/item/m in world) + for(var/obj/item/m in all_items) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/obj/machinery")) - for(var/obj/machinery/m in world) + for(var/obj/machinery/m in machines) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/obj")) - for(var/obj/m in world) + for(var/obj/m in all_objs) if(istype(m, f2)) from_objs += m else if(text_starts_with(f, "/atom")) - for(var/atom/m in world) + for(var/atom/m in all_atoms) if(istype(m, f2)) from_objs += m /* else - for(var/datum/m in world) + for(var/datum/m in nope) if(istype(m, f2)) from_objs += m */ diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index e57720bb62..823a540d10 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -21,7 +21,7 @@ else alert("Admin jumping disabled") -/client/proc/jumptoturf(var/turf/T in world) +/client/proc/jumptoturf(var/turf/T in turfs) set name = "Jump to Turf" set category = "Admin" if(!check_rights(R_ADMIN|R_MOD|R_DEBUG)) diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm index 169d82dba3..083789e550 100644 --- a/code/modules/admin/verbs/atmosdebug.dm +++ b/code/modules/admin/verbs/atmosdebug.dm @@ -12,23 +12,23 @@ usr << "Checking for disconnected pipes..." //all plumbing - yes, some things might get stated twice, doesn't matter. - for (var/obj/machinery/atmospherics/plumbing in world) + for (var/obj/machinery/atmospherics/plumbing in machines) if (plumbing.nodealert) usr << "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])" //Manifolds - for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world) + for (var/obj/machinery/atmospherics/pipe/manifold/pipe in machines) if (!pipe.node1 || !pipe.node2 || !pipe.node3) usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])" //Pipes - for (var/obj/machinery/atmospherics/pipe/simple/pipe in world) + for (var/obj/machinery/atmospherics/pipe/simple/pipe in machines) if (!pipe.node1 || !pipe.node2) usr << "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])" usr << "Checking for overlapping pipes..." next_turf: - for(var/turf/T in world) + for(var/turf/T in turfs) for(var/dir in cardinal) var/list/connect_types = list(1 = 0, 2 = 0, 3 = 0) for(var/obj/machinery/atmospherics/pipe in T) diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 326a317bfd..3582aab0c7 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -173,96 +173,6 @@ else alert("Invalid mob") -/* -/client/proc/cmd_admin_monkeyize(var/mob/M in world) - set category = "Fun" - set name = "Make Monkey" - - if(!ticker) - alert("Wait until the game starts") - return - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/target = M - log_admin("[key_name(src)] is attempting to monkeyize [M.key].") - spawn(10) - target.monkeyize() - else - alert("Invalid mob") - -/client/proc/cmd_admin_changelinginize(var/mob/M in world) - set category = "Fun" - set name = "Make Changeling" - - if(!ticker) - alert("Wait until the game starts") - return - if(istype(M, /mob/living/carbon/human)) - log_admin("[key_name(src)] has made [M.key] a changeling.") - spawn(10) - M.absorbed_dna[M.real_name] = M.dna.Clone() - M.make_changeling() - if(M.mind) - M.mind.special_role = "Changeling" - else - alert("Invalid mob") -*/ -/* -/client/proc/cmd_admin_abominize(var/mob/M in world) - set category = null - set name = "Make Abomination" - - usr << "Ruby Mode disabled. Command aborted." - return - if(!ticker) - alert("Wait until the game starts.") - return - if(istype(M, /mob/living/carbon/human)) - log_admin("[key_name(src)] has made [M.key] an abomination.") - - // spawn(10) - // M.make_abomination() - -*/ -/* -/client/proc/make_cultist(var/mob/M in world) // -- TLE, modified by Urist - set category = "Fun" - set name = "Make Cultist" - set desc = "Makes target a cultist" - if(!cultwords["travel"]) - runerandom() - if(M) - if(M.mind in ticker.mode.cult) - return - else - if(alert("Spawn that person a tome?",,"Yes","No")=="Yes") - M << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie. A tome, a message from your new master, appears on the ground." - new /obj/item/weapon/book/tome(M.loc) - else - M << "You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie." - var/glimpse=pick("1","2","3","4","5","6","7","8") - switch(glimpse) - if("1") - M << "You remembered one thing from the glimpse... [cultwords["travel"]] is travel..." - if("2") - M << "You remembered one thing from the glimpse... [cultwords["blood"]] is blood..." - if("3") - M << "You remembered one thing from the glimpse... [cultwords["join"]] is join..." - if("4") - M << "You remembered one thing from the glimpse... [cultwords["hell"]] is Hell..." - if("5") - M << "You remembered one thing from the glimpse... [cultwords["destroy"]] is destroy..." - if("6") - M << "You remembered one thing from the glimpse... [cultwords["technology"]] is technology..." - if("7") - M << "You remembered one thing from the glimpse... [cultwords["self"]] is self..." - if("8") - M << "You remembered one thing from the glimpse... [cultwords["see"]] is see..." - - if(M.mind) - M.mind.special_role = "Cultist" - ticker.mode.cult += M.mind - src << "Made [M] a cultist." -*/ //TODO: merge the vievars version into this or something maybe mayhaps /client/proc/cmd_debug_del_all() @@ -273,7 +183,7 @@ var/blocked = list(/obj, /mob, /mob/living, /mob/living/carbon, /mob/living/carbon/human, /mob/observer/dead, /mob/living/silicon, /mob/living/silicon/robot, /mob/living/silicon/ai) var/hsbitem = input(usr, "Choose an object to delete.", "Delete:") as null|anything in typesof(/obj) + typesof(/mob) - blocked if(hsbitem) - for(var/atom/O in world) + for(var/atom/O in all_atoms) if(istype(O, hsbitem)) qdel(O) log_admin("[key_name(src)] has deleted all instances of [hsbitem].") @@ -431,41 +341,41 @@ var/list/areas_with_intercom = list() var/list/areas_with_camera = list() - for(var/area/A in world) + for(var/area/A in all_areas) if(!(A.type in areas_all)) areas_all.Add(A.type) - for(var/obj/machinery/power/apc/APC in world) + for(var/obj/machinery/power/apc/APC in machines) var/area/A = get_area(APC) if(!(A.type in areas_with_APC)) areas_with_APC.Add(A.type) - for(var/obj/machinery/alarm/alarm in world) + for(var/obj/machinery/alarm/alarm in machines) var/area/A = get_area(alarm) if(!(A.type in areas_with_air_alarm)) areas_with_air_alarm.Add(A.type) - for(var/obj/machinery/requests_console/RC in world) + for(var/obj/machinery/requests_console/RC in machines) var/area/A = get_area(RC) if(!(A.type in areas_with_RC)) areas_with_RC.Add(A.type) - for(var/obj/machinery/light/L in world) + for(var/obj/machinery/light/L in machines) var/area/A = get_area(L) if(!(A.type in areas_with_light)) areas_with_light.Add(A.type) - for(var/obj/machinery/light_switch/LS in world) + for(var/obj/machinery/light_switch/LS in machines) var/area/A = get_area(LS) if(!(A.type in areas_with_LS)) areas_with_LS.Add(A.type) - for(var/obj/item/device/radio/intercom/I in world) + for(var/obj/item/device/radio/intercom/I in machines) var/area/A = get_area(I) if(!(A.type in areas_with_intercom)) areas_with_intercom.Add(A.type) - for(var/obj/machinery/camera/C in world) + for(var/obj/machinery/camera/C in machines) var/area/A = get_area(C) if(!(A.type in areas_with_camera)) areas_with_camera.Add(A.type) @@ -546,31 +456,31 @@ if(alert("Are you sure? This will start up the engine. Should only be used during debug!",,"Yes","No") != "Yes") return - for(var/obj/machinery/power/emitter/E in world) + for(var/obj/machinery/power/emitter/E in machines) if(istype(get_area(E), /area/space)) E.anchored = TRUE E.state = 2 E.connect_to_network() E.active = TRUE - for(var/obj/machinery/field_generator/F in world) + for(var/obj/machinery/field_generator/F in machines) if(istype(get_area(F), /area/space)) F.Varedit_start = 1 - for(var/obj/machinery/power/grounding_rod/GR in world) + for(var/obj/machinery/power/grounding_rod/GR in machines) GR.anchored = TRUE GR.update_icon() - for(var/obj/machinery/power/tesla_coil/TC in world) + for(var/obj/machinery/power/tesla_coil/TC in machines) TC.anchored = TRUE TC.update_icon() - for(var/obj/structure/particle_accelerator/PA in world) + for(var/obj/structure/particle_accelerator/PA in machines) PA.anchored = TRUE PA.construction_state = 3 PA.update_icon() - for(var/obj/machinery/particle_accelerator/PA in world) + for(var/obj/machinery/particle_accelerator/PA in machines) PA.anchored = TRUE PA.construction_state = 3 PA.update_icon() - for(var/obj/machinery/power/rad_collector/Rad in world) + for(var/obj/machinery/power/rad_collector/Rad in machines) if(Rad.anchored) if(!Rad.P) var/obj/item/weapon/tank/phoron/Phoron = new/obj/item/weapon/tank/phoron(Rad) @@ -597,7 +507,7 @@ var/found_the_pump = 0 var/obj/machinery/power/supermatter/SM - for(var/obj/machinery/M in world) + for(var/obj/machinery/M in machines) if(!M) continue if(!M.loc) diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index 595675ea80..9fdf39c0d1 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -48,7 +48,7 @@ var/largest_click_time = 0 var/mob/largest_move_mob = null var/mob/largest_click_mob = null - for(var/mob/M in world) + for(var/mob/M in mob_list) if(!M.client) continue if(M.next_move >= largest_move_time) diff --git a/code/modules/admin/verbs/grief_fixers.dm b/code/modules/admin/verbs/grief_fixers.dm index 7059fef907..2d524b4c23 100644 --- a/code/modules/admin/verbs/grief_fixers.dm +++ b/code/modules/admin/verbs/grief_fixers.dm @@ -38,7 +38,7 @@ unsorted_overlays |= gas_data.tile_overlay[id] - for(var/turf/simulated/T in world) + for(var/turf/simulated/T in turfs) T.air = null T.overlays.Remove(unsorted_overlays) T.zone = null diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm index 896509280e..4e106cfbba 100644 --- a/code/modules/admin/verbs/mapping.dm +++ b/code/modules/admin/verbs/mapping.dm @@ -22,6 +22,8 @@ var/camera_range_display_status = 0 var/intercom_range_display_status = 0 +GLOBAL_LIST_BOILERPLATE(all_debugging_effects, /obj/effect/debugging) + /obj/effect/debugging/camera_range icon = 'icons/480x480.dmi' icon_state = "25percent" @@ -54,7 +56,7 @@ var/intercom_range_display_status = 0 - for(var/obj/effect/debugging/camera_range/C in world) + for(var/obj/effect/debugging/camera_range/C in all_debugging_effects) qdel(C) if(camera_range_display_status) @@ -113,11 +115,11 @@ var/intercom_range_display_status = 0 else intercom_range_display_status = 1 - for(var/obj/effect/debugging/marker/M in world) + for(var/obj/effect/debugging/marker/M in all_debugging_effects) qdel(M) if(intercom_range_display_status) - for(var/obj/item/device/radio/intercom/I in world) + for(var/obj/item/device/radio/intercom/I in machines) for(var/turf/T in orange(7,I)) var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T) if (!(F in view(7,I.loc))) @@ -294,7 +296,7 @@ var/list/debug_verbs = list ( var/list/atom/atom_list = list() - for(var/atom/A in world) + for(var/atom/A in all_atoms) if(istype(A,type_path)) var/atom/B = A while(!(isturf(B.loc))) @@ -330,7 +332,7 @@ var/list/debug_verbs = list ( var/count = 0 - for(var/atom/A in world) + for(var/atom/A in all_atoms) if(istype(A,type_path)) count++ /* diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index ef770dbc60..7dd21ec190 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -139,12 +139,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] @@ -155,12 +155,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) A.vars[variable] = O.vars[variable] @@ -179,12 +179,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else @@ -194,12 +194,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) A.vars[variable] = O.vars[variable] @@ -223,7 +223,7 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) if(variable=="light_range") A.set_light(new_value) @@ -231,7 +231,7 @@ A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) if(variable=="light_range") A.set_light(new_value) @@ -248,7 +248,7 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) if(variable=="light_range") A.set_light(new_value) @@ -256,7 +256,7 @@ A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) if(variable=="light_range") A.set_light(new_value) @@ -275,12 +275,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else @@ -290,12 +290,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) A.vars[variable] = O.vars[variable] @@ -311,12 +311,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O.type, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else if(istype(O.type, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else @@ -326,12 +326,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O.type, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) A.vars[variable] = O.vars[variable] else if(istype(O.type, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) A.vars[variable] = O.vars[variable] @@ -346,12 +346,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if ( istype(A , O.type) ) A.vars[variable] = O.vars[variable] @@ -362,12 +362,12 @@ M.vars[variable] = O.vars[variable] else if(istype(O, /obj)) - for(var/obj/A in world) + for(var/obj/A in all_objs) if (A.type == O.type) A.vars[variable] = O.vars[variable] else if(istype(O, /turf)) - for(var/turf/A in world) + for(var/turf/A in turfs) if (A.type == O.type) A.vars[variable] = O.vars[variable] diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index eb7451c61c..c622f08516 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -54,12 +54,12 @@ var/list/sounds_cache = list() set name = "Cuban Pete Time" message_admins("[key_name_admin(usr)] has declared Cuban Pete Time!", 1) - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.client) if(M.client.midis) M << 'cubanpetetime.ogg' - for(var/mob/living/carbon/human/CP in world) + for(var/mob/living/carbon/human/CP in human_mob_list) if(CP.real_name=="Cuban Pete" && CP.key!="Rosham") CP << "Your body can't contain the rhumba beat" CP.gib() @@ -70,7 +70,7 @@ var/list/sounds_cache = list() set name = "Banana Phone" message_admins("[key_name_admin(usr)] has activated Banana Phone!", 1) - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.client) if(M.client.midis) M << 'bananaphone.ogg' @@ -81,7 +81,7 @@ client/proc/space_asshole() set name = "Space Asshole" message_admins("[key_name_admin(usr)] has played the Space Asshole Hymn.", 1) - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.client) if(M.client.midis) M << 'sound/music/space_asshole.ogg' @@ -92,7 +92,7 @@ client/proc/honk_theme() set name = "Honk" message_admins("[key_name_admin(usr)] has creeped everyone out with Blackest Honks.", 1) - for(var/mob/M in world) + for(var/mob/M in player_list) if(M.client) if(M.client.midis) M << 'honk_theme.ogg'*/ diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9536f830fb..1fe710d016 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -704,7 +704,7 @@ Traitors and the like can also be revived with the previous role mostly intact. switch(alert("How would you like to ban someone today?", "Manual Ban", "Key List", "Enter Manually", "Cancel")) if("Key List") var/list/keys = list() - for(var/mob/M in world) + for(var/mob/M in player_list) keys += M.client var/selection = input("Please, select a player!", "Admin Jumping", null, null) as null|anything in keys if(!selection) diff --git a/code/modules/admin/view_variables/topic.dm b/code/modules/admin/view_variables/topic.dm index 7c68737490..ec7bbe34a3 100644 --- a/code/modules/admin/view_variables/topic.dm +++ b/code/modules/admin/view_variables/topic.dm @@ -184,7 +184,7 @@ switch(action_type) if("Strict type") var/i = 0 - for(var/obj/Obj in world) + for(var/obj/Obj in all_objs) if(Obj.type == O_type) i++ qdel(Obj) @@ -195,7 +195,7 @@ message_admins("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted)") if("Type and subtypes") var/i = 0 - for(var/obj/Obj in world) + for(var/obj/Obj in all_objs) if(istype(Obj,O_type)) i++ qdel(Obj) diff --git a/code/modules/assembly/signaler.dm b/code/modules/assembly/signaler.dm index 57bb0b541d..cd4c253f66 100644 --- a/code/modules/assembly/signaler.dm +++ b/code/modules/assembly/signaler.dm @@ -117,14 +117,6 @@ Code: signal.data["message"] = "ACTIVATE" radio_connection.post_signal(src, signal) return -/* - for(var/obj/item/device/assembly/signaler/S in world) - if(!S) continue - if(S == src) continue - if((S.frequency == src.frequency) && (S.code == src.code)) - spawn(0) - if(S) S.pulse(0) - return 0*/ /obj/item/device/assembly/signaler/pulse(var/radio = 0) diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index ee815fd558..0d61b1b418 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_clothing, /obj/item/clothing) + /obj/item/clothing name = "clothing" siemens_coefficient = 0.9 diff --git a/code/modules/events/escaped_slimes.dm b/code/modules/events/escaped_slimes.dm index 9cc2f5a7fc..b36a0d15bf 100644 --- a/code/modules/events/escaped_slimes.dm +++ b/code/modules/events/escaped_slimes.dm @@ -32,7 +32,7 @@ /datum/event/escaped_slimes/start() var/list/vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) if(temp_vent.network && temp_vent.loc.z in using_map.station_levels) //borrowed from spiders event, but it works. Distribute the slimes only in rooms with vents vents += temp_vent diff --git a/code/modules/events/gravity.dm b/code/modules/events/gravity.dm index f5fc8f0b5a..e0cd38dcfb 100644 --- a/code/modules/events/gravity.dm +++ b/code/modules/events/gravity.dm @@ -16,7 +16,7 @@ /datum/event/gravity/start() gravity_is_on = 0 - for(var/area/A in world) + for(var/area/A in all_areas) if(A.z in zLevels) A.gravitychange(gravity_is_on, A) @@ -24,7 +24,7 @@ if(!gravity_is_on) gravity_is_on = 1 - for(var/area/A in world) + for(var/area/A in all_areas) if(A.z in zLevels) A.gravitychange(gravity_is_on, A) diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm index 6930a63222..b4b43bfe97 100644 --- a/code/modules/events/ion_storm.dm +++ b/code/modules/events/ion_storm.dm @@ -12,7 +12,7 @@ continue players += player.real_name - for (var/mob/living/silicon/ai/target in world) + for (var/mob/living/silicon/ai/target in silicon_mob_list) var/law = target.generate_ion_law() target << "You have detected a change in your laws information:" target << law @@ -30,7 +30,7 @@ /datum/event/ionstorm/tick() if(botEmagChance) - for(var/mob/living/bot/bot in world) + for(var/mob/living/bot/bot in mob_list) if(prob(botEmagChance)) bot.emag_act(1) @@ -146,7 +146,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is M.add_ion_law("THE STATION IS [who2pref] [who2]") if(botEmagChance) - for(var/obj/machinery/bot/bot in world) + for(var/obj/machinery/bot/bot in mob_list) if(prob(botEmagChance)) bot.Emag() */ @@ -162,21 +162,21 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is spawn(0) world << "Started processing APCs" - for (var/obj/machinery/power/apc/APC in world) + for (var/obj/machinery/power/apc/APC in machines) if(APC.z in station_levels) APC.ion_act() apcnum++ world << "Finished processing APCs. Processed: [apcnum]" spawn(0) world << "Started processing SMES" - for (var/obj/machinery/power/smes/SMES in world) + for (var/obj/machinery/power/smes/SMES in machines) if(SMES.z in station_levels) SMES.ion_act() smesnum++ world << "Finished processing SMES. Processed: [smesnum]" spawn(0) world << "Started processing AIRLOCKS" - for (var/obj/machinery/door/airlock/D in world) + for (var/obj/machinery/door/airlock/D in machines) if(D.z in station_levels) //if(length(D.req_access) > 0 && !(12 in D.req_access)) //not counting general access and maintenance airlocks airlocknum++ @@ -185,7 +185,7 @@ Would like to add a law like "Law x is _______" where x = a number, and _____ is world << "Finished processing AIRLOCKS. Processed: [airlocknum]" spawn(0) world << "Started processing FIREDOORS" - for (var/obj/machinery/door/firedoor/D in world) + for (var/obj/machinery/door/firedoor/D in machines) if(D.z in station_levels) firedoornum++; spawn(0) diff --git a/code/modules/events/money_hacker.dm b/code/modules/events/money_hacker.dm index b0304d4f88..47734f412d 100644 --- a/code/modules/events/money_hacker.dm +++ b/code/modules/events/money_hacker.dm @@ -20,7 +20,7 @@ Notifications will be sent as updates occur.
" var/my_department = "[station_name()] firewall subroutines" - for(var/obj/machinery/message_server/MS in world) + for(var/obj/machinery/message_server/MS in machines) if(!MS.active) continue MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2) @@ -62,6 +62,6 @@ var/my_department = "[station_name()] firewall subroutines" - for(var/obj/machinery/message_server/MS in world) + for(var/obj/machinery/message_server/MS in machines) if(!MS.active) continue MS.send_rc_message("Head of Personnel's Desk", my_department, message, "", "", 2) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index 2f5d099e8d..57a80c8d32 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -41,14 +41,14 @@ /datum/event/prison_break/start() - for(var/area/A in world) + for(var/area/A in all_areas) if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType)) areas += A if(areas && areas.len > 0) var/my_department = "[station_name()] firewall subroutines" var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [stationtime2text()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.
" - for(var/obj/machinery/message_server/MS in world) + for(var/obj/machinery/message_server/MS in machines) MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2) for(var/mob/living/silicon/ai/A in player_list) A << "Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department]." diff --git a/code/modules/events/spider_infestation.dm b/code/modules/events/spider_infestation.dm index b425ea9976..7eb0be92cc 100644 --- a/code/modules/events/spider_infestation.dm +++ b/code/modules/events/spider_infestation.dm @@ -16,7 +16,7 @@ /datum/event/spider_infestation/start() var/list/vents = list() - for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) + for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in machines) if(!temp_vent.welded && temp_vent.network && temp_vent.loc.z in using_map.station_levels) if(temp_vent.network.normal_members.len > 50) vents += temp_vent diff --git a/code/modules/hydroponics/seed_controller.dm b/code/modules/hydroponics/seed_controller.dm index 6a743d4a1c..b0aaab0a7c 100644 --- a/code/modules/hydroponics/seed_controller.dm +++ b/code/modules/hydroponics/seed_controller.dm @@ -81,7 +81,7 @@ var/global/datum/controller/plants/plant_controller // Set in New(). // Make sure any seed packets that were mapped in are updated // correctly (since the seed datums did not exist a tick ago). - for(var/obj/item/seeds/S in world) + for(var/obj/item/seeds/S in all_seed_packs) S.update_seed() //Might as well mask the gene types while we're at it. diff --git a/code/modules/hydroponics/seed_packets.dm b/code/modules/hydroponics/seed_packets.dm index 1b5318868b..0689f428b6 100644 --- a/code/modules/hydroponics/seed_packets.dm +++ b/code/modules/hydroponics/seed_packets.dm @@ -1,5 +1,7 @@ var/global/list/plant_seed_sprites = list() +GLOBAL_LIST_BOILERPLATE(all_seed_packs, /obj/item/seeds) + //Seed packet object/procs. /obj/item/seeds name = "packet of seeds" diff --git a/code/modules/lighting/lighting_setup.dm b/code/modules/lighting/lighting_setup.dm index b3e3cf7aa2..02621fdac1 100644 --- a/code/modules/lighting/lighting_setup.dm +++ b/code/modules/lighting/lighting_setup.dm @@ -1,6 +1,6 @@ // Create lighting overlays on all turfs with dynamic lighting in areas with dynamic lighting. /proc/create_all_lighting_overlays() - for(var/area/A in world) + for(var/area/A in all_areas) if(!A.dynamic_lighting) continue for(var/turf/T in A) diff --git a/code/modules/maps/tg/reader.dm b/code/modules/maps/tg/reader.dm index 1ba29fa183..027d1c4cae 100644 --- a/code/modules/maps/tg/reader.dm +++ b/code/modules/maps/tg/reader.dm @@ -285,7 +285,7 @@ var/global/use_preloader = FALSE var/atom/instance _preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation var/atype = members[index] - for(var/area/A in world) + for(var/area/A in all_areas) if(A.type == atype) instance = A break diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm index 2b9340192f..fbc07117e1 100644 --- a/code/modules/mob/dead/observer/observer.dm +++ b/code/modules/mob/dead/observer/observer.dm @@ -795,7 +795,7 @@ mob/observer/dead/MayRespawn(var/feedback = 0) set name = "Blank pAI alert" set desc = "Flash an indicator light on available blank pAI devices for a smidgen of hope." if(usr.client.prefs.be_special & BE_PAI) - for(var/obj/item/device/paicard/p in world) + for(var/obj/item/device/paicard/p in all_pai_cards) var/obj/item/device/paicard/PP = p if(PP.pai == null) PP.overlays += "pai-ghostalert" diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1cea9e2113..2a82195f0b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -842,7 +842,7 @@ src.verbs -= /mob/living/carbon/human/proc/remotesay return var/list/creatures = list() - for(var/mob/living/carbon/h in world) + for(var/mob/living/carbon/h in mob_list) creatures += h var/mob/target = input("Who do you want to project your mind to ?") as null|anything in creatures if (isnull(target)) @@ -855,7 +855,7 @@ target.show_message(" You hear a voice that seems to echo around the room: [say]") usr.show_message(" You project your mind into [target.real_name]: [say]") log_say("(TPATH to [key_name(target)]) [say]",src) - for(var/mob/observer/dead/G in world) + for(var/mob/observer/dead/G in mob_list) G.show_message("Telepathic message from [src] to [target]: [say]") /mob/living/carbon/human/proc/remoteobserve() @@ -880,7 +880,7 @@ var/list/mob/creatures = list() - for(var/mob/living/carbon/h in world) + for(var/mob/living/carbon/h in mob_list) var/turf/temp_turf = get_turf(h) if((temp_turf.z != 1 && temp_turf.z != 5) || h.stat!=CONSCIOUS) //Not on mining or the station. Or dead continue @@ -919,7 +919,7 @@ restore_all_organs() // Reapply robotics/amputated status from preferences. if(!client || !key) //Don't boot out anyone already in the mob. - for (var/obj/item/organ/internal/brain/H in world) + for (var/obj/item/organ/internal/brain/H in all_brain_organs) if(H.brainmob) if(H.brainmob.real_name == src.real_name) if(H.brainmob.mind) diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm index 0c33834db7..534117cee0 100644 --- a/code/modules/mob/living/silicon/ai/death.dm +++ b/code/modules/mob/living/silicon/ai/death.dm @@ -8,7 +8,7 @@ remove_ai_verbs(src) - for(var/obj/machinery/ai_status_display/O in world) + for(var/obj/machinery/ai_status_display/O in machines) spawn( 0 ) O.mode = 2 if (istype(loc, /obj/item/device/aicard)) diff --git a/code/modules/mob/living/silicon/ai/logout.dm b/code/modules/mob/living/silicon/ai/logout.dm index 09bc93bf34..25921ef960 100644 --- a/code/modules/mob/living/silicon/ai/logout.dm +++ b/code/modules/mob/living/silicon/ai/logout.dm @@ -1,6 +1,6 @@ /mob/living/silicon/ai/Logout() ..() - for(var/obj/machinery/ai_status_display/O in world) //change status + for(var/obj/machinery/ai_status_display/O in machines) //change status O.mode = 0 if(!isturf(loc)) if (client) diff --git a/code/modules/mob/living/silicon/decoy/death.dm b/code/modules/mob/living/silicon/decoy/death.dm index b94a311ef7..759b958bc2 100644 --- a/code/modules/mob/living/silicon/decoy/death.dm +++ b/code/modules/mob/living/silicon/decoy/death.dm @@ -3,6 +3,6 @@ icon_state = "ai-crash" spawn(10) explosion(loc, 3, 6, 12, 15) - for(var/obj/machinery/ai_status_display/O in world) //change status + for(var/obj/machinery/ai_status_display/O in machines) //change status O.mode = 2 return ..(gibbed) \ No newline at end of file diff --git a/code/modules/mob/living/silicon/pai/recruit.dm b/code/modules/mob/living/silicon/pai/recruit.dm index ba6a4353bc..ac9d5b4f27 100644 --- a/code/modules/mob/living/silicon/pai/recruit.dm +++ b/code/modules/mob/living/silicon/pai/recruit.dm @@ -87,7 +87,7 @@ var/datum/paiController/paiController // Global handler for pAI candidates if("submit") if(candidate) candidate.ready = 1 - for(var/obj/item/device/paicard/p in world) + for(var/obj/item/device/paicard/p in all_pai_cards) if(p.looking_for_personality == 1) p.alertUpdate() usr << browse(null, "window=paiRecruit") diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 827387c5a4..d102f9e7cb 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -187,9 +187,8 @@ var/list/mob_hat_cache = list() user.visible_message("\The [user] swipes [TU.his] ID card through \the [src], attempting to reboot it.", ">You swipe your ID card through \the [src], attempting to reboot it.") var/drones = 0 - for(var/mob/living/silicon/robot/drone/D in world) - if(D.key && D.client) - drones++ + for(var/mob/living/silicon/robot/drone/D in player_list) + drones++ if(drones < config.max_maint_drones) request_player() return diff --git a/code/modules/mob/living/silicon/robot/drone/drone_console.dm b/code/modules/mob/living/silicon/robot/drone/drone_console.dm index 8c12226e3d..113394811b 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_console.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_console.dm @@ -26,7 +26,7 @@ var/dat dat += "Maintenance Units
" - for(var/mob/living/silicon/robot/drone/D in world) + for(var/mob/living/silicon/robot/drone/D in mob_list) if(D.z != src.z) continue dat += "
[D.real_name] ([D.stat == 2 ? "INACTIVE" : "ACTIVE"])" @@ -68,8 +68,8 @@ else if (href_list["ping"]) usr << "You issue a maintenance request for all active drones, highlighting [drone_call_area]." - for(var/mob/living/silicon/robot/drone/D in world) - if(D.client && D.stat == 0) + for(var/mob/living/silicon/robot/drone/D in player_list) + if(D.stat == 0) D << "-- Maintenance drone presence requested in: [drone_call_area]." else if (href_list["resync"]) diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index b0a7543e11..e9589622a5 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -1,8 +1,7 @@ /proc/count_drones() var/drones = 0 - for(var/mob/living/silicon/robot/drone/D in world) - if(D.key && D.client) - drones++ + for(var/mob/living/silicon/robot/drone/D in player_list) + drones++ return drones /obj/machinery/drone_fabricator @@ -135,7 +134,7 @@ return var/list/all_fabricators = list() - for(var/obj/machinery/drone_fabricator/DF in world) + for(var/obj/machinery/drone_fabricator/DF in machines) if(DF.stat & NOPOWER || !DF.produce_drones) continue if(DF.drone_progress >= 100) diff --git a/code/modules/organs/internal/brain.dm b/code/modules/organs/internal/brain.dm index ec0b9d8034..0dc2fd1fc4 100644 --- a/code/modules/organs/internal/brain.dm +++ b/code/modules/organs/internal/brain.dm @@ -1,3 +1,5 @@ +GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain) + /obj/item/organ/internal/brain name = "brain" health = 400 //They need to live awhile longer than other organs. Is this even used by organ code anymore? diff --git a/code/modules/power/fusion/_setup.dm b/code/modules/power/fusion/_setup.dm index b4aca0c827..4ac8bb9cbf 100644 --- a/code/modules/power/fusion/_setup.dm +++ b/code/modules/power/fusion/_setup.dm @@ -17,7 +17,7 @@ to_chat(usr, "Error: you are not an admin!") return - if(!(locate(/obj/machinery/power/fusion_core/mapped) in world)) + if(!(locate(/obj/machinery/power/fusion_core/mapped) in machines)) to_chat(usr, "This map is not appropriate for this verb.") return @@ -40,7 +40,7 @@ var/list/delayed_objects = list() // SETUP PHASE - for(var/obj/effect/engine_setup/S in world) + for(var/obj/effect/engine_setup/S in machines) var/result = S.activate(0) switch(result) if(SETUP_OK) diff --git a/code/modules/power/sensors/powernet_sensor.dm b/code/modules/power/sensors/powernet_sensor.dm index 20c8837b32..bc1298d201 100644 --- a/code/modules/power/sensors/powernet_sensor.dm +++ b/code/modules/power/sensors/powernet_sensor.dm @@ -35,7 +35,7 @@ /obj/machinery/power/sensor/Destroy() . = ..() // TODO - Switch power_monitor to register deletion events instead of this. - for(var/obj/machinery/computer/power_monitor/PM in world) + for(var/obj/machinery/computer/power_monitor/PM in machines) if(PM.power_monitor) PM.power_monitor.refresh_sensors() diff --git a/code/modules/power/singularity/singularity.dm b/code/modules/power/singularity/singularity.dm index 75ec8fffc7..05e5e6e023 100644 --- a/code/modules/power/singularity/singularity.dm +++ b/code/modules/power/singularity/singularity.dm @@ -1,5 +1,7 @@ //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33 +GLOBAL_LIST_BOILERPLATE(all_singularities, /obj/singularity) + /obj/singularity/ name = "gravitational singularity" desc = "A gravitational singularity." diff --git a/code/modules/power/supermatter/setup_supermatter.dm b/code/modules/power/supermatter/setup_supermatter.dm index f797e14f9e..a457dd121e 100644 --- a/code/modules/power/supermatter/setup_supermatter.dm +++ b/code/modules/power/supermatter/setup_supermatter.dm @@ -32,7 +32,7 @@ // CONFIGURATION PHASE // Coolant canisters, set types according to response. - for(var/obj/effect/engine_setup/coolant_canister/C in world) + for(var/obj/effect/engine_setup/coolant_canister/C in all_engine_setup_markers) switch(response) if("N2") C.canister_type = /obj/machinery/portable_atmospherics/canister/nitrogen/engine_setup/ @@ -44,7 +44,7 @@ C.canister_type = /obj/machinery/portable_atmospherics/canister/phoron/engine_setup/ continue - for(var/obj/effect/engine_setup/core/C in world) + for(var/obj/effect/engine_setup/core/C in all_engine_setup_markers) switch(response) if("N2") C.energy_setting = ENERGY_NITROGEN @@ -56,12 +56,12 @@ C.energy_setting = ENERGY_PHORON continue - for(var/obj/effect/engine_setup/atmo_filter/F in world) + for(var/obj/effect/engine_setup/atmo_filter/F in all_engine_setup_markers) F.coolant = response var/list/delayed_objects = list() // SETUP PHASE - for(var/obj/effect/engine_setup/S in world) + for(var/obj/effect/engine_setup/S in all_engine_setup_markers) var/result = S.activate(0) switch(result) if(SETUP_OK) @@ -108,6 +108,8 @@ icon = 'icons/mob/screen1.dmi' icon_state = "x3" +GLOBAL_LIST_BOILERPLATE(all_engine_setup_markers, /obj/effect/engine_setup) + /obj/effect/engine_setup/proc/activate(var/last = 0) return 1 diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index dd431e2de9..d1be4f08da 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -103,7 +103,7 @@ usr << "No input found please hang up and try your call again." return id = input - for(var/obj/machinery/conveyor_switch/C in world) + for(var/obj/machinery/conveyor_switch/C in machines) if(C.id == id) C.conveyors |= src return @@ -190,7 +190,7 @@ /obj/machinery/conveyor_switch/LateInitialize() conveyors = list() - for(var/obj/machinery/conveyor/C in world) + for(var/obj/machinery/conveyor/C in machines) if(C.id == id) conveyors += C @@ -238,7 +238,7 @@ update() // find any switches with same id as this one, and set their positions to match us - for(var/obj/machinery/conveyor_switch/S in world) + for(var/obj/machinery/conveyor_switch/S in machines) if(S.id == src.id) S.position = position S.update() @@ -269,7 +269,7 @@ return id = input conveyors = list() // Clear list so they aren't double added. - for(var/obj/machinery/conveyor/C in world) + for(var/obj/machinery/conveyor/C in machines) if(C.id == id) conveyors += C return @@ -289,7 +289,7 @@ update() // find any switches with same id as this one, and set their positions to match us - for(var/obj/machinery/conveyor_switch/S in world) + for(var/obj/machinery/conveyor_switch/S in machines) if(S.id == src.id) S.position = position S.update() diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm index 07c8429bfb..680c4b8ac4 100644 --- a/code/modules/recycling/disposal.dm +++ b/code/modules/recycling/disposal.dm @@ -130,7 +130,7 @@ for (var/mob/C in viewers(src)) C.show_message("[GM.name] has been placed in the [src] by [user].", 3) qdel(G) - + add_attack_logs(user,GM,"Disposals dunked") return @@ -967,7 +967,7 @@ // *** TEST verb //client/verb/dispstop() -// for(var/obj/structure/disposalholder/H in world) +// for(var/obj/structure/disposalholder/H in all_objs) // H.active = 0 // a straight or bent segment diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm index bc5dc64652..4d5eeb7905 100644 --- a/code/modules/security levels/keycard authentication.dm +++ b/code/modules/security levels/keycard authentication.dm @@ -132,7 +132,7 @@ /obj/machinery/keycard_auth/proc/broadcast_request() icon_state = "auth_on" - for(var/obj/machinery/keycard_auth/KA in world) + for(var/obj/machinery/keycard_auth/KA in machines) if(KA == src) continue KA.reset() spawn() diff --git a/code/modules/shuttles/shuttle_specops.dm b/code/modules/shuttles/shuttle_specops.dm index 74acd095f7..47c3aca5ab 100644 --- a/code/modules/shuttles/shuttle_specops.dm +++ b/code/modules/shuttles/shuttle_specops.dm @@ -182,10 +182,10 @@ sleep(10) var/spawn_marauder[] = new() - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name == "Marauder Entry") spawn_marauder.Add(L) - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name == "Marauder Exit") var/obj/effect/portal/P = new(L.loc) P.invisibility = 101//So it is not seen by anyone. diff --git a/code/modules/xenoarcheaology/tools/tools.dm b/code/modules/xenoarcheaology/tools/tools.dm index 5f8c30ecad..78a1a992e7 100644 --- a/code/modules/xenoarcheaology/tools/tools.dm +++ b/code/modules/xenoarcheaology/tools/tools.dm @@ -257,7 +257,7 @@ if(processing_objects.Find(src)) //scan radios in the world to try and find one var/cur_dist = 999 - for(var/obj/item/device/radio/beacon/R in world) + for(var/obj/item/device/radio/beacon/R in all_beacons) if(R.z == src.z && R.frequency == src.frequency) var/check_dist = get_dist(src,R) if(check_dist < cur_dist) diff --git a/code/unit_tests/map_tests.dm b/code/unit_tests/map_tests.dm index c5bccc437d..78f00622dc 100644 --- a/code/unit_tests/map_tests.dm +++ b/code/unit_tests/map_tests.dm @@ -41,7 +41,7 @@ var/list/zs_to_test = using_map.unit_test_z_levels || list(1) //Either you set it, or you just get z1 - for(var/area/A in world) + for(var/area/A in all_areas) if((A.z in zs_to_test) && !(A.type in exempt_areas)) area_test_count++ var/area_good = 1 diff --git a/code/world.dm b/code/world.dm index 6fb6a1a01a..bf5a43bb27 100644 --- a/code/world.dm +++ b/code/world.dm @@ -88,28 +88,7 @@ var/global/datum/global_init/init = new () if(config.generate_map) if(using_map.perform_map_generation()) using_map.refresh_mining_turfs() -/* - if(config.generate_asteroid) - // These values determine the specific area that the map is applied to. - // Because we do not use Bay's default map, we check the config file to see if custom parameters are needed, so we need to avoid hardcoding. - if(config.asteroid_z_levels) - for(var/z_level in config.asteroid_z_levels) - // In case we got fed a string instead of a number... - z_level = text2num(z_level) - if(!isnum(z_level)) - // If it's still not a number, we probably got fed some nonsense string. - admin_notice("Error: ASTEROID_Z_LEVELS config wasn't given a number.") - // Now for the actual map generating. This occurs for every z-level defined in the config. - new /datum/random_map/automata/cave_system(null,1,1,z_level,300,300) - // Let's add ore too. - new /datum/random_map/noise/ore(null, 1, 1, z_level, 64, 64) - else - admin_notice("Error: No asteroid z-levels defined in config!") - // Update all turfs to ensure everything looks good post-generation. Yes, - // it's brute-forcey, but frankly the alternative is a mine turf rewrite. - for(var/turf/simulated/mineral/M in world) // Ugh. - M.update_icon() -*/ + // Create frame types. populate_frame_types() diff --git a/maps/~map_system/maps.dm b/maps/~map_system/maps.dm index 8b4a4ab8ab..3abacab033 100644 --- a/maps/~map_system/maps.dm +++ b/maps/~map_system/maps.dm @@ -110,7 +110,7 @@ var/list/all_maps = list() // Update all turfs to ensure everything looks good post-generation. Yes, // it's brute-forcey, but frankly the alternative is a mine turf rewrite. - for(var/turf/simulated/mineral/M in world) // Ugh. + for(var/turf/simulated/mineral/M in turfs) // Ugh. M.update_icon() /datum/map/proc/get_network_access(var/network)