1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Add object visual type 'item' (#7870)

This commit is contained in:
Alex 2018-12-10 18:57:04 -08:00 committed by Paramat
parent 98fa8a154d
commit a833bee9ed
4 changed files with 10 additions and 7 deletions

View file

@ -662,7 +662,7 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
}
else
errorstream<<"GenericCAO::addToScene(): Could not load mesh "<<m_prop.mesh<<std::endl;
} else if (m_prop.visual == "wielditem") {
} else if (m_prop.visual == "wielditem" || m_prop.visual == "item") {
ItemStack item;
infostream << "GenericCAO::addToScene(): wielditem" << std::endl;
if (m_prop.wield_item.empty()) {
@ -680,7 +680,8 @@ void GenericCAO::addToScene(ITextureSource *tsrc)
}
m_wield_meshnode = new WieldMeshSceneNode(
RenderingEngine::get_scene_manager(), -1);
m_wield_meshnode->setItem(item, m_client);
m_wield_meshnode->setItem(item, m_client,
(m_prop.visual == "wielditem"));
m_wield_meshnode->setScale(
v3f(m_prop.visual_size.X / 2, m_prop.visual_size.Y / 2,