@@ -482,9 +482,13 @@ bool CUICellContainer::AddSimilar(CUICellItem* itm)
482482 return false ;
483483
484484 // Alundaio: Don't stack equipped items
485- const PIItem iitem = static_cast <PIItem>(itm->m_pData );
486- if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
487- return false ;
485+ extern int g_inv_highlight_equipped;
486+ if (g_inv_highlight_equipped)
487+ {
488+ const PIItem iitem = static_cast <PIItem>(itm->m_pData );
489+ if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
490+ return false ;
491+ }
488492 // -Alundaio
489493
490494 CUICellItem* i = FindSimilar (itm);
@@ -509,9 +513,13 @@ CUICellItem* CUICellContainer::FindSimilar(CUICellItem* itm)
509513 auto i = (CUICellItem*)it;
510514#endif
511515 // Alundaio: Don't stack equipped items
512- auto iitem = static_cast <PIItem>(i->m_pData );
513- if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
514- continue ;
516+ extern int g_inv_highlight_equipped;
517+ if (g_inv_highlight_equipped)
518+ {
519+ auto iitem = static_cast <PIItem>(i->m_pData );
520+ if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
521+ continue ;
522+ }
515523 // -Alundaio
516524
517525 if (i == itm)
@@ -831,8 +839,8 @@ void CUICellContainer::Draw()
831839 UI ().ClientToScreenScaled (drawLT, drawLT.x , drawLT.y );
832840
833841 const Fvector2 pts[6 ] = {{0 .0f , 0 .0f }, {1 .0f , 0 .0f }, {1 .0f , 1 .0f }, {0 .0f , 0 .0f }, {1 .0f , 1 .0f }, {0 .0f , 1 .0f }};
834- # define ty 1 .0f
835- # define tx 0 .25f
842+ constexpr auto ty = 1 .0f ;
843+ constexpr auto tx = 0 .25f ;
836844 const Fvector2 uvs[6 ] = {{0 .0f , 0 .0f }, {tx, 0 .0f }, {tx, ty}, {0 .0f , 0 .0f }, {tx, ty}, {0 .0f , ty}};
837845
838846 // calculate cell size in screen pixels
@@ -871,9 +879,13 @@ void CUICellContainer::Draw()
871879 else
872880 {
873881 // Alundaio: Highlight equipped items
874- PIItem iitem = static_cast <PIItem>(ui_cell.m_item ->m_pData );
875- if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
876- select_mode = 2 ;
882+ extern int g_inv_highlight_equipped;
883+ if (g_inv_highlight_equipped)
884+ {
885+ PIItem iitem = static_cast <PIItem>(ui_cell.m_item ->m_pData );
886+ if (iitem && iitem->m_pInventory && iitem->m_pInventory ->ItemFromSlot (iitem->BaseSlot ()) == iitem)
887+ select_mode = 2 ;
888+ }
877889 // -Alundaio
878890 }
879891 }
0 commit comments