| 1053 | } |
| 1054 | |
| 1055 | void 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 | |
| 1090 | bool CInventory::isBeautifulForActiveSlot(CInventoryItem* pIItem) |
| 1091 | { |