MCPcopy Create free account
hub / github.com/assaultcube/AC / togglebotview

Function togglebotview

source/src/bot/botmanager.cpp:1044–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1042COMMAND(kickallbots, "");
1043
1044void togglebotview(char *bot)
1045{
1046 if(!botmode()) return;
1047 /**
1048 Disable in arena modes, this command causes the game to go in an "infinite loop"
1049 due to player1 automatically suiciding thus causing a new round to begin.
1050 */
1051 if(m_arena) { conoutf("togglebotview is not allowed in %s", modestr(gamemode, modeacronyms > 0)); return; }
1052 if (BotManager.m_pBotToView)
1053 BotManager.DisableBotView();
1054 else if (bot && *bot)
1055 {
1056 loopv(bots)
1057 {
1058 if (!bots[i]) continue;
1059
1060 if (!strcmp(bots[i]->name, bot))
1061 {
1062 BotManager.EnableBotView(bots[i]);
1063 break;
1064 }
1065 }
1066 }
1067}
1068
1069COMMAND(togglebotview, "s");
1070

Callers

nothing calls this directly

Calls 4

botmodeFunction · 0.85
modestrFunction · 0.85
DisableBotViewMethod · 0.80
conoutfFunction · 0.50

Tested by

no test coverage detected