diff --git a/src/game/client/econ/item_model_panel.cpp b/src/game/client/econ/item_model_panel.cpp index 558805a2051..29872ef7143 100644 --- a/src/game/client/econ/item_model_panel.cpp +++ b/src/game/client/econ/item_model_panel.cpp @@ -2754,12 +2754,18 @@ void CItemModelPanel::UpdateDescription( bool bIsToolTip /* = false */ ) // collection int fontHeight = surface()->GetFontTall( m_pFontAttribSmall ); - if ( ( line.unMetaType & (kDescLineFlag_Collection | kDescLineFlag_CollectionName | kDescLineFlag_CollectionCurrentItem ) ) != 0 && pCollectionNameTextImage && pCollectionListTextImage ) + if ( ( line.unMetaType & (kDescLineFlag_Collection | kDescLineFlag_CollectionName | kDescLineFlag_CollectionCurrentItem ) ) != 0 ) { bool bIsCollectionName = ( line.unMetaType & kDescLineFlag_CollectionName ) != 0; vgui::TextImage *pTextImage = bIsCollectionName ? pCollectionNameTextImage : pCollectionListTextImage; unsigned int &unCurrentCollectionTextStreamIndex = bIsCollectionName ? unCurrentCollectionNameTextStreamIndex : unCurrentCollectionListTextStreamIndex; + // If the UI does not display collection lootlist, skip the lines so color controls do not leak + if ( !pTextImage ) + { + continue; + } + bool bIsCurrentItem = ( line.unMetaType & kDescLineFlag_CollectionCurrentItem ) != 0; // use bg color as text color for current item for a better highlight Color col = bIsCurrentItem ? Color( 0, 0, 0, 255 ) : pScheme->GetColor( GetColorNameForAttribColor( line.eColor ), Color( 255, 255, 255, 255 ) );