예제 #1
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
float LibVarValue(char *var_name, char *value)
{
	libvar_t *v;

	v = LibVar(var_name, value);
	return v->value;
} //end of the function LibVarValue
예제 #2
0
//===========================================================================
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
char *LibVarString(char *var_name, char *value)
{
	libvar_t *v;

	v = LibVar(var_name, value);
	return v->string;
} //end of the function LibVarString
예제 #3
0
파일: ai_goal.cpp 프로젝트: janisl/jlquake
int BotSetupGoalAI( bool singleplayer ) {
	if ( GGameType & GAME_ET ) {
		g_singleplayer = singleplayer;
	} else {
		//check if teamplay is on
		g_gametype = LibVarValue( "g_gametype", "0" );
	}
	//item configuration file
	const char* filename = LibVarString( "itemconfig", "items.c" );
	if ( GGameType & GAME_ET ) {
		PS_SetBaseFolder( BOTFILESBASEFOLDER );
	}
	//load the item configuration
	itemconfig = LoadItemConfig( filename );
	if ( GGameType & GAME_ET ) {
		PS_SetBaseFolder( "" );
	}
	if ( !itemconfig ) {
		BotImport_Print( PRT_FATAL, "couldn't load item config\n" );
		return GGameType & GAME_Quake3 ? Q3BLERR_CANNOTLOADITEMCONFIG : WOLFBLERR_CANNOTLOADITEMCONFIG;
	}

	if ( GGameType & GAME_Quake3 ) {
		droppedweight = LibVar( "droppedweight", "1000" );
	}
	//everything went ok
	return BLERR_NOERROR;
}
예제 #4
0
//===========================================================================
// called when the library is first loaded
//
// Parameter:				-
// Returns:					-
// Changes Globals:		-
//===========================================================================
int AAS_Setup(void)
{
	aasworld.maxclients = (int) LibVarValue("maxclients", "128");
	aasworld.maxentities = (int) LibVarValue("maxentities", "1024");
	// as soon as it's set to 1 the routing cache will be saved
	saveroutingcache = LibVar("saveroutingcache", "0");
	//allocate memory for the entities
	if (aasworld.entities) FreeMemory(aasworld.entities);
	aasworld.entities = (aas_entity_t *) GetClearedHunkMemory(aasworld.maxentities * sizeof(aas_entity_t));
	//invalidate all the entities
	AAS_InvalidateEntities();
	//force some recalculations
	//LibVarSet("forceclustering", "1");			//force clustering calculation
	//LibVarSet("forcereachability", "1");		//force reachability calculation
	aasworld.numframes = 0;
	return BLERR_NOERROR;
} //end of the function AAS_Setup
예제 #5
0
/*
=======================================================================================================================================
LibVarValue
=======================================================================================================================================
*/
float LibVarValue(const char *var_name, const char *value) {
	libvar_t *v;

	v = LibVar(var_name, value);
	return v->value;
}
예제 #6
0
/*
=======================================================================================================================================
LibVarString
=======================================================================================================================================
*/
char *LibVarString(const char *var_name, const char *value) {
	libvar_t *v;

	v = LibVar(var_name, value);
	return v->string;
}