File tree Expand file tree Collapse file tree 2 files changed +6
-32
lines changed
Expand file tree Collapse file tree 2 files changed +6
-32
lines changed Original file line number Diff line number Diff line change @@ -131,23 +131,10 @@ void LoadBotNames(void)
131131const char * GetRandomBotName (void )
132132{
133133 if (m_botScriptNames.Count () == 0 )
134- return " MISSINGNO " ;
134+ return " Bot Name " ;
135135
136- int iStartIndex = rand () % m_botScriptNames.Count ();
137-
138- for (int i = 0 ; i < m_botScriptNames.Count (); ++i)
139- {
140- int index = i + iStartIndex;
141-
142- if (index >= m_botScriptNames.Count ())
143- index -= m_botScriptNames.Count ();
144-
145- string_t iszName = m_botScriptNames[index];
146-
147- return STRING (iszName);
148- }
149-
150- return " Bot Name" ;
136+ string_t iszName = m_botScriptNames.Random ();
137+ return STRING (iszName);
151138}
152139#else
153140// -----------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -172,23 +172,10 @@ void LoadBotNames(void)
172172const char *GetRandomBotName (void )
173173{
174174 if (m_botScriptNames.Count () == 0 )
175- return " MISSINGNO " ;
175+ return " Bot Name " ;
176176
177- int iStartIndex = rand () % m_botScriptNames.Count ();
178-
179- for (int i = 0 ; i < m_botScriptNames.Count (); ++i)
180- {
181- int index = i + iStartIndex;
182-
183- if (index >= m_botScriptNames.Count ())
184- index -= m_botScriptNames.Count ();
185-
186- string_t iszName = m_botScriptNames[index];
187-
188- return STRING (iszName);
189- }
190-
191- return " Bot Name" ;
177+ string_t iszName = m_botScriptNames.Random ();
178+ return STRING (iszName);
192179}
193180#else
194181// -----------------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments