summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-04-14 07:50:25 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-04-14 07:50:25 +0000
commit51700ac6902da26847a2c0fd03780e20c6954b1f (patch)
tree55b84f56b0a316a57abd2565803a7eca33d16f44
parent8c62978f845432f8cac046a0d6fd4587c087f22f (diff)
downloadmana-client-51700ac6902da26847a2c0fd03780e20c6954b1f.tar.gz
mana-client-51700ac6902da26847a2c0fd03780e20c6954b1f.tar.bz2
mana-client-51700ac6902da26847a2c0fd03780e20c6954b1f.tar.xz
mana-client-51700ac6902da26847a2c0fd03780e20c6954b1f.zip
Fixed multi-channel image dyeing (patch by fate)
-rw-r--r--ChangeLog4
-rw-r--r--src/resources/dye.cpp7
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3017f5eb..c0a1a36f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
{