diff options
-rw-r--r-- | src/gui/windows/outfitwindow.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index d547e5486..cd015a114 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -151,30 +151,17 @@ void OutfitWindow::load() std::string buf; std::stringstream ss(outfit); - STD_VECTOR<int> tokens; - - while (ss >> buf) - tokens.push_back(atoi(buf.c_str())); - - for (size_t i = 0, sz = tokens.size(); - i < sz && i < OUTFIT_ITEM_COUNT; i++) + for (size_t i = 0; (ss >> buf) && i < OUTFIT_ITEM_COUNT; i++) { - mItems[o][i] = tokens[i]; + mItems[o][i] = atoi(buf.c_str()); } outfit = cfg->getValue("OutfitColor" + toString(o), "1"); std::stringstream ss2(outfit); - tokens.clear(); - - STD_VECTOR<unsigned char> tokens2; - while (ss2 >> buf) - tokens2.push_back(CAST_U8(atoi(buf.c_str()))); - - for (size_t i = 0, sz = tokens2.size(); - i < sz && i < OUTFIT_ITEM_COUNT; i++) + for (size_t i = 0; (ss2 >> buf) && i < OUTFIT_ITEM_COUNT; i++) { - mItemColors[o][i] = fromInt(tokens2[i], ItemColor); + mItemColors[o][i] = fromInt(CAST_U8(atoi(buf.c_str())), ItemColor); } mItemsUnequip[o] = cfg->getValueBool("OutfitUnequip" + toString(o), |