~redstrate/libxiv

89ea0548ef3ac9d5773cf0037b9e16d772a350c7 — Joshua Goins 2 years ago 8b3aed1
Trim whitespace around parent indices

This prevents a bug where whitespace could accidentally delete
some parents.
1 files changed, 2 insertions(+), 0 deletions(-)

M src/havokxmlparser.cpp
M src/havokxmlparser.cpp => src/havokxmlparser.cpp +2 -0
@@ 56,6 56,8 @@ Skeleton parseHavokXML(const std::string_view path) {
    pugi::xpath_node parentNode = doc.select_node("//hkparam[@name=\"parentIndices\"]");

    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, " ");