Skip to content

Commit 9c33af5

Browse files
committed
simplify algorithm again
1 parent f1f3d7c commit 9c33af5

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/game/server/hl2mp/bot/hl2mp_bot.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ const char *DifficultyLevelToString( CHL2MPBot::DifficultyType skill )
105105

106106

107107
#ifdef BDSBASE
108-
CUtlVector<string_t> m_botScriptNames;
109-
110-
void LoadBotNames(void)
108+
const char* GetRandomBotName(void)
111109
{
110+
CUtlVector<string_t> m_botScriptNames;
111+
112112
m_botScriptNames.RemoveAll();
113113

114114
KeyValues* pKV = new KeyValues("BotNames");
@@ -126,10 +126,7 @@ void LoadBotNames(void)
126126
}
127127

128128
pKV->deleteThis();
129-
}
130129

131-
const char* GetRandomBotName(void)
132-
{
133130
if (m_botScriptNames.Count() == 0)
134131
return "Bot Name";
135132

src/game/server/tf/bot/tf_bot.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ const char *DifficultyLevelToString( CTFBot::DifficultyType skill )
146146
}
147147

148148
#ifdef BDSBASE
149-
CUtlVector<string_t> m_botScriptNames;
150-
151-
void LoadBotNames(void)
149+
const char *GetRandomBotName(void)
152150
{
151+
CUtlVector<string_t> m_botScriptNames;
152+
153153
m_botScriptNames.RemoveAll();
154154

155155
KeyValues* pKV = new KeyValues("BotNames");
@@ -167,10 +167,7 @@ void LoadBotNames(void)
167167
}
168168

169169
pKV->deleteThis();
170-
}
171170

172-
const char *GetRandomBotName(void)
173-
{
174171
if (m_botScriptNames.Count() == 0)
175172
return "Bot Name";
176173

@@ -347,9 +344,6 @@ void CreateBotName( int iTeam, int iClassIndex, CTFBot::DifficultyType skill, ch
347344
}
348345
else
349346
{
350-
#ifdef BDSBASE
351-
LoadBotNames();
352-
#endif
353347
pBotName = GetRandomBotName();
354348
}
355349

0 commit comments

Comments
 (0)