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

Method GetBotName

source/src/bot/botmanager.cpp:149–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149const char *CBotManager::GetBotName()
150{
151 const char *szOutput = NULL;
152 TMultiChoice<const char *> BotNameChoices;
153 short ChoiceVal;
154
155 for(int j=0;j<m_sBotNameCount;j++)
156 {
157 ChoiceVal = 50;
158
159 loopv(bots)
160 {
161 if (bots[i] && (!strcasecmp(bots[i]->name, m_szBotNames[j])))
162 {
163 ChoiceVal = 0;
164 break;
165 }
166 }
167
168 if (!strcasecmp(player1->name, m_szBotNames[j]))
169 ChoiceVal = 0;
170
171 if(ChoiceVal) BotNameChoices.Insert(m_szBotNames[j], ChoiceVal);
172 }
173
174 // Couldn't find a selection?
175 if (!BotNameChoices.GetSelection(szOutput))
176 szOutput = "Bot";
177
178 return szOutput;
179}
180
181void CBotManager::LoadBotTeamsFile()
182{

Callers 1

CreateBotMethod · 0.80

Calls 2

InsertMethod · 0.80
GetSelectionMethod · 0.80

Tested by

no test coverage detected