fix crash in EGS when client asks to create an item with a sheet ID EGS doesn't know

by avoiding access the null item pointer outside the if(null) scope.

--HG--
branch : develop
This commit is contained in:
kishan_grimout 2017-05-29 16:15:02 +02:00
parent 8b4d189c31
commit 5ea48c7599

View file

@ -233,6 +233,7 @@ CGameItemPtr CGameItemManager::createItem( const CSheetId& sheetId, uint16 quali
// nlerror("<CGameItemManager::createItem> Can't find the owner item %s",owner.toString().c_str());
// }
// }
log_Item_Create(item->getItemId(), item->getSheetId(), item->getStackSize(), item->quality());
}
else
{
@ -240,8 +241,6 @@ CGameItemPtr CGameItemManager::createItem( const CSheetId& sheetId, uint16 quali
nlwarning("<CGameItemManager::createItem> Can't create an item with invalid sheet '%s'", sheetId.toString().c_str());
}
log_Item_Create(item->getItemId(), item->getSheetId(), item->getStackSize(), item->quality());
return item;
} // createItem //