diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c index f83de0be..446be087 100644 --- a/code/ui/ui_main.c +++ b/code/ui/ui_main.c @@ -1751,16 +1751,10 @@ static int UI_OwnerDrawWidth(int ownerDraw, float scale) { static void UI_DrawBotName(rectDef_t *rect, float scale, vec4_t color, int textStyle) { int value = uiInfo.botIndex; int game = trap_Cvar_VariableValue("g_gametype"); - const char *text = ""; + const char *text; if (game >= GT_TEAM) { - if (value >= uiInfo.characterCount) { - value = 0; - } text = uiInfo.characterList[value].name; } else { - if (value >= UI_GetNumBots()) { - value = 0; - } text = UI_GetBotNameByNumber(value); } Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle); @@ -2548,16 +2542,16 @@ static qboolean UI_BotName_HandleKey(int flags, float *special, int key) { value += select; if (game >= GT_TEAM) { - if (value >= uiInfo.characterCount + 2) { + if (value >= uiInfo.characterCount) { value = 0; } else if (value < 0) { - value = uiInfo.characterCount + 2 - 1; + value = uiInfo.characterCount - 1; } } else { - if (value >= UI_GetNumBots() + 2) { + if (value >= UI_GetNumBots()) { value = 0; } else if (value < 0) { - value = UI_GetNumBots() + 2 - 1; + value = UI_GetNumBots() - 1; } } uiInfo.botIndex = value;