From 9e1dc59ed8eac6a8a5c3ed4b0152da40a9b3be78 Mon Sep 17 00:00:00 2001 From: TimePath Date: Thu, 5 Apr 2018 21:58:48 +1000 Subject: [PATCH] Chat: store messages in buffer --- qcsrc/menu/command/notice.qc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qcsrc/menu/command/notice.qc b/qcsrc/menu/command/notice.qc index 51ed0d3c6..ba8dc327b 100644 --- a/qcsrc/menu/command/notice.qc +++ b/qcsrc/menu/command/notice.qc @@ -4,6 +4,13 @@ noref string autocvar__cl_hook_print = "menu_cmd notice"; +int notice_buffer; +int notice_buffer_idx; + +STATIC_INIT(notice_buffer) { + notice_buffer = buf_create(); +} + GENERIC_COMMAND(notice, "Append a notice to chat") { switch(request) @@ -18,6 +25,7 @@ GENERIC_COMMAND(notice, "Append a notice to chat") entity snd = (flags & NOTICE_PRIVATE) ? SND_TALK2 : SND_TALK; localsound(Sound_fixpath(snd)); } + bufstr_set(notice_buffer, notice_buffer_idx++, s); print(prefix, "^7", s, "\n"); return; } -- 2.39.2