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

Function kickbot

source/src/bot/botmanager.cpp:995–1021  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

993COMMAND(idlebots, "i");
994
995void kickbot(const char *szName)
996{
997 if(!botmode()) return;
998 if (!szName || !(*szName))
999 return;
1000
1001 int iBotInd = -1;
1002 loopv(bots)
1003 {
1004 if (!bots[i]) continue;
1005
1006 if (!strcmp(bots[i]->name, szName))
1007 {
1008 iBotInd = i;
1009 break;
1010 }
1011 }
1012
1013 if (iBotInd != -1)
1014 {
1015 botent *d = bots[iBotInd];
1016 if(d->name[0]) conoutf("bot %s disconnected", d->name);
1017 delete d->pBot;
1018 bots.remove(iBotInd);
1019 freebotent(d);
1020 }
1021}
1022
1023COMMAND(kickbot, "s");
1024

Callers

nothing calls this directly

Calls 4

botmodeFunction · 0.85
freebotentFunction · 0.85
conoutfFunction · 0.50
removeMethod · 0.45

Tested by

no test coverage detected