From d1f01919391908dac9444e71e7c3a075d561ead2 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Thu, 15 Dec 2022 10:48:13 +0100 Subject: [PATCH] chat: remove special character before sending notify --- src/client/component/notifies.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/component/notifies.cpp b/src/client/component/notifies.cpp index 7b8d853..93b1e2a 100644 --- a/src/client/component/notifies.cpp +++ b/src/client/component/notifies.cpp @@ -187,13 +187,15 @@ namespace notifies message.erase(message.begin()); } - scheduler::once([params, message, client_num] + scheduler::once([params, message, msg_index, client_num] { const scripting::entity level{*game::levelEntityId}; const auto player = scripting::call("getEntByNum", {client_num}).as(); + // Remove \x1F before sending the notify only if present + const auto notify_msg = msg_index ? message.substr(1) : message; - notify(level, params[0], {player, message}); - notify(player, params[0], {message}); + notify(level, params[0], {player, notify_msg}); + notify(player, params[0], {notify_msg}); game_log::g_log_printf("%s;%s;%i;%s;%s\n", params[0],