game/shared/econ/econ_item_schema.cpp
KeyValues* CEconLootListDefinition::GenerateKeyValues() const
{
	KeyValues* pLootListKV = new KeyValues( m_pszName );

	// Write out our items and weights.
	FOR_EACH_VEC( m_ItemEntries, i )
	{
		const CEconItemDefinition* pItemDef = GetItemSchema()->GetItemDefinition( m_ItemEntries[i].m_nItemDef );
		if ( !pItemDef )
			continue;
		pLootListKV->SetFloat( pItemDef->GetRawDefinition()->GetString( "name" ), m_flWeights[i] );
	}

	// Write out additional drops.

	// Write out random attributes.

	return pLootListKV;
}
//-----------------------------------------------------------------------------
// Outputs a keyvalues schema representation of this loot list.
//-----------------------------------------------------------------------------
Outputs a keyvalues schema representation of this loot list.
Outputs a keyvalues schema representation of this loot list .
KeyValues* CEconLootListDefinition::GenerateKeyValues() const
{
	KeyValues* pLootListKV = new KeyValues( m_pszName );
	FOR_EACH_VEC( m_ItemEntries, i )
	{
		const CEconItemDefinition* pItemDef = GetItemSchema()->GetItemDefinition( m_ItemEntries[i].m_nItemDef );
		if ( !pItemDef )
			continue;
		pLootListKV->SetFloat( pItemDef->GetRawDefinition()->GetString( "name" ), m_flWeights[i] );
	}
	return pLootListKV;
}
KeyValues * CEconLootListDefinition :: GenerateKeyValues ( ) const { KeyValues * pLootListKV = new KeyValues ( m_pszName ) ; FOR_EACH_VEC ( m_ItemEntries , i ) { const CEconItemDefinition * pItemDef = GetItemSchema ( ) -> GetItemDefinition ( m_ItemEntries [ i ] . m_nItemDef ) ; if ( ! pItemDef ) continue ; pLootListKV -> SetFloat ( pItemDef -> GetRawDefinition ( ) -> GetString ( " " ) , m_flWeights [ i ] ) ; } return pLootListKV ; }
Outputs a keyvalues schema representation of this loot list.
Outputs a keyvalues schema representation of this loot list .
// Write out our items and weights. // Write out additional drops. // Write out random attributes.