From 9dfe0b6238880a3ee72bad3d76359959cce76d23 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 12 Aug 2014 03:44:22 -0400 Subject: handle the last ring slot --- crawl-ref/source/wiz-you.cc | 19 ++++++++++++++----- 1 file 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 &tokens) return false; } -static bool _chardump_check_equipment(const vector &tokens) +static bool _chardump_check_equipment(const vector &tokens, + bool in_equipment) { size_t size = tokens.size(); @@ -1327,9 +1328,8 @@ static bool _chardump_check_equipment(const vector &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 &tokens) static void _wizard_modify_character(string inputdata) { vector 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; + } } /** -- cgit v1.2.3-54-g00ecf