mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 22:42:26 +01:00
Add get_listeners_by_type (#3483)
This commit is contained in:
@@ -25,3 +25,16 @@ var/datum/controller/subsystem/listener/SSlistener
|
||||
|
||||
if (!LAZYLEN(listeners[L.channel]))
|
||||
listeners -= L.channel
|
||||
|
||||
/proc/get_listeners_by_type(id, type)
|
||||
if (!type)
|
||||
CRASH("Cannot get listeners of type null.")
|
||||
|
||||
. = list()
|
||||
var/listener/L
|
||||
var/datum/D
|
||||
for (var/thing in GET_LISTENERS(id))
|
||||
L = thing
|
||||
D = L.target
|
||||
if (istype(D, type) && !QDELETED(D))
|
||||
. += D
|
||||
|
||||
Reference in New Issue
Block a user