From 31d425795cc304b7b801dfd4280a492340fdf8f3 Mon Sep 17 00:00:00 2001 From: Deve Date: Tue, 11 Sep 2018 22:29:55 +0200 Subject: [PATCH] Bubblegum may be used up only if switch was not used --- src/items/item.cpp | 3 ++- src/items/item.hpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/items/item.cpp b/src/items/item.cpp index a2fbe617f..988346407 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -343,7 +343,8 @@ void Item::updateGraphics(float dt) float time_till_return = stk_config->ticks2Time(getTicksTillReturn()); bool is_visible = isAvailable() || time_till_return <= 1.0f || - (getType() == ITEM_BUBBLEGUM && !isUsedUp() ); + (getType() == ITEM_BUBBLEGUM && + getOriginalType() == ITEM_NONE && !isUsedUp()); m_node->setVisible(is_visible); diff --git a/src/items/item.hpp b/src/items/item.hpp index afec8f362..52958037f 100644 --- a/src/items/item.hpp +++ b/src/items/item.hpp @@ -235,6 +235,9 @@ public: /** Returns the type of this item. */ ItemType getType() const { return m_type; } // ------------------------------------------------------------------------ + /** Returns the original type of this item. */ + ItemType getOriginalType() const { return m_original_type; } + // ------------------------------------------------------------------------ /** Sets the index of this item in the item manager list. */ void setItemId(unsigned int n) { m_item_id = n; } // ------------------------------------------------------------------------