Fixed glow when switch is used

This commit is contained in:
Deve 2018-09-11 22:02:06 +02:00
parent 29a7be5531
commit 3ebc68ff10
2 changed files with 5 additions and 4 deletions

View File

@ -255,10 +255,11 @@ void Item::switchTo(ItemType type, scene::IMesh *mesh, scene::IMesh *lowmesh)
*/
void Item::switchBack()
{
if (ItemState::switchBack()) return;
setMesh(m_original_mesh, m_original_lowmesh);
if (ItemState::switchBack())
return;
Vec3 hpr;
hpr.setHPR(m_original_rotation);
m_node->setRotation(hpr.toIrrHPR());

View File

@ -130,7 +130,7 @@ protected:
friend class ItemManager;
friend class NetworkItemManager;
// ------------------------------------------------------------------------
void setType(ItemType type) { m_type = type; }
virtual void setType(ItemType type) { m_type = type; }
public:
/** Constructor.
@ -319,7 +319,7 @@ private:
/** True if this item is predicted to exists. Used in networking only. */
bool m_is_predicted;
void setType(ItemType type);
void setType(ItemType type) OVERRIDE;
void initItem(ItemType type, const Vec3 &xyz);
void setMesh(scene::IMesh* mesh, scene::IMesh* lowres_mesh);