summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-08-12 03:44:22 -0400
committerJesse Luehrs <doy@tozt.net>2014-08-12 03:48:26 -0400
commit9dfe0b6238880a3ee72bad3d76359959cce76d23 (patch)
tree2c5ffb9e11459aeacf29f1f01004a4625e0e588a
parent32f1ee216dfee8c3c4932ec5944b1bc357b429f3 (diff)
downloadcrawl-ref-9dfe0b6238880a3ee72bad3d76359959cce76d23.tar.gz
crawl-ref-9dfe0b6238880a3ee72bad3d76359959cce76d23.zip
handle the last ring slot
-rw-r--r--crawl-ref/source/wiz-you.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/crawl-ref/source/wiz-you.cc b/crawl-ref/source/wiz-you.cc
index c30bf0e01a..a47795eb79 100644
--- a/crawl-ref/source/wiz-you.cc
+++ b/crawl-ref/source/wiz-you.cc
@@ -1301,7 +1301,8 @@ static bool _chardump_check_char(const vector<string> &tokens)
return false;
}
-static bool _chardump_check_equipment(const vector<string> &tokens)
+static bool _chardump_check_equipment(const vector<string> &tokens,
+ bool in_equipment)
{
size_t size = tokens.size();
@@ -1327,9 +1328,8 @@ static bool _chardump_check_equipment(const vector<string> &tokens)
offset = 9;
else if (tokens[0] == "MR")
offset = 5;
- // XXX the last inventory item is just on its own
- // else if (tokens[0] == ???)
- // offset = ???;
+ else if (in_equipment)
+ offset = 3;
else
return false;
@@ -1364,6 +1364,7 @@ static bool _chardump_check_equipment(const vector<string> &tokens)
static void _wizard_modify_character(string inputdata)
{
vector<string> tokens = split_string(" ", inputdata);
+ static bool in_equipment = false;
if (_chardump_check_skill(tokens))
return;
@@ -1375,8 +1376,16 @@ static void _wizard_modify_character(string inputdata)
return;
if (_chardump_check_char(tokens))
return;
- if (_chardump_check_equipment(tokens))
+
+ if (_chardump_check_equipment(tokens, in_equipment))
+ {
+ in_equipment = true;
return;
+ }
+ else
+ {
+ in_equipment = false;
+ }
}
/**