Exemplo n.º 1
0
static void CG_LoadWeapons_f( void ) {
	int i;

	for( i = WP_KNIFE; i < WP_NUM_WEAPONS; i++ ) {
		// DHM - Nerve :: Only register weapons we use in WolfMP
		if( BG_WeaponInWolfMP( i ) )
			CG_RegisterWeapon( i, qtrue );
	}	
}
Exemplo n.º 2
0
/*
===============
SaveRegisteredItems

Write the needed items to a config string
so the client will know which ones to precache
===============
*/
void SaveRegisteredItems( void ) {
	char string[MAX_ITEMS + 1];
	int i;
	int count;

	count = 0;
	for ( i = 0 ; i < bg_numItems ; i++ ) {
		if ( itemRegistered[i] ) {
			count++;
			string[i] = '1';
		} else {
			string[i] = '0';
		}

		// DHM - Nerve :: Make sure and register all weapons we use in WolfMP
		if ( g_gametype.integer >= GT_WOLF && string[i] == '0' && bg_itemlist[i].giType == IT_WEAPON && BG_WeaponInWolfMP( bg_itemlist[i].giTag ) ) {
			count++;
			string[i] = '1';
		}
	}
	string[ bg_numItems ] = 0;

	if ( trap_Cvar_VariableIntegerValue( "g_gametype" ) != GT_SINGLE_PLAYER ) {
		G_Printf( "%i items registered\n", count );
	}
	trap_SetConfigstring( CS_ITEMS, string );
}