mapio: don't add description twice
This commit is contained in:
parent
95610de5f3
commit
066638e7c0
|
@ -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); }
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue