game/shared/econ/econ_item_schema.cpp
CEconItemDefinition *CEconItemSchema::GetItemDefinitionMutable( int iItemIndex, bool bNoDefault )
{
#if defined(CLIENT_DLL) || defined(GAME_DLL)
#if !defined(CSTRIKE_DLL)
	AssertMsg( m_pDefaultItemDefinition, "No default item definition set up for item schema." );
#endif // CSTRIKE_DLL
#endif // defined(CLIENT_DLL) || defined(GAME_DLL)

	int iIndex = m_mapItems.Find( iItemIndex );
	if ( m_mapItems.IsValidIndex( iIndex ) )
		return m_mapItems[iIndex]; 

	if ( bNoDefault )
		return NULL;

	if ( m_pDefaultItemDefinition )
		return m_pDefaultItemDefinition;

#if !defined(CSTRIKE_DLL)
	// We shouldn't ever get down here, but all the same returning a valid pointer is very slightly
	// a better plan than returning an invalid pointer to code that won't check to see if it's valid.
	static CEconItemDefinition *s_pEmptyDefinition = CreateEconItemDefinition();
	return s_pEmptyDefinition;
#else
	return NULL;
#endif // CSTRIKE_DLL
}
//-----------------------------------------------------------------------------
// Purpose:	Gets an item definition for the specified definition index
// Input:	iItemIndex - The index of the desired definition.
// Output:	A pointer to the desired definition, or NULL if it is not found.
//-----------------------------------------------------------------------------
Gets an item definition for the specified definition index
Input: iItemIndex - The index of the desired definition.
Output:        A pointer to the desired definition, or NULL if it is not found.
Gets an item definition for the specified definition index Input : iItemIndex - The index of the desired definition . Output : A pointer to the desired definition or NULL if it is not found .
CEconItemDefinition *CEconItemSchema::GetItemDefinitionMutable( int iItemIndex, bool bNoDefault )
{
#if defined(CLIENT_DLL) || defined(GAME_DLL)
#if !defined(CSTRIKE_DLL)
	AssertMsg( m_pDefaultItemDefinition, "No default item definition set up for item schema." );
#endif 
#endif 
	int iIndex = m_mapItems.Find( iItemIndex );
	if ( m_mapItems.IsValidIndex( iIndex ) )
		return m_mapItems[iIndex]; 
	if ( bNoDefault )
		return NULL;
	if ( m_pDefaultItemDefinition )
		return m_pDefaultItemDefinition;
#if !defined(CSTRIKE_DLL)
	static CEconItemDefinition *s_pEmptyDefinition = CreateEconItemDefinition();
	return s_pEmptyDefinition;
#else
	return NULL;
#endif 
}
CEconItemDefinition * CEconItemSchema :: GetItemDefinitionMutable ( int iItemIndex , bool bNoDefault ) { #if defined ( CLIENT_DLL ) || defined ( GAME_DLL ) #if ! defined ( CSTRIKE_DLL ) AssertMsg ( m_pDefaultItemDefinition , " " ) ; #endif #endif int iIndex = m_mapItems . Find ( iItemIndex ) ; if ( m_mapItems . IsValidIndex ( iIndex ) ) return m_mapItems [ iIndex ] ; if ( bNoDefault ) return NULL ; if ( m_pDefaultItemDefinition ) return m_pDefaultItemDefinition ; #if ! defined ( CSTRIKE_DLL ) static CEconItemDefinition * s_pEmptyDefinition = CreateEconItemDefinition ( ) ; return s_pEmptyDefinition ; #else return NULL ; #endif }
Purpose:       Gets an item definition for the specified definition index
Input: iItemIndex - The index of the desired definition.
Purpose : Gets an item definition for the specified definition index Input : iItemIndex - The index of the desired definition .
// CSTRIKE_DLL // defined(CLIENT_DLL) || defined(GAME_DLL) // We shouldn't ever get down here, but all the same returning a valid pointer is very slightly // a better plan than returning an invalid pointer to code that won't check to see if it's valid. // CSTRIKE_DLL