summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-23 13:07:05 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-23 13:07:05 +0000
commit76c82d66daed178db22ec0fe9bd91cfb23cfb28c (patch)
tree05d1029ebd67e95c404d05ad9ef5e4e46b83701e /crawl-ref/source/items.cc
parentf3b465a2e3fa4d16eaf9ff89065fa3a67c2775ea (diff)
downloadcrawl-ref-76c82d66daed178db22ec0fe9bd91cfb23cfb28c.tar.gz
crawl-ref-76c82d66daed178db22ec0fe9bd91cfb23cfb28c.zip
Allow .des files to place manuals with names as "manual of Fighting" or "random manual" (dpeg).
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7549 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 7e8a54503e..fc10c34971 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -55,6 +55,7 @@
#include "randart.h"
#include "religion.h"
#include "shopping.h"
+#include "skills2.h"
#include "spl-book.h"
#include "spl-util.h"
#include "stuff.h"
@@ -2437,7 +2438,25 @@ static bool _find_subtype_by_name(item_def &item,
for (int i = 0; i < ntypes; i++)
{
item.sub_type = i;
- if (name == lowercase_string(item.name(DESC_PLAIN)))
+
+ if (base_type == OBJ_BOOKS && i == BOOK_MANUAL)
+ {
+ for (int j = 0; j < NUM_SKILLS; ++j)
+ {
+ if (!skill_name(j))
+ continue;
+
+ item.plus = j;
+
+ if (name == lowercase_string(item.name(DESC_PLAIN)))
+ {
+ type_wanted = i;
+ i = ntypes;
+ break;
+ }
+ }
+ }
+ else if (name == lowercase_string(item.name(DESC_PLAIN)))
{
type_wanted = i;
break;