static void G_Say_f (player_t *player, bool arg0, bool team) { char text[256]; player_t *p; if (gi.Cmd_Argc() < 2 && !arg0) return; if (G_CheckFlood(player)) return; if (!team) Com_sprintf(text, sizeof(text), "%s: ", player->pers.netname); else Com_sprintf(text, sizeof(text), "^B%s (team): ", player->pers.netname); if (arg0) { Q_strcat(text, gi.Cmd_Argv(0), sizeof(text)); Q_strcat(text, " ", sizeof(text)); Q_strcat(text, gi.Cmd_Args(), sizeof(text)); } else { const char *p = gi.Cmd_Args(); const char *token = Com_Parse(&p); Q_strcat(text, token, sizeof(text)); } Q_strcat(text, "\n", sizeof(text)); if (sv_dedicated->integer) gi.DPrintf("%s", text); p = NULL; while ((p = G_PlayerGetNextActiveHuman(p))) { if (team && p->pers.team != player->pers.team) continue; G_ClientPrintf(p, PRINT_CHAT, "%s", text); } }
static void G_Say_f (Player& player, bool arg0, bool team) { if (gi.Cmd_Argc() < 2 && !arg0) return; if (G_CheckFlood(player)) return; char text[256]; if (arg0) { Com_sprintf(text, sizeof(text), "%s %s", gi.Cmd_Argv(0), gi.Cmd_Args()); } else { Com_sprintf(text, sizeof(text), "%s", gi.Cmd_Args()); } /* strip quotes */ char* s = text; if (s[0] == '"' && s[strlen(s) - 1] == '"') { s[strlen(s) - 1] = '\0'; s++; } if (sv_dedicated->integer) { if (!team) gi.DPrintf("%s: %s\n", player.pers.netname, s); else gi.DPrintf("^B%s (team): %s\n", player.pers.netname, s); } Player* p = nullptr; while ((p = G_PlayerGetNextActiveHuman(p))) { if (team && p->getTeam() != player.getTeam()) continue; if (!team) G_ClientPrintf(*p, PRINT_CHAT, "%s: %s\n", player.pers.netname, s); else G_ClientPrintf(*p, PRINT_CHAT, "^B%s (team): %s\n", player.pers.netname, s); } }