Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

Commit 9f2b7f4

Browse files
committed
wa
1 parent 3dc3e1e commit 9f2b7f4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

code/__HELPERS/_lists.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
#define UNSETEMPTY(L) if (L && !length(L)) L = null
5555
///If the provided key -> list is empty, remove it from the list
5656
#define ASSOC_UNSETEMPTY(L, K) if (!length(L[K])) L -= K;
57+
///Use LAZYLISTDUPLICATE instead if you want it to null with no entries
58+
#define LAZYCOPY(L) (L ? L.Copy() : list() )
59+
///Like LAZYCOPY - copies an input list if the list has entries, If it doesn't the assigned list is nulled
60+
#define LAZYLISTDUPLICATE(L) (L ? L.Copy() : null )
5761
///Remove an item from the list, set the list to null if empty
5862
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!length(L)) { L = null; } }
5963
///Add an item to the list, if the list is null it will initialize it

code/game/objects/items/devices/radio/radio.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ GLOBAL_LIST_INIT(channel_tokens, list(
256256
spans = list(talking_movable.speech_span)
257257
if(!language)
258258
language = talking_movable.get_selected_language()
259-
INVOKE_ASYNC(src, .proc/talk_into_impl, talking_movable, message, channel, spans.Copy(), language, message_mods)
259+
INVOKE_ASYNC(src, PROC_REF(talk_into_impl), talking_movable, message, channel, LAZYLISTDUPLICATE(spans), language, LAZYLISTDUPLICATE(message_mods))
260260
return ITALICS | REDUCE_RANGE
261261

262262
/obj/item/radio/proc/talk_into_impl(atom/movable/talking_movable, message, channel, list/spans, datum/language/language, list/message_mods)

0 commit comments

Comments
 (0)