Skip to content

Commit

Permalink
converts get_exonet_node to use GLOB (#5751)
Browse files Browse the repository at this point in the history
…tead of iterating GLOB.machines)

<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request

title

## Why It's Good For The Game

kevin asked

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Be sure to properly
mark your PRs to prevent unnecessary GBP loss. You can read up on GBP
and it's effects on PRs in the tgstation guides for contributors. Please
note that maintainers freely reserve the right to remove and add tags
should they deem it appropriate. You can attempt to finagle the system
all you want, but it's best to shoot for clear communication right off
the bat. -->

:cl:
add: gay frogs
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
Mazianni committed Jul 24, 2023
1 parent 9b12813 commit 5dae90d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion code/game/machinery/exonet_node.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
GLOBAL_LIST_EMPTY(exonet_nodes)

/obj/machinery/exonet_node
name = "exonet node"
desc = null // Gets written in New()
Expand All @@ -21,12 +23,20 @@
// Proc: Initialize()
// Parameters: None
// Description: Adds components to the machine for deconstruction. Also refreshes the descrition.
/obj/machinery/exonet_node/Initialize(mapload)
. = ..()
GLOB.exonet_nodes += src

/obj/machinery/exonet_node/map/Initialize(mapload, newdir)
. = ..()
desc = "This machine is one of many, many nodes inside [(LEGACY_MAP_DATUM).starsys_name]'s section of the Exonet, connecting the \
[(LEGACY_MAP_DATUM).station_short] to the rest of the system, at least electronically."
update_desc()

/obj/machinery/exonet_node/Destroy()
. = ..()
GLOB.exonet_nodes -= src

// Proc: update_icon()
// Parameters: None
// Description: Self explanatory.
Expand Down Expand Up @@ -164,7 +174,7 @@
// Parameters: None
// Description: Helper proc to get a reference to an Exonet node.
/proc/get_exonet_node(atom/host)
for(var/obj/machinery/exonet_node/E in GLOB.machines)
for(var/obj/machinery/exonet_node/E in GLOB.exonet_nodes)
if(E.on && (!host || can_telecomm(host, E)))
return E

Expand Down

0 comments on commit 5dae90d

Please sign in to comment.