Counts together the space that is neither accessible through m_objectMap nor through the free items
| 895 | |
| 896 | //Counts together the space that is neither accessible through m_objectMap nor through the free items |
| 897 | uint lostSpace() |
| 898 | { |
| 899 | if (m_monsterBucketExtent) |
| 900 | return 0; |
| 901 | |
| 902 | uint need = ItemRepositoryBucketSize - m_available; |
| 903 | uint found = 0; |
| 904 | |
| 905 | for (uint a = 0; a < ObjectMapSize; ++a) { |
| 906 | uint currentIndex = m_objectMap[a]; |
| 907 | while (currentIndex) { |
| 908 | found += reinterpret_cast<const Item*>(m_data + currentIndex)->itemSize() + AdditionalSpacePerItem; |
| 909 | |
| 910 | currentIndex = followerIndex(currentIndex); |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | uint currentIndex = m_largestFreeItem; |
| 915 | while (currentIndex) { |
| 916 | found += freeSize(currentIndex) + AdditionalSpacePerItem; |
| 917 | |
| 918 | currentIndex = followerIndex(currentIndex); |
| 919 | } |
| 920 | return need - found; |
| 921 | } |
| 922 | |
| 923 | private: |
| 924 |