diff --git a/code/defines/procs/global_lists.dm b/code/defines/procs/global_lists.dm index 9f2942a30b..29e9ad28ad 100644 --- a/code/defines/procs/global_lists.dm +++ b/code/defines/procs/global_lists.dm @@ -12,6 +12,7 @@ var/global/list/hair_styles_list = list() //stores /datum/sprite_accessory/hai var/global/list/facial_hair_styles_list = list() //stores /datum/sprite_accessory/facial_hair indexed by name var/global/list/chemical_reactions_list //list of all /datum/chemical_reaction datums. Used during chemical reactions var/global/list/chemical_reagents_list //list of all /datum/reagent datums indexed by reagent id. Used by chemistry stuff +var/global/list/landmarks_list = list() //list of all landmarks created ////////////////////////// /////Initial Building///// diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 9b65abb3aa..e8e9c7f747 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -366,7 +366,7 @@ world.log << "ERROR: Could not initate grey-tide. Unable find prison or brig area." /proc/carp_migration() // -- Darem - for(var/obj/effect/landmark/C in world) + for(var/obj/effect/landmark/C in landmarks_list) if(C.name == "carpspawn") new /mob/living/simple_animal/carp(C.loc) //sleep(100) @@ -383,7 +383,7 @@ for(var/i=1,i<=lightsoutAmount,i++) var/list/possibleEpicentres = list() - for(var/obj/effect/landmark/newEpicentre in world) + for(var/obj/effect/landmark/newEpicentre in landmarks_list) if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList)) possibleEpicentres += newEpicentre if(possibleEpicentres.len) diff --git a/code/game/gamemodes/events/space_ninja.dm b/code/game/gamemodes/events/space_ninja.dm index 622ad64dea..90c44fdfa5 100644 --- a/code/game/gamemodes/events/space_ninja.dm +++ b/code/game/gamemodes/events/space_ninja.dm @@ -133,7 +133,7 @@ Malf AIs/silicons aren't added. Monkeys aren't added. Messes with objective comp //Here we pick a location and spawn the ninja. var/list/spawn_list = list() - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name == "carpspawn") spawn_list.Add(L) @@ -411,7 +411,7 @@ As such, it's hard-coded for now. No reason for it not to be, really. return var/list/spawn_list = list() - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if (L.name == "carpspawn") spawn_list.Add(L) diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 0763ae8025..b46eb7df7d 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -111,7 +111,7 @@ var/global/datum/controller/gameticker/ticker spawn(0)//Forking here so we dont have to wait for this to finish mode.post_setup() //Cleanup some stuff - for(var/obj/effect/landmark/start/S in world) + for(var/obj/effect/landmark/start/S in landmarks_list) //Deleting Startpoints but we need the ai point to AI-ize people later if (S.name != "AI") del(S) diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 4e5fdfb5e9..0c8d5d30a3 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -112,7 +112,7 @@ var/list/turf/synd_spawn = list() - for(var/obj/effect/landmark/A in world) + for(var/obj/effect/landmark/A in landmarks_list) if (A.name == "Syndicate-Gear-Closet") new /obj/structure/closet/syndicate/personal(A.loc) del(A) diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index b0429b94bb..0168bbf204 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -84,7 +84,7 @@ /* This was used for something before, I think, but is not worth the effort to process now. /proc/setupcorpses() - for (var/obj/effect/landmark/A in world) + for (var/obj/effect/landmark/A in landmarks_list) if (A.name == "Corpse") var/mob/living/carbon/human/M = new /mob/living/carbon/human(A.loc) M.real_name = "Corpse" diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index fdfb0468b1..fead4e6014 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -299,7 +299,7 @@ var/global/datum/controller/occupations/job_master if(!joined_late) var/obj/S = null - for(var/obj/effect/landmark/start/sloc in world) + for(var/obj/effect/landmark/start/sloc in landmarks_list) if(sloc.name != rank) continue if(locate(/mob/living) in sloc.loc) continue S = sloc diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm index de3f4d230a..e5f1aa0619 100644 --- a/code/game/machinery/computer/specops_shuttle.dm +++ b/code/game/machinery/computer/specops_shuttle.dm @@ -81,10 +81,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. diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm index c61046e9c1..a057a670cc 100644 --- a/code/game/machinery/computer/syndicate_specops_shuttle.dm +++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm @@ -83,10 +83,10 @@ var/syndicate_elite_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. diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 416e4e7dfb..39534d3c25 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -22,7 +22,7 @@ var/obj/L = null - for(var/obj/effect/landmark/sloc in world) + for(var/obj/effect/landmark/sloc in landmarks_list) if(sloc.name != C.data) continue if(locate(/mob/living) in sloc.loc) continue L = sloc diff --git a/code/game/objects/effects/landmarks.dm b/code/game/objects/effects/landmarks.dm index 317737f721..347580e4a4 100644 --- a/code/game/objects/effects/landmarks.dm +++ b/code/game/objects/effects/landmarks.dm @@ -69,8 +69,13 @@ xeno_spawn += loc del(src) + landmarks_list += src return 1 +/obj/effect/landmark/Del() + landmarks_list -= src + ..() + /obj/effect/landmark/start name = "start" icon = 'icons/mob/screen1.dmi' diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 083908dbcf..9831190812 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -409,7 +409,7 @@ Traitors and the like can also be revived with the previous role mostly intact. call(/datum/game_mode/proc/equip_syndicate)(new_character) if("Space Ninja") var/ninja_spawn[] = list() - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(L.name=="carpspawn") ninja_spawn += L new_character.equip_space_ninja() diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index ca089bfe66..409ec43124 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -63,7 +63,7 @@ var/global/sent_strike_team = 0 commandos += candidate//Add their ghost to commandos. //Spawns commandos and equips them. - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(commando_number<=0) break if (L.name == "Commando") leader_selected = commando_number == 1?1:0 @@ -86,14 +86,14 @@ var/global/sent_strike_team = 0 commando_number-- //Spawns the rest of the commando gear. - for (var/obj/effect/landmark/L) + for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Commando_Manual") //new /obj/item/weapon/gun/energy/pulse_rifle(L.loc) var/obj/item/weapon/paper/P = new(L.loc) P.info = "
Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Good luck, soldier!
" P.name = "Spec. Ops. Manual" - for (var/obj/effect/landmark/L in world) + for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Commando-Bomb") new /obj/effect/spawner/newbomb/timer/syndicate(L.loc) del(L) diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm index bcc272875c..8df19ba4d2 100644 --- a/code/modules/admin/verbs/striketeam_syndicate.dm +++ b/code/modules/admin/verbs/striketeam_syndicate.dm @@ -63,7 +63,7 @@ var/global/sent_syndicate_strike_team = 0 commandos += candidate//Add their ghost to commandos. //Spawns commandos and equips them. - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if(syndicate_commando_number<=0) break if (L.name == "Syndicate-Commando") syndicate_leader_selected = syndicate_commando_number == 1?1:0 @@ -93,7 +93,7 @@ var/global/sent_syndicate_strike_team = 0 // P.info = "Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow:
#1 Work as a team.
#2 Accomplish your objective at all costs.
#3 Leave no witnesses.
You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets.
If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device.
First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible.
To make the device functional:
#1 Place bomb in designated detonation zone
#2 Extend and anchor bomb (attack with hand).
#3 Insert Nuclear Auth. Disk into slot.
#4 Type numeric code into keypad ([nuke_code]).
Note: If you make a mistake press R to reset the device.
#5 Press the E button to log onto the device.
You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option.
Note: Toggle off the SAFETY.
Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate.
Note: THE BOMB IS STILL SET AND WILL DETONATE
Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Good luck, soldier!
" // P.name = "Spec. Ops. Manual" - for (var/obj/effect/landmark/L in world) + for (var/obj/effect/landmark/L in landmarks_list) if (L.name == "Syndicate-Commando-Bomb") new /obj/effect/spawner/newbomb/timer/syndicate(L.loc) del(L) diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm index da468705af..d9a86a3b8a 100644 --- a/code/modules/awaymissions/zlevel.dm +++ b/code/modules/awaymissions/zlevel.dm @@ -47,7 +47,7 @@ proc/createRandomZlevel() if(isfile(file)) maploader.load_map(file) - for(var/obj/effect/landmark/L in world) + for(var/obj/effect/landmark/L in landmarks_list) if (L.name != "awaystart") continue awaydestinations.Add(L) diff --git a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm index 25310c44b6..a8ad59844f 100644 --- a/code/modules/mob/living/silicon/ai/freelook/cameranet.dm +++ b/code/modules/mob/living/silicon/ai/freelook/cameranet.dm @@ -47,10 +47,12 @@ var/datum/cameranet/cameranet = new() var/list/remove = ai.visibleCameraChunks - visibleChunks var/list/add = visibleChunks - ai.visibleCameraChunks - for(var/datum/camerachunk/c in remove) + for(var/chunk in remove) + var/datum/camerachunk/c = chunk c.remove(ai) - for(var/datum/camerachunk/c in add) + for(var/chunk in add) + var/datum/camerachunk/c = chunk c.add(ai) // Updates the chunks that the turf is located in. Use this when obstacles are destroyed or when doors open. diff --git a/code/modules/mob/living/silicon/ai/freelook/chunk.dm b/code/modules/mob/living/silicon/ai/freelook/chunk.dm index a4c0cdea61..d7ae0fe9a8 100644 --- a/code/modules/mob/living/silicon/ai/freelook/chunk.dm +++ b/code/modules/mob/living/silicon/ai/freelook/chunk.dm @@ -69,8 +69,10 @@ continue for(var/turf/t in c.can_see()) - if(t in turfs) - newVisibleTurfs += t + newVisibleTurfs += t + + // Removes turf that isn't in turfs. + newVisibleTurfs &= turfs var/list/visAdded = newVisibleTurfs - visibleTurfs var/list/visRemoved = visibleTurfs - newVisibleTurfs @@ -79,20 +81,24 @@ obscuredTurfs = turfs - newVisibleTurfs - for(var/turf/t in visAdded) + for(var/turf in visAdded) + var/turf/t = turf if(t.obscured) obscured -= t.obscured - for(var/mob/aiEye/m in seenby) + for(var/eye in seenby) + var/mob/aiEye/m = eye if(m.ai.client) m.ai.client.images -= t.obscured - for(var/turf/t in visRemoved) + for(var/turf in visRemoved) + var/turf/t = turf if(t in obscuredTurfs) if(!t.obscured) t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15) obscured += t.obscured - for(var/mob/aiEye/m in seenby) + for(var/eye in seenby) + var/mob/aiEye/m = eye if(!m) seenby -= m if(m.ai.client) @@ -115,17 +121,21 @@ if(t.x >= x && t.y >= y && t.x < x + 16 && t.y < y + 16) turfs += t - for(var/obj/machinery/camera/c in cameras) + for(var/camera in cameras) + var/obj/machinery/camera/c = camera if(!c.can_use()) continue for(var/turf/t in c.can_see()) - if(t in turfs) - visibleTurfs += t + visibleTurfs += t + + // Removes turf that isn't in turfs. + visibleTurfs &= turfs obscuredTurfs = turfs - visibleTurfs - for(var/turf/t in obscuredTurfs) + for(var/turf in obscuredTurfs) + var/turf/t = turf if(!t.obscured) t.obscured = image('icons/effects/cameravis.dmi', t, "black", 15) obscured += t.obscured diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 603d58473e..15e9646d37 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -22,7 +22,7 @@ player_list |= src var/list/watch_locations = list() - for(var/obj/effect/landmark/landmark in world) + for(var/obj/effect/landmark/landmark in landmarks_list) if(landmark.tag == "landmark*new_player") watch_locations += landmark.loc diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index e93fb2c95e..a9b3937e26 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -84,21 +84,21 @@ O.key = key var/obj/loc_landmark - for(var/obj/effect/landmark/start/sloc in world) + for(var/obj/effect/landmark/start/sloc in landmarks_list) if (sloc.name != "AI") continue if (locate(/mob/living) in sloc.loc) continue loc_landmark = sloc if (!loc_landmark) - for(var/obj/effect/landmark/tripai in world) + for(var/obj/effect/landmark/tripai in landmarks_list) if (tripai.name == "tripai") if(locate(/mob/living) in tripai.loc) continue loc_landmark = tripai if (!loc_landmark) O << "Oh god sorry we can't find an unoccupied AI spawn location, so we're spawning you on top of someone." - for(var/obj/effect/landmark/start/sloc in world) + for(var/obj/effect/landmark/start/sloc in landmarks_list) if (sloc.name == "AI") loc_landmark = sloc