Archived
1
Fork 0

Trim whitespace around parent indices

This prevents a bug where whitespace could accidentally delete
some parents.
This commit is contained in:
Joshua Goins 2022-04-13 14:58:33 -04:00
parent 8b3aed1f29
commit 89ea0548ef

View file

@ -56,6 +56,8 @@ Skeleton parseHavokXML(const std::string_view path) {
pugi::xpath_node parentNode = doc.select_node("//hkparam[@name=\"parentIndices\"]"); pugi::xpath_node parentNode = doc.select_node("//hkparam[@name=\"parentIndices\"]");
std::string text = parentNode.node().text().as_string(); std::string text = parentNode.node().text().as_string();
std::replace(text.begin(), text.end(), '\n', ' ');
text.erase(std::remove(text.begin(), text.end(), '\t'), text.end());
auto parentIndices = tokenize(text, " "); auto parentIndices = tokenize(text, " ");