Add get_listeners_by_type (#3483)

This commit is contained in:
Lohikar
2017-09-22 12:45:43 +02:00
committed by Werner
parent 72a768329e
commit c13c0f84fb
@@ -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