MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / AddAvailableItems

Method AddAvailableItems

ogsr_engine/xrGame/Inventory.cpp:1055–1088  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1053}
1054
1055void CInventory::AddAvailableItems(TIItemContainer& items_container, bool for_trade) const
1056{
1057 for (TIItemContainer::const_iterator it = m_ruck.begin(); m_ruck.end() != it; ++it)
1058 {
1059 PIItem pIItem = *it;
1060 if (!for_trade || pIItem->CanTrade())
1061 items_container.push_back(pIItem);
1062 }
1063
1064 if (m_bBeltUseful)
1065 {
1066 for (TIItemContainer::const_iterator it = m_belt.begin(); m_belt.end() != it; ++it)
1067 {
1068 PIItem pIItem = *it;
1069 if (!for_trade || pIItem->CanTrade())
1070 items_container.push_back(pIItem);
1071 }
1072 }
1073
1074 if (m_bSlotsUseful)
1075 {
1076 TISlotArr::const_iterator slot_it = m_slots.begin();
1077 TISlotArr::const_iterator slot_it_e = m_slots.end();
1078 for (; slot_it != slot_it_e; ++slot_it)
1079 {
1080 const CInventorySlot& S = *slot_it;
1081 if (S.m_pIItem && (!for_trade || S.m_pIItem->CanTrade()))
1082 {
1083 if (!S.m_bPersistent || S.m_pIItem->GetSlot() == GRENADE_SLOT)
1084 items_container.push_back(S.m_pIItem);
1085 }
1086 }
1087 }
1088}
1089
1090bool CInventory::isBeautifulForActiveSlot(CInventoryItem* pIItem)
1091{

Callers 3

ForEachInventoryItemsMethod · 0.45
UpdateListsMethod · 0.45
UpdateListsMethod · 0.45

Calls 5

beginMethod · 0.45
endMethod · 0.45
CanTradeMethod · 0.45
push_backMethod · 0.45
GetSlotMethod · 0.45

Tested by

no test coverage detected