mapio: don't add description twice

This commit is contained in:
Ahmed Samy 2013-12-07 02:27:21 +02:00
parent 95610de5f3
commit 066638e7c0
2 changed files with 4 additions and 8 deletions

View File

@ -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); }

View File

@ -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<std::string>(OTBM_ATTR_DESCRIPTION),
g_app.getName(), g_app.getVersion()));
// spawn file.
root->addU8(OTBM_ATTR_SPAWN_FILE);