| 787 | } |
| 788 | |
| 789 | int CDataFileReader::GetExternalItemType(int InternalType, CUuid *pUuid) |
| 790 | { |
| 791 | if(InternalType <= OFFSET_UUID_TYPE || InternalType == ITEMTYPE_EX) |
| 792 | { |
| 793 | if(pUuid) |
| 794 | { |
| 795 | *pUuid = UUID_ZEROED; |
| 796 | } |
| 797 | return InternalType; |
| 798 | } |
| 799 | |
| 800 | const int TypeIndex = FindItemIndex(ITEMTYPE_EX, InternalType); |
| 801 | if(TypeIndex < 0 || GetItemSize(TypeIndex) < (int)sizeof(CItemEx)) |
| 802 | { |
| 803 | if(pUuid) |
| 804 | { |
| 805 | *pUuid = UUID_ZEROED; |
| 806 | } |
| 807 | return InternalType; |
| 808 | } |
| 809 | |
| 810 | const CItemEx *pItemEx = static_cast<const CItemEx *>(GetItem(TypeIndex)); |
| 811 | const CUuid Uuid = pItemEx->ToUuid(); |
| 812 | if(pUuid) |
| 813 | { |
| 814 | *pUuid = Uuid; |
| 815 | } |
| 816 | // Propagate UUID_UNKNOWN, it doesn't hurt. |
| 817 | return g_UuidManager.LookupUuid(Uuid); |
| 818 | } |
| 819 | |
| 820 | int CDataFileReader::GetInternalItemType(int ExternalType) |
| 821 | { |
no test coverage detected