summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-16 00:19:09 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-16 00:19:09 +0200
commit7832854bdce2d1cd53f05e224419820cac7e7bf2 (patch)
treed99aa7929ed390173995a6721473ccd92cda9b61 /src/resources
parent5457aaeb892b6ac13f54a55938c39aedb577b3d8 (diff)
downloadmanaplus-7832854bdce2d1cd53f05e224419820cac7e7bf2.tar.gz
manaplus-7832854bdce2d1cd53f05e224419820cac7e7bf2.tar.bz2
manaplus-7832854bdce2d1cd53f05e224419820cac7e7bf2.tar.xz
manaplus-7832854bdce2d1cd53f05e224419820cac7e7bf2.zip
Remove goto from dye.cppv1.1.1.16
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/dye.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp
index 6f9609453..aacec1b92 100644
--- a/src/resources/dye.cpp
+++ b/src/resources/dye.cpp
@@ -50,13 +50,23 @@ DyePalette::DyePalette(const std::string &description)
int n;
if ('0' <= c && c <= '9')
+ {
n = c - '0';
+ }
else if ('A' <= c && c <= 'F')
+ {
n = c - 'A' + 10;
+ }
else if ('a' <= c && c <= 'f')
+ {
n = c - 'a' + 10;
+ }
else
- goto error;
+ {
+ logger->log("Error, invalid embedded palette: %s",
+ description.c_str());
+ return;
+ }
v = (v << 4) | n;
}
@@ -79,7 +89,6 @@ DyePalette::DyePalette(const std::string &description)
++pos;
}
- error:
logger->log("Error, invalid embedded palette: %s", description.c_str());
}