Load list only once

This commit is contained in:
6arelyFuture 2022-04-20 11:38:17 +02:00
parent 68c28ce1c1
commit b5e4e30ba3
Signed by: Future
GPG Key ID: FA77F074E98D98A5

View File

@ -39,8 +39,11 @@ void load_bot_data() {
}
const char* sv_bot_name_random_stub() {
if (bot_names.empty()) {
static auto loaded = false;
if (bot_names.empty() && !loaded) {
load_bot_data();
loaded = true;
}
if (!bot_names.empty()) {
@ -60,6 +63,7 @@ int build_connect_string(char* buf, const char* connect_string,
auto clan_tag = "3arc"s;
for (const auto& [bot_name, tag] : bot_names) {
if (bot_name == name) {
// Found their clantag
clan_tag = tag;
break;
}