Stop caching sv_maxclients in bot code
This commit is contained in:
1 parent
d1631d6ea3
commit
74aa4268b2
5 files changed
+28
-83
No files matched your search
+4
-5
@@ -392,7 +392,7 @@ void BotTeamplayReport(void) {
|
||||
char buf[MAX_INFO_STRING];
|
||||
|
||||
BotAI_Print(PRT_MESSAGE, S_COLOR_RED"RED\n");
|
||||
for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
|
||||
for (i = 0; i < level.maxclients; i++) {
|
||||
//
|
||||
if ( !botstates[i] || !botstates[i]->inuse ) continue;
|
||||
//
|
||||
@@ -405,7 +405,7 @@ void BotTeamplayReport(void) {
|
||||
}
|
||||
}
|
||||
BotAI_Print(PRT_MESSAGE, S_COLOR_BLUE"BLUE\n");
|
||||
for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
|
||||
for (i = 0; i < level.maxclients; i++) {
|
||||
//
|
||||
if ( !botstates[i] || !botstates[i]->inuse ) continue;
|
||||
//
|
||||
@@ -546,7 +546,7 @@ void BotUpdateInfoConfigStrings(void) {
|
||||
int i;
|
||||
char buf[MAX_INFO_STRING];
|
||||
|
||||
for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
|
||||
for (i = 0; i < level.maxclients; i++) {
|
||||
//
|
||||
if ( !botstates[i] || !botstates[i]->inuse )
|
||||
continue;
|
||||
@@ -1597,8 +1597,7 @@ int BotInitLibrary(void) {
|
||||
char buf[144];
|
||||
|
||||
//set the maxclients and maxentities library variables before calling BotSetupLibrary
|
||||
trap_Cvar_VariableStringBuffer("sv_maxclients", buf, sizeof(buf));
|
||||
if (!strlen(buf)) strcpy(buf, "8");
|
||||
Com_sprintf(buf, sizeof(buf), "%d", level.maxclients);
|
||||
trap_BotLibVarSet("maxclients", buf);
|
||||
Com_sprintf(buf, sizeof(buf), "%d", MAX_GENTITIES);
|
||||
trap_BotLibVarSet("maxentities", buf);
|
||||
|
||||
Reference in new issue
Block a user