X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fbot.qc;fp=qcsrc%2Fserver%2Fbot%2Fbot.qc;h=8d21757c2540155e21acaf358258e9958a35cc04;hp=fd9fe0a5d3f6ab01e88ad655f315515856d2cc82;hb=4d33f4a27b31e4ca38ac9e2067c83f53e2f2b6a1;hpb=c79bf0a725d8b1c024fd914455c7256f7c64df79 diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index fd9fe0a5d3..8d21757c25 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -132,7 +132,6 @@ void bot_setnameandstuff() {SELFPARAM(); string readfile, s; float file, tokens, prio; - entity p; string bot_name, bot_model, bot_skin, bot_shirt, bot_pants; string name, prefix, suffix; @@ -169,15 +168,13 @@ void bot_setnameandstuff() continue; s = argv(0); prio = 1; - FOR_EACH_CLIENT(p) - { - if(IS_BOT_CLIENT(p)) - if(s == p.cleanname) + FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA( + if(s == it.cleanname) { prio = 0; break; } - } + )); RandomSelection_Add(world, 0, readfile, 1, prio); } readfile = RandomSelection_chosen_string; @@ -237,16 +234,13 @@ void bot_setnameandstuff() name = bot_name; // number bots with identical names - float i; - i = 0; - FOR_EACH_CLIENT(p) - { - if(IS_BOT_CLIENT(p)) - if(p.cleanname == name) - ++i; - } - if (i) - self.netname = self.netname_freeme = strzone(strcat(prefix, name, "(", ftos(i), ")", suffix)); + int j = 0; + FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA( + if(it.cleanname == name) + ++j; + )); + if (j) + self.netname = self.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix)); else self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));