ryzomclassic-develop
kaetemi 5 years ago
parent d70c4a215d
commit f7bdd7ecd7

@ -146,11 +146,6 @@ void CItemImage::build(CCDBNodeBranch *branch)
nlassert(Sheet && Quality && Quantity && UserColor && Weight && NameId && InfoVersion); nlassert(Sheet && Quality && Quantity && UserColor && Weight && NameId && InfoVersion);
} }
uint64 CItemImage::getItemId() const
{
return ((uint64)getSerial() << 32) | getCreateTime();
}
// ************************************************************************************************* // *************************************************************************************************
void CItemInfoCache::load(const std::string &filename) void CItemInfoCache::load(const std::string &filename)
{ {
@ -3388,18 +3383,6 @@ const CClientItemInfo &CInventoryManager::getItemInfo(uint slotId) const
{ {
TItemInfoMap::const_iterator it= _ItemInfoMap.find(slotId); TItemInfoMap::const_iterator it= _ItemInfoMap.find(slotId);
static CClientItemInfo empty; static CClientItemInfo empty;
if (it == _ItemInfoMap.end() || !isItemInfoUpToDate(slotId))
{
// if slot has not been populated yet or out of date, then return info from cache if possible
const CItemImage *item = getServerItem(slotId);
if (item && item->getItemId() > 0) {
const CClientItemInfo *ret = _ItemInfoCache.getItemInfo(item->getItemId());
if (ret != NULL)
{
return *ret;
}
}
}
if (it == _ItemInfoMap.end()) if (it == _ItemInfoMap.end())
{ {
@ -3560,12 +3543,6 @@ void CInventoryManager::onReceiveItemInfo(const CItemInfos &itemInfo)
// update the Info // update the Info
uint itemSlotId = itemInfo.slotId; uint itemSlotId = itemInfo.slotId;
const CItemImage *item = getServerItem(itemSlotId);
if (item && item->getItemId() > 0)
{
_ItemInfoCache.readFromImpulse(item->getItemId(), itemInfo);
}
// write in map, from DB. // write in map, from DB.
_ItemInfoMap[itemSlotId].readFromImpulse(itemInfo); _ItemInfoMap[itemSlotId].readFromImpulse(itemInfo);

Loading…
Cancel
Save