mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Convert CraftItems directly to the name pointed by alias; necessary due to lua definition table
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user