game/shared/econ/econ_item_schema.cpp
void CEconItemSchema::ItemTesting_CreateTestDefinition( int iCloneFromItemDef, int iNewDef, KeyValues *pNewKV )
{
	int nMapIndex = m_mapItems.Find( iNewDef );
	if ( !m_mapItems.IsValidIndex( nMapIndex ) )
	{
		nMapIndex = m_mapItems.Insert( iNewDef, CreateEconItemDefinition() );
		m_mapItemsSorted.Insert( iNewDef, m_mapItems[nMapIndex] );
	}

	// Find & copy the clone item def's data in
	const CEconItemDefinition *pCloneDef = GetItemDefinition( iCloneFromItemDef );
	if ( !pCloneDef )
		return;
	m_mapItems[nMapIndex]->CopyPolymorphic( pCloneDef );

	// Then stomp it with the KV test contents
	m_mapItems[nMapIndex]->BInitFromTestItemKVs( iNewDef, pNewKV, *this );
}
//-----------------------------------------------------------------------------
// Purpose:	Clones the specified item definition, and returns the new item def.
//-----------------------------------------------------------------------------
Clones the specified item definition, and returns the new item def.
Clones the specified item definition and returns the new item def .
void CEconItemSchema::ItemTesting_CreateTestDefinition( int iCloneFromItemDef, int iNewDef, KeyValues *pNewKV )
{
	int nMapIndex = m_mapItems.Find( iNewDef );
	if ( !m_mapItems.IsValidIndex( nMapIndex ) )
	{
		nMapIndex = m_mapItems.Insert( iNewDef, CreateEconItemDefinition() );
		m_mapItemsSorted.Insert( iNewDef, m_mapItems[nMapIndex] );
	}
	const CEconItemDefinition *pCloneDef = GetItemDefinition( iCloneFromItemDef );
	if ( !pCloneDef )
		return;
	m_mapItems[nMapIndex]->CopyPolymorphic( pCloneDef );
	m_mapItems[nMapIndex]->BInitFromTestItemKVs( iNewDef, pNewKV, *this );
}
void CEconItemSchema :: ItemTesting_CreateTestDefinition ( int iCloneFromItemDef , int iNewDef , KeyValues * pNewKV ) { int nMapIndex = m_mapItems . Find ( iNewDef ) ; if ( ! m_mapItems . IsValidIndex ( nMapIndex ) ) { nMapIndex = m_mapItems . Insert ( iNewDef , CreateEconItemDefinition ( ) ) ; m_mapItemsSorted . Insert ( iNewDef , m_mapItems [ nMapIndex ] ) ; } const CEconItemDefinition * pCloneDef = GetItemDefinition ( iCloneFromItemDef ) ; if ( ! pCloneDef ) return ; m_mapItems [ nMapIndex ] -> CopyPolymorphic ( pCloneDef ) ; m_mapItems [ nMapIndex ] -> BInitFromTestItemKVs ( iNewDef , pNewKV , * this ) ; }
Purpose:       Clones the specified item definition, and returns the new item def.
Purpose : Clones the specified item definition and returns the new item def .
// Find & copy the clone item def's data in // Then stomp it with the KV test contents