]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/bot/default/bot.qc
Merge branch 'DefaultUser/more_damagetext' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qc
1 #include "bot.qh"
2
3 #include "cvars.qh"
4
5 #include "aim.qh"
6 #include "navigation.qh"
7 #include "scripting.qh"
8 #include "waypoints.qh"
9
10 #include "havocbot/havocbot.qh"
11 #include "havocbot/scripting.qh"
12
13 #include "../../teamplay.qh"
14
15 #include "../../antilag.qh"
16 #include "../../autocvars.qh"
17 #include "../../campaign.qh"
18 #include "../../client.qh"
19 #include "../../constants.qh"
20 #include "../../defs.qh"
21 #include "../../race.qh"
22 #include <common/t_items.qh>
23
24 #include "../../mutators/_mod.qh"
25
26 #include "../../weapons/accuracy.qh"
27
28 #include <common/physics/player.qh>
29 #include <common/constants.qh>
30 #include <common/net_linked.qh>
31 #include <common/mapinfo.qh>
32 #include <common/teams.qh>
33 #include <common/util.qh>
34
35 #include <server/scores_rules.qh>
36
37 #include <common/weapons/_all.qh>
38
39 #include <lib/csqcmodel/sv_model.qh>
40
41 #include <lib/warpzone/common.qh>
42 #include <lib/warpzone/util_server.qh>
43
44 entity bot_spawn()
45 {
46         entity bot = spawnclient();
47         if (bot)
48         {
49                 currentbots = currentbots + 1;
50                 bot_setnameandstuff(bot);
51                 ClientConnect(bot);
52                 PutClientInServer(bot);
53         }
54         return bot;
55 }
56
57 void bot_think(entity this)
58 {
59         if (this.bot_nextthink > time)
60                 return;
61
62         this.flags &= ~FL_GODMODE;
63         if(autocvar_bot_god)
64                 this.flags |= FL_GODMODE;
65
66         this.bot_nextthink = this.bot_nextthink + autocvar_bot_ai_thinkinterval * pow(0.5, this.bot_aiskill);
67         //if (this.bot_painintensity > 0)
68         //      this.bot_painintensity = this.bot_painintensity - (skill + 1) * 40 * frametime;
69
70         //this.bot_painintensity = this.bot_painintensity + this.bot_oldhealth - this.health;
71         //this.bot_painintensity = bound(0, this.bot_painintensity, 100);
72
73         if (!IS_PLAYER(this) || (autocvar_g_campaign && !campaign_bots_may_start))
74         {
75                 this.bot_nextthink = time + 0.5;
76                 return;
77         }
78
79         if (this.fixangle)
80         {
81                 this.v_angle = this.angles;
82                 this.v_angle_z = 0;
83                 this.fixangle = false;
84         }
85
86         this.dmg_take = 0;
87         this.dmg_save = 0;
88         this.dmg_inflictor = NULL;
89
90         // calculate an aiming latency based on the skill setting
91         // (simulated network latency + naturally delayed reflexes)
92         //this.ping = 0.7 - bound(0, 0.05 * skill, 0.5); // moved the reflexes to bot_aimdir (under the name 'think')
93         // minimum ping 20+10 random
94         this.ping = bound(0,0.07 - bound(0, (skill + this.bot_pingskill) * 0.005,0.05)+random()*0.01,0.65); // Now holds real lag to server, and higer skill players take a less laggy server
95         // skill 10 = ping 0.2 (adrenaline)
96         // skill 0 = ping 0.7 (slightly drunk)
97
98         // clear buttons
99         PHYS_INPUT_BUTTON_ATCK(this) = false;
100         PHYS_INPUT_BUTTON_JUMP(this) = false;
101         PHYS_INPUT_BUTTON_ATCK2(this) = false;
102         PHYS_INPUT_BUTTON_ZOOM(this) = false;
103         PHYS_INPUT_BUTTON_CROUCH(this) = false;
104         PHYS_INPUT_BUTTON_HOOK(this) = false;
105         PHYS_INPUT_BUTTON_INFO(this) = false;
106         PHYS_INPUT_BUTTON_DRAG(this) = false;
107         PHYS_INPUT_BUTTON_CHAT(this) = false;
108         PHYS_INPUT_BUTTON_USE(this) = false;
109
110         if (time < game_starttime)
111         {
112                 // block the bot during the countdown to game start
113                 this.movement = '0 0 0';
114                 this.bot_nextthink = game_starttime;
115                 return;
116         }
117
118         // if dead, just wait until we can respawn
119         if (IS_DEAD(this))
120         {
121                 if (this.deadflag == DEAD_DEAD)
122                 {
123                         PHYS_INPUT_BUTTON_JUMP(this) = true; // press jump to respawn
124                         this.bot_strategytime = 0;
125                 }
126         }
127         else if(this.aistatus & AI_STATUS_STUCK)
128                 navigation_unstuck(this);
129
130         // now call the current bot AI (havocbot for example)
131         this.bot_ai(this);
132 }
133
134 void bot_setnameandstuff(entity this)
135 {
136         string readfile, s;
137         float file, tokens, prio;
138
139         string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
140         string name, prefix, suffix;
141
142         if(autocvar_g_campaign)
143         {
144                 prefix = "";
145                 suffix = "";
146         }
147         else
148         {
149                 prefix = autocvar_bot_prefix;
150                 suffix = autocvar_bot_suffix;
151         }
152
153         file = fopen(autocvar_bot_config_file, FILE_READ);
154
155         if(file < 0)
156         {
157                 LOG_INFO(strcat("Error: Can not open the bot configuration file '",autocvar_bot_config_file,"'\n"));
158                 readfile = "";
159         }
160         else
161         {
162                 RandomSelection_Init();
163                 while((readfile = fgets(file)))
164                 {
165                         if(substring(readfile, 0, 2) == "//")
166                                 continue;
167                         if(substring(readfile, 0, 1) == "#")
168                                 continue;
169                         tokens = tokenizebyseparator(readfile, "\t");
170                         if(tokens == 0)
171                                 continue;
172                         s = argv(0);
173                         prio = 1;
174                         FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
175                                 if(s == it.cleanname)
176                                 {
177                                         prio = 0;
178                                         break;
179                                 }
180                         ));
181                         RandomSelection_AddString(readfile, 1, prio);
182                 }
183                 readfile = RandomSelection_chosen_string;
184                 fclose(file);
185         }
186
187         tokens = tokenizebyseparator(readfile, "\t");
188         if(argv(0) != "") bot_name = argv(0);
189         else bot_name = "Bot";
190
191         if(argv(1) != "") bot_model = argv(1);
192         else bot_model = "";
193
194         if(argv(2) != "") bot_skin = argv(2);
195         else bot_skin = "0";
196
197         if(argv(3) != "" && stof(argv(3)) >= 0) bot_shirt = argv(3);
198         else bot_shirt = ftos(floor(random() * 15));
199
200         if(argv(4) != "" && stof(argv(4)) >= 0) bot_pants = argv(4);
201         else bot_pants = ftos(floor(random() * 15));
202
203         this.bot_forced_team = stof(argv(5));
204
205         prio = 6;
206
207         #define READSKILL(f,w,r) if(argv(prio) != "") this.f = stof(argv(prio)) * (w); else this.f = (!autocvar_g_campaign) * (2 * random() - 1) * (r) * (w); ++prio
208         //print(bot_name, ": ping=", argv(9), "\n");
209
210         READSKILL(havocbot_keyboardskill, 0.5, 0.5); // keyboard skill
211         READSKILL(bot_moveskill, 2, 0); // move skill
212         READSKILL(bot_dodgeskill, 2, 0); // dodge skill
213
214         READSKILL(bot_pingskill, 0.5, 0); // ping skill
215
216         READSKILL(bot_weaponskill, 2, 0); // weapon skill
217         READSKILL(bot_aggresskill, 1, 0); // aggre skill
218         READSKILL(bot_rangepreference, 1, 0); // read skill
219
220         READSKILL(bot_aimskill, 2, 0); // aim skill
221         READSKILL(bot_offsetskill, 2, 0.5); // offset skill
222         READSKILL(bot_mouseskill, 1, 0.5); // mouse skill
223
224         READSKILL(bot_thinkskill, 1, 0.5); // think skill
225         READSKILL(bot_aiskill, 2, 0); // "ai" skill
226
227         this.bot_config_loaded = true;
228
229         // this is really only a default, JoinBestTeam is called later
230         setcolor(this, stof(bot_shirt) * 16 + stof(bot_pants));
231         this.bot_preferredcolors = this.clientcolors;
232
233         // pick the name
234         if (autocvar_bot_usemodelnames)
235                 name = bot_model;
236         else
237                 name = bot_name;
238
239         // number bots with identical names
240         int j = 0;
241         FOREACH_CLIENT(IS_BOT_CLIENT(it), LAMBDA(
242                 if(it.cleanname == name)
243                         ++j;
244         ));
245         if (j)
246                 this.netname = this.netname_freeme = strzone(strcat(prefix, name, "(", ftos(j), ")", suffix));
247         else
248                 this.netname = this.netname_freeme = strzone(strcat(prefix, name, suffix));
249
250         this.cleanname = strzone(name);
251
252         // pick the model and skin
253         if(substring(bot_model, -4, 1) != ".")
254                 bot_model = strcat(bot_model, ".iqm");
255         this.playermodel = this.playermodel_freeme = strzone(strcat("models/player/", bot_model));
256         this.playerskin = this.playerskin_freeme = strzone(bot_skin);
257
258         this.cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the NULL
259         this.cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
260 }
261
262 void bot_custom_weapon_priority_setup()
263 {
264         float tokens, i, w;
265
266         bot_custom_weapon = false;
267
268         if(     autocvar_bot_ai_custom_weapon_priority_far == "" ||
269                 autocvar_bot_ai_custom_weapon_priority_mid == "" ||
270                 autocvar_bot_ai_custom_weapon_priority_close == "" ||
271                 autocvar_bot_ai_custom_weapon_priority_distances == ""
272         )
273                 return;
274
275         // Parse distances
276         tokens = tokenizebyseparator(autocvar_bot_ai_custom_weapon_priority_distances," ");
277
278         if (tokens!=2)
279                 return;
280
281         bot_distance_far = stof(argv(0));
282         bot_distance_close = stof(argv(1));
283
284         if(bot_distance_far < bot_distance_close){
285                 bot_distance_far = stof(argv(1));
286                 bot_distance_close = stof(argv(0));
287         }
288
289         // Initialize list of weapons
290         bot_weapons_far[0] = -1;
291         bot_weapons_mid[0] = -1;
292         bot_weapons_close[0] = -1;
293
294         // Parse far distance weapon priorities
295         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_far)," ");
296
297         int c = 0;
298         for(i=0; i < tokens && c < Weapons_COUNT; ++i){
299                 w = stof(argv(i));
300                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
301                         bot_weapons_far[c] = w;
302                         ++c;
303                 }
304         }
305         if(c < Weapons_COUNT)
306                 bot_weapons_far[c] = -1;
307
308         // Parse mid distance weapon priorities
309         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_mid)," ");
310
311         c = 0;
312         for(i=0; i < tokens && c < Weapons_COUNT; ++i){
313                 w = stof(argv(i));
314                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
315                         bot_weapons_mid[c] = w;
316                         ++c;
317                 }
318         }
319         if(c < Weapons_COUNT)
320                 bot_weapons_mid[c] = -1;
321
322         // Parse close distance weapon priorities
323         tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_close)," ");
324
325         c = 0;
326         for(i=0; i < tokens && i < Weapons_COUNT; ++i){
327                 w = stof(argv(i));
328                 if ( w >= WEP_FIRST && w <= WEP_LAST) {
329                         bot_weapons_close[c] = w;
330                         ++c;
331                 }
332         }
333         if(c < Weapons_COUNT)
334                 bot_weapons_close[c] = -1;
335
336         bot_custom_weapon = true;
337 }
338
339 void bot_endgame()
340 {
341         entity e;
342         //dprint("bot_endgame\n");
343         e = bot_list;
344         while (e)
345         {
346                 setcolor(e, e.bot_preferredcolors);
347                 e = e.nextbot;
348         }
349         // if dynamic waypoints are ever implemented, save them here
350 }
351
352 void bot_relinkplayerlist()
353 {
354         player_count = 0;
355         currentbots = 0;
356         bot_list = NULL;
357
358         entity prevbot = NULL;
359         FOREACH_CLIENT(true,
360         {
361                 ++player_count;
362
363                 if(IS_BOT_CLIENT(it))
364                 {
365                         if(prevbot)
366                                 prevbot.nextbot = it;
367                         else
368                         {
369                                 bot_list = it;
370                                 bot_list.nextbot = NULL;
371                         }
372                         prevbot = it;
373                         ++currentbots;
374                 }
375         });
376         LOG_TRACE("relink: ", ftos(currentbots), " bots seen.");
377         bot_strategytoken = bot_list;
378         bot_strategytoken_taken = true;
379 }
380
381 void bot_clientdisconnect(entity this)
382 {
383         if (!IS_BOT_CLIENT(this))
384                 return;
385         bot_clearqueue(this);
386         if(this.cleanname)
387                 strunzone(this.cleanname);
388         if(this.netname_freeme)
389                 strunzone(this.netname_freeme);
390         if(this.playermodel_freeme)
391                 strunzone(this.playermodel_freeme);
392         if(this.playerskin_freeme)
393                 strunzone(this.playerskin_freeme);
394         this.cleanname = string_null;
395         this.netname_freeme = string_null;
396         this.playermodel_freeme = string_null;
397         this.playerskin_freeme = string_null;
398         if(this.bot_cmd_current)
399                 delete(this.bot_cmd_current);
400         if(bot_waypoint_queue_owner==this)
401                 bot_waypoint_queue_owner = NULL;
402 }
403
404 void bot_clientconnect(entity this)
405 {
406         if (!IS_BOT_CLIENT(this)) return;
407         this.bot_preferredcolors = this.clientcolors;
408         this.bot_nextthink = time - random();
409         this.lag_func = bot_lagfunc;
410         this.isbot = true;
411         this.createdtime = this.bot_nextthink;
412
413         if(!this.bot_config_loaded) // This is needed so team overrider doesn't break between matches
414                 bot_setnameandstuff(this);
415
416         if(this.bot_forced_team==1)
417                 this.team = NUM_TEAM_1;
418         else if(this.bot_forced_team==2)
419                 this.team = NUM_TEAM_2;
420         else if(this.bot_forced_team==3)
421                 this.team = NUM_TEAM_3;
422         else if(this.bot_forced_team==4)
423                 this.team = NUM_TEAM_4;
424         else
425                 JoinBestTeam(this, false, true);
426
427         havocbot_setupbot(this);
428 }
429
430 void bot_removefromlargestteam()
431 {
432         CheckAllowedTeams(NULL);
433         GetTeamCounts(NULL);
434
435         entity best = NULL;
436         float besttime = 0;
437         int bestcount = 0;
438
439         int bcount = 0;
440         FOREACH_CLIENT(it.isbot,
441         {
442                 ++bcount;
443
444                 if(!best)
445                 {
446                         best = it;
447                         besttime = it.createdtime;
448                 }
449
450                 int thiscount = 0;
451
452                 switch(it.team)
453                 {
454                         case NUM_TEAM_1: thiscount = c1; break;
455                         case NUM_TEAM_2: thiscount = c2; break;
456                         case NUM_TEAM_3: thiscount = c3; break;
457                         case NUM_TEAM_4: thiscount = c4; break;
458                 }
459
460                 if(thiscount > bestcount)
461                 {
462                         bestcount = thiscount;
463                         besttime = it.createdtime;
464                         best = it;
465                 }
466                 else if(thiscount == bestcount && besttime < it.createdtime)
467                 {
468                         besttime = it.createdtime;
469                         best = it;
470                 }
471         });
472         if(!bcount)
473                 return; // no bots to remove
474         currentbots = currentbots - 1;
475         dropclient(best);
476 }
477
478 void bot_removenewest()
479 {
480         if(teamplay)
481         {
482                 bot_removefromlargestteam();
483                 return;
484         }
485
486         float besttime = 0;
487         entity best = NULL;
488         int bcount = 0;
489
490         FOREACH_CLIENT(it.isbot,
491         {
492                 ++bcount;
493
494                 if(!best)
495                 {
496                         best = it;
497                         besttime = it.createdtime;
498                 }
499
500                 if(besttime < it.createdtime)
501                 {
502                         besttime = it.createdtime;
503                         best = it;
504                 }
505         });
506
507         if(!bcount)
508                 return; // no bots to remove
509
510         currentbots = currentbots - 1;
511         dropclient(best);
512 }
513
514 void autoskill(float factor)
515 {
516         float bestbot;
517         float bestplayer;
518
519         bestbot = -1;
520         bestplayer = -1;
521         FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
522                 if(IS_REAL_CLIENT(it))
523                         bestplayer = max(bestplayer, it.totalfrags - it.totalfrags_lastcheck);
524                 else
525                         bestbot = max(bestbot, it.totalfrags - it.totalfrags_lastcheck);
526         ));
527
528         LOG_TRACE("autoskill: best player got ", ftos(bestplayer), ", ");
529         LOG_TRACE("best bot got ", ftos(bestbot), "; ");
530         if(bestbot < 0 || bestplayer < 0)
531         {
532                 LOG_TRACE("not doing anything");
533                 // don't return, let it reset all counters below
534         }
535         else if(bestbot <= bestplayer * factor - 2)
536         {
537                 if(autocvar_skill < 17)
538                 {
539                         LOG_TRACE("2 frags difference, increasing skill");
540                         cvar_set("skill", ftos(autocvar_skill + 1));
541                         bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n");
542                 }
543         }
544         else if(bestbot >= bestplayer * factor + 2)
545         {
546                 if(autocvar_skill > 0)
547                 {
548                         LOG_TRACE("2 frags difference, decreasing skill");
549                         cvar_set("skill", ftos(autocvar_skill - 1));
550                         bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n");
551                 }
552         }
553         else
554         {
555                 LOG_TRACE("not doing anything");
556                 return;
557                 // don't reset counters, wait for them to accumulate
558         }
559
560         FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(it.totalfrags_lastcheck = it.totalfrags));
561 }
562
563 void bot_calculate_stepheightvec()
564 {
565         stepheightvec = autocvar_sv_stepheight * '0 0 1';
566         jumpstepheightvec = stepheightvec +
567                 ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85';
568                 // 0.75 factor is for safety to make the jumps easy
569 }
570
571 float bot_fixcount()
572 {
573         int activerealplayers = 0;
574         int realplayers = 0;
575         if (MUTATOR_CALLHOOK(Bot_FixCount, activerealplayers, realplayers)) {
576                 activerealplayers = M_ARGV(0, int);
577                 realplayers = M_ARGV(1, int);
578         } else {
579                 FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
580                         if(IS_PLAYER(it))
581                                 ++activerealplayers;
582                         ++realplayers;
583                 ));
584         }
585
586         int bots;
587         // add/remove bots if needed to make sure there are at least
588         // minplayers+bot_number, or remove all bots if no one is playing
589         // But don't remove bots immediately on level change, as the real players
590         // usually haven't rejoined yet
591         bots_would_leave = false;
592         if (teamplay && autocvar_bot_vs_human && AvailableTeams() == 2)
593                 bots = min(ceil(fabs(autocvar_bot_vs_human) * activerealplayers), maxclients - realplayers);
594         else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
595         {
596                 float realminplayers, minplayers;
597                 realminplayers = autocvar_minplayers;
598                 minplayers = max(0, floor(realminplayers));
599
600                 float realminbots, minbots;
601                 realminbots = autocvar_bot_number;
602                 minbots = max(0, floor(realminbots));
603
604                 bots = min(max(minbots, minplayers - activerealplayers), maxclients - realplayers);
605                 if(bots > minbots)
606                         bots_would_leave = true;
607         }
608         else
609         {
610                 // if there are no players, remove bots
611                 bots = 0;
612         }
613
614         // only add one bot per frame to avoid utter chaos
615         if(time > botframe_nextthink)
616         {
617                 //dprint(ftos(bots), " ? ", ftos(currentbots), "\n");
618                 while (currentbots < bots)
619                 {
620                         if (bot_spawn() == NULL)
621                         {
622                                 bprint("Can not add bot, server full.\n");
623                                 return false;
624                         }
625                 }
626                 while (currentbots > bots)
627                         bot_removenewest();
628         }
629
630         return true;
631 }
632
633 void bot_serverframe()
634 {
635         if (intermission_running)
636                 return;
637
638         if (time < 2)
639                 return;
640
641         bot_calculate_stepheightvec();
642         bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL);
643
644         if(time > autoskill_nextthink)
645         {
646                 float a;
647                 a = autocvar_skill_auto;
648                 if(a)
649                         autoskill(a);
650                 autoskill_nextthink = time + 5;
651         }
652
653         if(time > botframe_nextthink)
654         {
655                 if(!bot_fixcount())
656                         botframe_nextthink = time + 10;
657         }
658
659         bot_ignore_bots = autocvar_bot_ignore_bots;
660
661         if(botframe_spawnedwaypoints)
662         {
663                 if(autocvar_waypoint_benchmark)
664                         localcmd("quit\n");
665         }
666
667         if (currentbots > 0 || autocvar_g_waypointeditor || autocvar_g_waypointeditor_auto)
668         if (botframe_spawnedwaypoints)
669         {
670                 if(botframe_cachedwaypointlinks)
671                 {
672                         if(!botframe_loadedforcedlinks)
673                                 waypoint_load_links_hardwired();
674                 }
675                 else
676                 {
677                         // TODO: Make this check cleaner
678                         IL_EACH(g_waypoints, time - it.nextthink > 10,
679                         {
680                                 waypoint_save_links();
681                                 break;
682                         });
683                 }
684         }
685         else
686         {
687                 botframe_spawnedwaypoints = true;
688                 waypoint_loadall();
689                 if(!waypoint_load_links())
690                         waypoint_schedulerelinkall();
691         }
692
693         if (bot_list)
694         {
695                 // cycle the goal token from one bot to the next each frame
696                 // (this prevents them from all doing spawnfunc_waypoint searches on the same
697                 //  frame, which causes choppy framerates)
698                 if (bot_strategytoken_taken)
699                 {
700                         bot_strategytoken_taken = false;
701                         if (bot_strategytoken)
702                                 bot_strategytoken = bot_strategytoken.nextbot;
703                         if (!bot_strategytoken)
704                                 bot_strategytoken = bot_list;
705                 }
706
707                 if (botframe_nextdangertime < time)
708                 {
709                         float interval;
710                         interval = autocvar_bot_ai_dangerdetectioninterval;
711                         if (botframe_nextdangertime < time - interval * 1.5)
712                                 botframe_nextdangertime = time;
713                         botframe_nextdangertime = botframe_nextdangertime + interval;
714                         botframe_updatedangerousobjects(autocvar_bot_ai_dangerdetectionupdates);
715                 }
716         }
717
718         if (autocvar_g_waypointeditor)
719                 botframe_showwaypointlinks();
720
721         if (autocvar_g_waypointeditor_auto)
722                 botframe_autowaypoints();
723
724         if(time > bot_cvar_nextthink)
725         {
726                 if(currentbots>0)
727                         bot_custom_weapon_priority_setup();
728                 bot_cvar_nextthink = time + 5;
729         }
730 }