maint(chat): use default game's behaviour

This commit is contained in:
FutureRave 2023-03-27 11:56:11 +01:00
parent a365878d87
commit ed72e4f6b8
No known key found for this signature in database
GPG Key ID: 22F9079C86CFAB31

View File

@ -8,24 +8,22 @@
static void notify_on_say(game::native::gentity_s* ent, int mode, const char* message)
{
const auto ent_num = ent->s.number;
game::native::Scr_AddString(message + 1); // First character has nothing to do with actual message
game::native::Scr_AddInt(mode);
game::native::Scr_AddEntityNum(ent_num, 0);
game::native::Scr_AddEntityNum(ent - game::native::g_entities, 0);
game::native::Scr_NotifyLevel(game::native::SL_GetString("say", 0), 3);
const auto* guid = game::native::mp::SV_GetGuid(ent_num);
const auto* name = game::native::mp::svs_clients[ent_num].name;
const auto* guid = game::native::mp::SV_GetGuid(ent - game::native::g_entities);
const auto* name = game::native::mp::svs_clients[ent - game::native::g_entities].name;
if (mode == 0)
{
game_log::g_log_printf("say;%s;%d;%s;%s\n", guid, ent_num, name, message + 1);
game_log::g_log_printf("say;%s;%d;%s;%s\n", guid, ent - game::native::g_entities, name, message);
}
else
{
game_log::g_log_printf("sayteam;%s;%d;%s;%s\n", guid, ent_num, name, message + 1);
game_log::g_log_printf("sayteam;%s;%d;%s;%s\n", guid, ent - game::native::g_entities, name, message);
}
}