diff --git a/data-otservbr-global/scripts/actions/other/transform_to.lua b/data-otservbr-global/scripts/actions/other/transform_to.lua index a2dd813249c..5257544eb60 100644 --- a/data-otservbr-global/scripts/actions/other/transform_to.lua +++ b/data-otservbr-global/scripts/actions/other/transform_to.lua @@ -32,10 +32,6 @@ local transformItems = { [2663] = 2662, -- cuckoo clock [2772] = 2773, [2773] = 2772, -- lever - [2907] = 2908, - [2908] = 2907, -- wall lamp - [2909] = 2910, - [2910] = 2909, -- wall lamp [2911] = 2912, [2912] = 2911, -- candelabrum [2914] = 2915, @@ -54,12 +50,6 @@ local transformItems = { [2931] = 2930, -- torch bearer [2934] = 2935, [2935] = 2934, -- table lamp - [2936] = 2937, - [2937] = 2936, -- wall lamp - [2938] = 2939, - [2939] = 2938, -- wall lamp - [2944] = 2945, - [2945] = 2944, -- wall lamp [2977] = 2978, [2978] = 2977, -- pumpkinhead [3046] = 3047, @@ -403,18 +393,6 @@ local transformItems = { [38525] = 38523, -- naga lamp [38526] = 38528, [38528] = 38526, -- basin with a glowing flower - [38529] = 38530, - [38530] = 38529, -- wall lamp - [38531] = 38532, - [38532] = 38531, -- wall lamp - [38533] = 38534, - [38534] = 38533, -- wall lamp - [38535] = 38536, - [38536] = 38535, -- wall lamp - [38623] = 38624, - [38624] = 38623, -- wall lamp - [38625] = 38626, - [38626] = 38625, -- wall lamp [38677] = 38680, [38704] = 38705, -- beaver of wisdom [38827] = 38828, @@ -428,10 +406,6 @@ local transformItems = { [39443] = 39444, [39444] = 39445, -- knightly fire bowl [39445] = 39443, -- knightly fire bowl - [39446] = 39447, - [39447] = 39446, -- knightly wall lamp - [39496] = 39497, - [39497] = 39496, -- knightly sword lamp [39498] = 39499, [39499] = 39498, -- knightly candelabra [39500] = 39501, diff --git a/data/items/items.xml b/data/items/items.xml index bda90e379c8..0c072fe2f1b 100644 --- a/data/items/items.xml +++ b/data/items/items.xml @@ -5532,10 +5532,18 @@ - - - - + + + + + + + + + + + + @@ -5647,10 +5655,18 @@ - - - - + + + + + + + + + + + + @@ -5663,10 +5679,18 @@ - - - - + + + + + + + + + + + + @@ -64974,20 +64998,44 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + @@ -66632,19 +66680,23 @@ + + + + diff --git a/src/io/iomapserialize.cpp b/src/io/iomapserialize.cpp index 5bcb79017b4..8c9d8dc3125 100644 --- a/src/io/iomapserialize.cpp +++ b/src/io/iomapserialize.cpp @@ -161,6 +161,9 @@ bool IOMapSerialize::loadItem(PropStream &propStream, Cylinder* parent, bool isH if (findItem->getID() == id) { item = findItem; break; + } else if (iType.m_transformOnUse && findItem->getID() == iType.m_transformOnUse) { + item = findItem; + break; } else if (iType.isDoor() && findItem->getDoor()) { item = findItem; break; @@ -232,10 +235,7 @@ void IOMapSerialize::saveTile(PropWriteStream &stream, const Tile* tile) { std::forward_list items; uint16_t count = 0; for (Item* item : *tileItems) { - const ItemType &it = Item::items[item->getID()]; - - // Note that these are NEGATED, ie. these are the items that will be saved. - if (!(it.moveable || it.isCarpet() || item->getDoor() || (item->getContainer() && !item->getContainer()->empty()) || it.canWriteText || item->getBed())) { + if (!item->isSavedToHouses()) { continue; } diff --git a/src/items/item.cpp b/src/items/item.cpp index f38ac6c9ec1..c30794edc76 100644 --- a/src/items/item.cpp +++ b/src/items/item.cpp @@ -1858,6 +1858,11 @@ std::string Item::parseImbuementDescription(const Item* item) { return s.str(); } +bool Item::isSavedToHouses() const { + const auto &it = items[id]; + return it.moveable || it.isWrappable() || it.isCarpet() || getDoor() || (getContainer() && !getContainer()->empty()) || it.canWriteText || getBed() || it.m_transformOnUse; +} + SoundEffect_t Item::getMovementSound(Cylinder* toCylinder) const { if (!toCylinder) { return SoundEffect_t::ITEM_MOVE_DEFAULT; diff --git a/src/items/item.hpp b/src/items/item.hpp index b54b4741154..9c7ab4af7d1 100644 --- a/src/items/item.hpp +++ b/src/items/item.hpp @@ -275,6 +275,8 @@ class Item : virtual public Thing, public ItemProperties { return nullptr; } + bool isSavedToHouses() const; + SoundEffect_t getMovementSound(Cylinder* toCylinder) const; void setIsLootTrackeable(bool value) {