diff --git a/src/client/itemtype.h b/src/client/itemtype.h index 950315b0..a803f980 100644 --- a/src/client/itemtype.h +++ b/src/client/itemtype.h @@ -149,6 +149,8 @@ public: bool isNull() { return m_null; } + bool isWriteable() { return m_attribs.get(ItemTypeAttrWritable); } + private: ItemCategory m_category; stdext::boolean m_null; diff --git a/src/client/map.cpp b/src/client/map.cpp index 5501e481..701769be 100644 --- a/src/client/map.cpp +++ b/src/client/map.cpp @@ -180,34 +180,34 @@ bool Map::removeThing(const ThingPtr& thing) if(!thing) return false; - notificateTileUpdate(thing->getPosition()); - + bool ret = false; if(thing->isMissile()) { MissilePtr missile = thing->static_self_cast(); int z = missile->getPosition().z; auto it = std::find(m_floorMissiles[z].begin(), m_floorMissiles[z].end(), missile); if(it != m_floorMissiles[z].end()) { m_floorMissiles[z].erase(it); - return true; + ret = true; } } else if(thing->isAnimatedText()) { AnimatedTextPtr animatedText = thing->static_self_cast(); auto it = std::find(m_animatedTexts.begin(), m_animatedTexts.end(), animatedText); if(it != m_animatedTexts.end()) { m_animatedTexts.erase(it); - return true; + ret = true; } } else if(thing->isStaticText()) { StaticTextPtr staticText = thing->static_self_cast(); auto it = std::find(m_staticTexts.begin(), m_staticTexts.end(), staticText); if(it != m_staticTexts.end()) { m_staticTexts.erase(it); - return true; + ret = true; } } else if(const TilePtr& tile = thing->getTile()) - return tile->removeThing(thing); + ret = tile->removeThing(thing); - return false; + notificateTileUpdate(thing->getPosition()); + return ret; } bool Map::removeThingByPos(const Position& pos, int stackPos)