[iortcw] 40/89: All: Fix random bot not looking for bots by funname
Simon McVittie
smcv at debian.org
Fri Sep 8 10:44:23 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to tag 1.51b
in repository iortcw.
commit a391173a06cee3267c9bbdf64b35875a51553cbd
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Wed Jul 19 11:51:19 2017 -0400
All: Fix random bot not looking for bots by funname
---
MP/code/game/g_bot.c | 7 +++++--
SP/code/game/g_bot.c | 5 ++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/MP/code/game/g_bot.c b/MP/code/game/g_bot.c
index 6da033d..e9d7dab 100644
--- a/MP/code/game/g_bot.c
+++ b/MP/code/game/g_bot.c
@@ -194,7 +194,10 @@ int G_SelectRandomBotInfo( int team ) {
num = 0;
for ( n = 0; n < g_numBots ; n++ ) {
- value = Info_ValueForKey( g_botInfos[n], "name" );
+ value = Info_ValueForKey( g_botInfos[n], "funname" );
+ if ( !value[0] ) {
+ value = Info_ValueForKey( g_botInfos[n], "name" );
+ }
//
if ( G_CountBotPlayersByName( value, team ) == 0 ) {
selection[num++] = n;
@@ -579,7 +582,7 @@ static void G_AddBot( const char *name, int skill, const char *team, int delay )
Info_SetValueForKey( userinfo, "name", botname );
Info_SetValueForKey( userinfo, "rate", "25000" );
Info_SetValueForKey( userinfo, "snaps", "20" );
- Info_SetValueForKey( userinfo, "skill", va("%i", skill) );
+ Info_SetValueForKey( userinfo, "skill", va( "%i", skill ) );
Info_SetValueForKey( userinfo, "teampref", team );
if ( skill == 1 ) {
diff --git a/SP/code/game/g_bot.c b/SP/code/game/g_bot.c
index d32d5f4..3d7ef3c 100644
--- a/SP/code/game/g_bot.c
+++ b/SP/code/game/g_bot.c
@@ -195,7 +195,10 @@ int G_SelectRandomBotInfo( int team ) {
num = 0;
for ( n = 0; n < g_numBots ; n++ ) {
- value = Info_ValueForKey( g_botInfos[n], "name" );
+ value = Info_ValueForKey( g_botInfos[n], "funname" );
+ if ( !value[0] ) {
+ value = Info_ValueForKey( g_botInfos[n], "name" );
+ }
//
if ( G_CountBotPlayersByName( value, team ) == 0 ) {
selection[num++] = n;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list