1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Move cook result properly to ContentFeatures

This commit is contained in:
Perttu Ahola 2011-11-16 01:34:09 +02:00
parent f107967fdc
commit 37a5f8a30b
6 changed files with 19 additions and 29 deletions

View file

@ -158,12 +158,17 @@ video::ITexture * MaterialItem::getImage(ITextureSource *tsrc) const
bool MaterialItem::isCookable() const
{
return item_material_is_cookable(m_content, m_gamedef);
INodeDefManager *ndef = m_gamedef->ndef();
const ContentFeatures &f = ndef->get(m_content);
return (f.cookresult_item != "");
}
InventoryItem *MaterialItem::createCookResult() const
{
return item_material_create_cook_result(m_content, m_gamedef);
INodeDefManager *ndef = m_gamedef->ndef();
const ContentFeatures &f = ndef->get(m_content);
std::istringstream is(f.cookresult_item, std::ios::binary);
return InventoryItem::deSerialize(is, m_gamedef);
}
/*