Esempio n. 1
0
/*
==============
BotUpdateInfoConfigStrings
==============
*/
void BotUpdateInfoConfigStrings(void) {
	int i;
	char buf[MAX_INFO_STRING];

	//let bot_report 0 run once to clear strings
	if (bot_report.modificationCount != level.botReportModificationCount) {
		level.botReportModificationCount = bot_report.modificationCount;
	}
	else if (!bot_report.integer) {
		return;
	}

	for (i = 0; i < level.maxplayers; i++) {
		//
		if ( !botstates[i] || !botstates[i]->inuse )
			continue;
		//
		trap_GetConfigstring(CS_PLAYERS+i, buf, sizeof(buf));
		//if no config string or no name
		if (!strlen(buf) || !strlen(Info_ValueForKey(buf, "n")))
			continue;
		//
		if (!bot_report.integer) {
			trap_SetConfigstring(CS_BOTINFO+i, "");
		}
		else {
			BotSetInfoConfigString(botstates[i]);
		}
	}
}
Esempio n. 2
0
/*
==============
BotUpdateInfoConfigStrings
==============
*/
void BotUpdateInfoConfigStrings(void) {
	int i;
	char buf[MAX_INFO_STRING];

	for (i = 0; i < maxclients && i < MAX_CLIENTS; i++) {
		//
		if ( !botstates[i] || !botstates[i]->inuse )
			continue;
		//
		trap_GetConfigstring(CS_PLAYERS+i, buf, sizeof(buf));
		//if no config string or no name
		if (!strlen(buf) || !strlen(Info_ValueForKey(buf, "n")))
			continue;
		BotSetInfoConfigString(botstates[i]);
	}
}