From daa604ae9bac6e409c1ac72227caea4b4d90de4d Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 12 Jan 2015 20:54:10 -0600 Subject: [PATCH] Fix parsing bots in arena info with trailing spaces q3_ui would shown bot at index of number of bots in list. game would send empty name to addbot command and command would think skill (i.e., 2.000000) was the bot name. --- code/game/g_bot.c | 2 +- code/q3_ui/ui_splevel.c | 2 +- code/q3_ui/ui_startserver.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/g_bot.c b/code/game/g_bot.c index 9b7714a595..6cc3917857 100644 --- a/code/game/g_bot.c +++ b/code/game/g_bot.c @@ -817,7 +817,7 @@ static void G_SpawnBots( char *botList, int baseDelay ) { while( *p && *p == ' ' ) { p++; } - if( !p ) { + if( !*p ) { break; } diff --git a/code/q3_ui/ui_splevel.c b/code/q3_ui/ui_splevel.c index e98986651e..d916a53627 100644 --- a/code/q3_ui/ui_splevel.c +++ b/code/q3_ui/ui_splevel.c @@ -183,7 +183,7 @@ static void UI_SPLevelMenu_SetBots( void ) { while( *p && *p == ' ' ) { p++; } - if( !p ) { + if( !*p ) { break; } diff --git a/code/q3_ui/ui_startserver.c b/code/q3_ui/ui_startserver.c index e8fe7d6fc8..cb09a3b492 100644 --- a/code/q3_ui/ui_startserver.c +++ b/code/q3_ui/ui_startserver.c @@ -1076,7 +1076,7 @@ static void ServerOptions_InitBotNames( void ) { while( *p && *p == ' ' ) { p++; } - if( !p ) { + if( !*p ) { break; }