Delayed in-game bot adds. Fixed a small bug in the key

handling code for bot names.
This commit is contained in:
Andrei Drexler 2002-04-06 21:40:59 +00:00
parent 7babfd9999
commit 60aacdd152
2 changed files with 17 additions and 3 deletions

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.7 2002/04/06 21:40:59 makro
// Delayed in-game bot adds. Fixed a small bug in the key
// handling code for bot names.
//
// Revision 1.6 2002/03/10 22:10:10 makro // Revision 1.6 2002/03/10 22:10:10 makro
// no message // no message
// //
@ -130,6 +134,10 @@ extern vmCvar_t ui_bigFont;
extern vmCvar_t ui_serverStatusTimeOut; extern vmCvar_t ui_serverStatusTimeOut;
//Makro - cvar for player model display //Makro - cvar for player model display
extern vmCvar_t ui_RQ3_modelCommand; extern vmCvar_t ui_RQ3_modelCommand;
//Makro - team counts for the join menu
extern vmCvar_t ui_RQ3_teamCount1;
extern vmCvar_t ui_RQ3_teamCount2;
extern vmCvar_t ui_RQ3_numSpectators;
// //

View file

@ -5,6 +5,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.14 2002/04/06 21:40:59 makro
// Delayed in-game bot adds. Fixed a small bug in the key
// handling code for bot names.
//
// Revision 1.13 2002/04/03 17:38:09 makro // Revision 1.13 2002/04/03 17:38:09 makro
// Commented out another unused function // Commented out another unused function
// //
@ -2815,10 +2819,11 @@ static qboolean UI_BotName_HandleKey(int flags, float *special, int key) {
} }
} else { } else {
*/ */
if (value >= UI_GetNumBots() + 2) { //Makro - max value isn't UI_GetNumBots() + 2, it's just UI_GetNumBots()
if (value >= UI_GetNumBots()) {
value = 0; value = 0;
} else if (value < 0) { } else if (value < 0) {
value = UI_GetNumBots() + 2 - 1; value = UI_GetNumBots() - 1;
} }
// } // }
uiInfo.botIndex = value; uiInfo.botIndex = value;
@ -3691,7 +3696,8 @@ static void UI_RunMenuScript(char **args) {
//if (trap_Cvar_VariableValue("g_gametype") >= GT_TEAM) { //if (trap_Cvar_VariableValue("g_gametype") >= GT_TEAM) {
// trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", uiInfo.characterList[uiInfo.botIndex].name, uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") ); // trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", uiInfo.characterList[uiInfo.botIndex].name, uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") );
//} else { //} else {
trap_Cmd_ExecuteText( EXEC_APPEND, va("addbot %s %i %s\n", UI_GetBotNameByNumber(uiInfo.botIndex), uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") ); //Makro - don't add the bot instantly
trap_Cmd_ExecuteText( EXEC_APPEND, va("wait; addbot %s %i %s\n", UI_GetBotNameByNumber(uiInfo.botIndex), uiInfo.skillIndex+1, (uiInfo.redBlue == 0) ? "Red" : "Blue") );
//} //}
} else if (Q_stricmp(name, "addFavorite") == 0) { } else if (Q_stricmp(name, "addFavorite") == 0) {
if (ui_netSource.integer != AS_FAVORITES) { if (ui_netSource.integer != AS_FAVORITES) {