Merge pull request #554 from diamante0018/develop

chat: remove special character before sending notify
This commit is contained in:
Edo 2022-12-15 15:59:32 +01:00 committed by GitHub
commit 22ef197fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<scripting::entity>();
// 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],