diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-16 00:19:09 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-09-30 15:35:44 +0200 |
commit | b9ef24610683211dbd847d93f7d29de88bf0f170 (patch) | |
tree | 1332b766c621b8d2ca4eb6472e71ec7dea7751de /src/resources/dye.cpp | |
parent | 5040c10614b52d5120cd16f483bd6e32baabecd7 (diff) | |
download | mana-b9ef24610683211dbd847d93f7d29de88bf0f170.tar.gz mana-b9ef24610683211dbd847d93f7d29de88bf0f170.tar.bz2 mana-b9ef24610683211dbd847d93f7d29de88bf0f170.tar.xz mana-b9ef24610683211dbd847d93f7d29de88bf0f170.zip |
Remove goto from dye.cpp
Diffstat (limited to 'src/resources/dye.cpp')
-rw-r--r-- | src/resources/dye.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index e7c9be56..abd6a411 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; } @@ -72,7 +82,6 @@ DyePalette::DyePalette(const std::string &description) ++pos; } - error: logger->log("Error, invalid embedded palette: %s", description.c_str()); } |