From 3ebc68ff10520fcefee331e701a15d9dbde2540f Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 11 Sep 2018 22:02:06 +0200 Subject: [PATCH] Fixed glow when switch is used --- src/items/item.cpp | 5 +++-- src/items/item.hpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/items/item.cpp b/src/items/item.cpp index c7fc73ebe..a2fbe617f 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -255,9 +255,10 @@ 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); diff --git a/src/items/item.hpp b/src/items/item.hpp index 326a831c8..afec8f362 100644 --- a/src/items/item.hpp +++ b/src/items/item.hpp @@ -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);