diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/resources/dye.cpp | 7 |
2 files changed, 8 insertions, 3 deletions
@@ -1,3 +1,7 @@ +2008-04-14 Philipp Sehmisch <tmw@crushnet.org> + + * src/resources/dye.cpp: Fixed multi-channel dyeing (patch by fate) + 2008-04-12 Bjørn Lindeijer <bjorn@lindeijer.nl> * src/gui/itemshortcutcontainer.h, src/gui/itemshortcutcontainer.cpp, diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 2ce4a48d..195d5dd1 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -191,18 +191,19 @@ void Dye::instantiate(std::string &target, std::string const &palettes) std::string::size_type pos = next_pos; next_pos = target.find(';', pos); if (next_pos == std::string::npos) next_pos = last_pos; - if (next_pos == pos + 1) + if (next_pos == pos + 1 && pal_pos != std::string::npos) { - std::string::size_type pal_next_pos = palettes.find(';'); + std::string::size_type pal_next_pos = palettes.find(';', pal_pos); s << target[pos] << ':'; if (pal_next_pos == std::string::npos) { s << palettes.substr(pal_pos); s << target.substr(next_pos); + pal_pos = std::string::npos; break; } s << palettes.substr(pal_pos, pal_next_pos - pal_pos); - pal_pos = pal_next_pos; + pal_pos = pal_next_pos + 1; } else if (next_pos > pos + 2) { |