From c4acdd1997b5bdc7b70e52ea90354ee65f15360a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 19 Jul 2012 16:28:01 +0300 Subject: Fix outfits loading. --- src/gui/outfitwindow.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp index 277ef904a..f4767c33c 100644 --- a/src/gui/outfitwindow.cpp +++ b/src/gui/outfitwindow.cpp @@ -142,10 +142,10 @@ void OutfitWindow::load(bool oldConfig) std::string buf; std::stringstream ss(outfit); - std::vector tokens; + std::vector tokens; while (ss >> buf) - tokens.push_back(static_cast(atoi(buf.c_str()))); + tokens.push_back(atoi(buf.c_str())); for (int i = 0; i < static_cast(tokens.size()) && i < OUTFIT_ITEM_COUNT; i++) @@ -159,13 +159,14 @@ void OutfitWindow::load(bool oldConfig) tokens.clear(); + std::vector tokens2; while (ss2 >> buf) - tokens.push_back(static_cast(atoi(buf.c_str()))); + tokens2.push_back(static_cast(atoi(buf.c_str()))); - for (int i = 0; i < static_cast(tokens.size()) + for (int i = 0; i < static_cast(tokens2.size()) && i < OUTFIT_ITEM_COUNT; i++) { - mItemColors[o][i] = tokens[i]; + mItemColors[o][i] = tokens2[i]; } mItemsUnequip[o] = cfg->getValueBool("OutfitUnequip" + toString(o), -- cgit v1.2.3-70-g09d2