diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-12-04 01:16:22 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-12-04 01:16:22 +0200 |
commit | 4ad8891e0586f60a642675cc4d04edc3cd84650b (patch) | |
tree | bd4e58f90572db689117543e02106e3ce6735b99 /src/inventory.cpp | |
parent | 2b8b2a4f305352f485f726a3bb0ab2f85e711c75 (diff) | |
download | minetest-4ad8891e0586f60a642675cc4d04edc3cd84650b.tar.gz minetest-4ad8891e0586f60a642675cc4d04edc3cd84650b.tar.bz2 minetest-4ad8891e0586f60a642675cc4d04edc3cd84650b.zip |
Convert CraftItems directly to the name pointed by alias; necessary due to lua definition table
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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 { |