From a53d99cef86e29f4c690aa441dd257077f9f33fd Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Sat, 3 Dec 2022 17:06:51 -0300 Subject: [PATCH] Some fixes on function for not remove items with decay added from map (#620) --- src/game/game.cpp | 2 +- src/items/item.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 1a77b30edd..14b1efe8e1 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -1703,7 +1703,7 @@ ReturnValue Game::internalRemoveItem(Item* item, int32_t count /*= -1*/, bool te if (item->canDecay() && cylinder->getTile() && item->getLoadedFromMap()) { SPDLOG_DEBUG("Cannot remove item with id {}, name {}, on position {}", item->getID(), item->getName(), cylinder->getPosition().toString()); item->stopDecaying(); - return RETURNVALUE_NOERROR; + return RETURNVALUE_THISISIMPOSSIBLE; } if (!test) { diff --git a/src/items/item.h b/src/items/item.h index 5052c579c5..caf124555b 100644 --- a/src/items/item.h +++ b/src/items/item.h @@ -1011,7 +1011,7 @@ class Item : virtual public Thing virtual void startDecaying(); virtual void stopDecaying(); - bool getLoadedFromMap() { + bool getLoadedFromMap() const { return loadedFromMap; }