From 37a5f8a30bc2e267909d699faef4910a3a261555 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Wed, 16 Nov 2011 01:34:09 +0200 Subject: Move cook result properly to ContentFeatures --- src/inventory.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index 1929761a5..6d0a2a214 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -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); } /* -- cgit v1.2.3