summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/chardump.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-10-05 13:48:24 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-10-05 14:22:01 +0200
commit77c99229d934203602ef2321db5ff60714d9c605 (patch)
tree4e90191b1ce32e46b6df1ec5c99296eaf08b1839 /crawl-ref/source/chardump.cc
parent1395738807f21a29ccafe430a08af592886a2c1e (diff)
downloadcrawl-ref-77c99229d934203602ef2321db5ff60714d9c605.tar.gz
crawl-ref-77c99229d934203602ef2321db5ff60714d9c605.zip
Fix the action count not showing thrown weapons.
I added support for fancy unrands (like the knife of Accuracy) as well, although that's probably overkill. Not handled yet: fumbled stuff. Should we mention what exactly was fumbled?
Diffstat (limited to 'crawl-ref/source/chardump.cc')
-rw-r--r--crawl-ref/source/chardump.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index d74c447321..9e00fefd09 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -1135,6 +1135,18 @@ static string _describe_action_subtype(caction_type type, int subtype)
{
switch (type)
{
+ case CACT_THROW:
+ {
+ int basetype = subtype >> 16;
+ subtype = (short)(subtype & 0xFFFF);
+
+ if (basetype == OBJ_MISSILES)
+ return uppercase_first(item_base_name(OBJ_MISSILES, subtype));
+ else if (basetype == OBJ_WEAPONS)
+ ; // fallthrough
+ else
+ return "other";
+ }
case CACT_MELEE:
case CACT_FIRE:
if (subtype >= UNRAND_START)
@@ -1147,8 +1159,6 @@ static string _describe_action_subtype(caction_type type, int subtype)
}
return ((subtype == -1) ? "Unarmed"
: uppercase_first(item_base_name(OBJ_WEAPONS, subtype)));
- case CACT_THROW:
- return uppercase_first(item_base_name(OBJ_MISSILES, subtype));
case CACT_CAST:
return spell_title((spell_type)subtype);
case CACT_INVOKE: