From f5671cc83476b1812ec6b113793e4b39f597c2b0 Mon Sep 17 00:00:00 2001 From: terencehill Date: Fri, 29 Jun 2018 12:03:06 +0200 Subject: [PATCH] Assign entity number as name to bots without name (when bot_config_file is "") --- qcsrc/server/bot/default/bot.qc | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index 2c5627bf6..08d16a71f 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -249,16 +249,23 @@ void bot_setnameandstuff(entity this) name = bot_name; // number bots with identical names - int j = 0; - FOREACH_CLIENT(IS_BOT_CLIENT(it), { - if(it.cleanname == name) - ++j; - }); - if (j) - this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix)); - else + if (name == "") + { + name = ftos(etof(this)); this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix)); - + } + else + { + int j = 0; + FOREACH_CLIENT(IS_BOT_CLIENT(it), { + if(it.cleanname == name) + ++j; + }); + if (j) + this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix)); + else + this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix)); + } this.cleanname = strzone(name); // pick the model and skin -- 2.39.2