mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Convert CraftItems directly to the name pointed by alias; necessary due to lua definition table
This commit is contained in:
parent
2b8b2a4f30
commit
4ad8891e05
4 changed files with 20 additions and 11 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue