src/obj-tval.c
int tval_sval_count(const char *name)
{
	size_t i, num = 0;
	int tval = tval_find_idx(name);

	if (tval < 0) return 0;

	for (i = 0; i < z_info->k_max; i++) {
		struct object_kind *kind = &k_info[i];

		if (!kind->tval) continue;
		if (kind->tval != tval) continue;
		num++;
	}

	return num;
}
/**
 * Counts the svals (from object.txt) of a given non-null tval
 */
Counts the svals (from object.txt) of a given non-null tval
Counts the svals ( from object . txt ) of a given non - null tval
int tval_sval_count(const char *name)
{
	size_t i, num = 0;
	int tval = tval_find_idx(name);
	if (tval < 0) return 0;
	for (i = 0; i < z_info->k_max; i++) {
		struct object_kind *kind = &k_info[i];
		if (!kind->tval) continue;
		if (kind->tval != tval) continue;
		num++;
	}
	return num;
}
int tval_sval_count ( const char * name ) { size_t i , num = 0 ; int tval = tval_find_idx ( name ) ; if ( tval < 0 ) return 0 ; for ( i = 0 ; i < z_info -> k_max ; i ++ ) { struct object_kind * kind = & k_info [ i ] ; if ( ! kind -> tval ) continue ; if ( kind -> tval != tval ) continue ; num ++ ; } return num ; }
Counts the svals (from object.txt) of a given non-null tval
Counts the svals ( from object . txt ) of a given non - null tval