cheat: step one item at a time and write valid xml (nw)

This commit is contained in:
cracyc 2016-06-23 09:57:43 -05:00
parent 759275f61a
commit b4e62ef6cc

View File

@ -219,6 +219,7 @@ void cheat_parameter::save(emu_file &cheatfile) const
// iterate over items // iterate over items
else else
{ {
cheatfile.printf(">\n");
for (auto &curitem : m_itemlist) for (auto &curitem : m_itemlist)
cheatfile.printf("\t\t\t<item value=\"%s\">%s</item>\n", curitem->value().format().c_str(), curitem->text()); cheatfile.printf("\t\t\t<item value=\"%s\">%s</item>\n", curitem->value().format().c_str(), curitem->text());
cheatfile.printf("\t\t</parameter>\n"); cheatfile.printf("\t\t</parameter>\n");
@ -300,7 +301,7 @@ bool cheat_parameter::set_next_state()
if (it->get()->value() == m_value) if (it->get()->value() == m_value)
break; break;
if (it != m_itemlist.end() && (++it != m_itemlist.end())) if (it != m_itemlist.end() && (++it != m_itemlist.end()))
m_value = (++it)->get()->value(); m_value = it->get()->value();
} }
return (m_value != origvalue); return (m_value != origvalue);