X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fbot.qc;h=4d0d4cdff2ad2a03c954fb7e56ec3e30434f94ba;hp=cb83896c22317169767e72ca953da029a0852e47;hb=56252ee469551d3868252dc988baef7a6ca03d96;hpb=62d89c288f3a3e64665e52e7ed6e2dad4f11e9e4 diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index cb83896c22..4d0d4cdff2 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -145,21 +145,7 @@ void bot_think(entity this) void bot_setnameandstuff(entity this) { string readfile, s; - float file, tokens, prio; - - string bot_name, bot_model, bot_skin, bot_shirt, bot_pants; - string name, prefix, suffix; - - if(autocvar_g_campaign) - { - prefix = ""; - suffix = ""; - } - else - { - prefix = autocvar_bot_prefix; - suffix = autocvar_bot_suffix; - } + int file, tokens, prio; file = fopen(autocvar_bot_config_file, FILE_READ); @@ -230,6 +216,8 @@ void bot_setnameandstuff(entity this) fclose(file); } + string bot_name, bot_model, bot_skin, bot_shirt, bot_pants; + tokens = tokenizebyseparator(readfile, "\t"); if(argv(0) != "") bot_name = argv(0); else bot_name = "Bot"; @@ -288,13 +276,10 @@ void bot_setnameandstuff(entity this) setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants)); this.bot_preferredcolors = this.clientcolors; - // pick the name - if (autocvar_bot_usemodelnames) - name = bot_model; - else - name = bot_name; + string prefix = (autocvar_g_campaign ? "" : autocvar_bot_prefix); + string suffix = (autocvar_g_campaign ? "" : autocvar_bot_suffix); + string name = (autocvar_bot_usemodelnames ? bot_model : bot_name); - // number bots with identical names if (name == "") { name = ftos(etof(this)); @@ -302,6 +287,7 @@ void bot_setnameandstuff(entity this) } else { + // number bots with identical names int j = 0; FOREACH_CLIENT(IS_BOT_CLIENT(it), { if(it.cleanname == name)