From: terencehill Date: Fri, 29 Jun 2018 10:03:06 +0000 (+0200) Subject: Assign entity number as name to bots without name (when bot_config_file is "") X-Git-Tag: xonotic-v0.8.5~1970 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f5671cc83476b1812ec6b113793e4b39f597c2b0;p=xonotic%2Fxonotic-data.pk3dir.git Assign entity number as name to bots without name (when bot_config_file is "") --- 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