diff --git a/src/client/map.h b/src/client/map.h index 67c08786..6c975374 100644 --- a/src/client/map.h +++ b/src/client/map.h @@ -151,6 +151,7 @@ public: void setHouseFile(const std::string& file) { m_attribs.set(OTBM_ATTR_HOUSE_FILE, file); } void setSpawnFile(const std::string& file) { m_attribs.set(OTBM_ATTR_SPAWN_FILE, file); } void setDescription(const std::string& desc) { m_attribs.set(OTBM_ATTR_DESCRIPTION, desc); } + void clearDescriptions() { m_attribs.remove(OTBM_ATTR_DESCRIPTION); } void setWidth(uint16 w) { m_attribs.set(OTBM_ATTR_WIDTH, w); } void setHeight(uint16 h) { m_attribs.set(OTBM_ATTR_HEIGHT, h); } diff --git a/src/client/mapio.cpp b/src/client/mapio.cpp index 50bae75e..402ecc0b 100644 --- a/src/client/mapio.cpp +++ b/src/client/mapio.cpp @@ -284,15 +284,10 @@ void Map::saveOtbm(const std::string& fileName) root->startNode(OTBM_MAP_DATA); { - const auto& descvec = getDescriptions(); - for(const auto& desc : descvec) { - root->addU8(OTBM_ATTR_DESCRIPTION); - root->addString(desc); - } - - // special one root->addU8(OTBM_ATTR_DESCRIPTION); - root->addString(stdext::format("Saved with %s v%s", g_app.getName(), g_app.getVersion())); + root->addString(stdext::format("%s\nSaved with %s v%s", + m_attribs.get(OTBM_ATTR_DESCRIPTION), + g_app.getName(), g_app.getVersion())); // spawn file. root->addU8(OTBM_ATTR_SPAWN_FILE);