Codechange: move client name in settings to std::string

This commit is contained in:
rubidium42
2021-04-27 22:02:40 +02:00
committed by rubidium42
parent 02fdb5b210
commit 16437b7c0d
11 changed files with 39 additions and 61 deletions

View File

@@ -717,14 +717,14 @@ DEF_CONSOLE_CMD(ConClientNickChange)
return true;
}
char *client_name = argv[2];
std::string client_name(argv[2]);
StrTrimInPlace(client_name);
if (!NetworkIsValidClientName(client_name)) {
IConsoleError("Cannot give a client an empty name");
return true;
}
if (!NetworkServerChangeClientName(client_id, client_name)) {
if (!NetworkServerChangeClientName(client_id, client_name.c_str())) {
IConsoleError("Cannot give a client a duplicate name");
}