From 4ad8891e0586f60a642675cc4d04edc3cd84650b Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 4 Dec 2011 01:16:22 +0200 Subject: Convert CraftItems directly to the name pointed by alias; necessary due to lua definition table --- src/inventory.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/inventory.cpp') diff --git a/src/inventory.cpp b/src/inventory.cpp index a913430e6..e9600ece5 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -354,6 +354,15 @@ bool ToolItem::isKnown() const CraftItem */ +CraftItem::CraftItem(IGameDef *gamedef, std::string subname, u16 count): + InventoryItem(gamedef, count) +{ + // Convert directly to the correct name through aliases. + // This is necessary because CraftItem callbacks are stored in + // Lua refenced by their correct name + m_subname = gamedef->cidef()->getAlias(subname); +} + #ifndef SERVER video::ITexture * CraftItem::getImage() const { -- cgit v1.2.3