| 1744 | } |
| 1745 | |
| 1746 | static int read_symbol(string s) |
| 1747 | { |
| 1748 | if (s.empty()) |
| 1749 | return 0; |
| 1750 | |
| 1751 | if (s.length() > 1 && s[0] == '\\') |
| 1752 | s = s.substr(1); |
| 1753 | |
| 1754 | { |
| 1755 | char32_t c; |
| 1756 | const char *nc = s.c_str(); |
| 1757 | nc += utf8towc(&c, nc); |
| 1758 | // no control, combining or CJK characters, please |
| 1759 | if (!*nc && wcwidth(c) == 1) |
| 1760 | return c; |
| 1761 | } |
| 1762 | |
| 1763 | int base = 10; |
| 1764 | if (s.length() > 1 && s[0] == 'x') |
| 1765 | { |
| 1766 | s = s.substr(1); |
| 1767 | base = 16; |
| 1768 | } |
| 1769 | |
| 1770 | char *tail; |
| 1771 | return strtoul(s.c_str(), &tail, base); |
| 1772 | } |
| 1773 | |
| 1774 | void game_options::set_fire_order_ability(const string &s, bool append, bool remove) |
| 1775 | { |
no test coverage detected