int *WeaponWeightIndex(weightconfig_t *wwc, weaponconfig_t *wc) { int *index, i; //initialize item weight index index = (int *) GetClearedMemory(sizeof(int) * wc->numweapons); for (i = 0; i < wc->numweapons; i++) { index[i] = FindFuzzyWeight(wwc, wc->weaponinfo[i].name); } return index; }
// index to find the weight function of an iteminfo static int* ItemWeightIndex( weightconfig_t* iwc, itemconfig_t* ic ) { //initialize item weight index int* index = ( int* )Mem_ClearedAlloc( sizeof ( int ) * ic->numiteminfo ); for ( int i = 0; i < ic->numiteminfo; i++ ) { index[ i ] = FindFuzzyWeight( iwc, ic->iteminfo[ i ].classname ); if ( index[ i ] < 0 ) { Log_Write( "item info %d \"%s\" has no fuzzy weight\r\n", i, ic->iteminfo[ i ].classname ); } //end if } //end for return index; }
//=========================================================================== // index to find the weight function of an iteminfo // // Parameter: - // Returns: - // Changes Globals: - //=========================================================================== int *ItemWeightIndex( weightconfig_t *iwc, itemconfig_t *ic ) { int *index, i; //initialize item weight index index = (int *) GetClearedMemory( sizeof( int ) * ic->numiteminfo ); for ( i = 0; i < ic->numiteminfo; i++ ) { index[i] = FindFuzzyWeight( iwc, ic->iteminfo[i].classname ); if ( index[i] < 0 ) { Log_Write( "item info %d \"%s\" has no fuzzy weight\r\n", i, ic->iteminfo[i].classname ); } //end if } //end for return index; } //end of the function ItemWeightIndex