summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-26 11:06:09 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-26 11:06:09 +0000
commitf2a19d9971bb076f4a80a9e41ba601bc862d0fdf (patch)
treebe553fe84132e1f25d5f33fb98f703378096b961 /crawl-ref/source/libutil.cc
parentbc1a54904787e2f4779a99f2be1f72f6fd87679b (diff)
downloadcrawl-ref-f2a19d9971bb076f4a80a9e41ba601bc862d0fdf.tar.gz
crawl-ref-f2a19d9971bb076f4a80a9e41ba601bc862d0fdf.zip
Replaced timed markers with Lua markers. Breaks save compatibility.
KFEAT: feature names are now as in the dungeon_feature_type enum. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1930 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index e1cca6a43e..845f96b380 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -46,6 +46,33 @@
#include <regex.h>
#endif
+description_level_type description_type_by_name(const char *desc)
+{
+ if (!desc)
+ return DESC_PLAIN;
+
+ if (!strcmp("The", desc))
+ return DESC_CAP_THE;
+ else if (!strcmp("the", desc))
+ return DESC_NOCAP_THE;
+ else if (!strcmp("A", desc))
+ return DESC_CAP_A;
+ else if (!strcmp("a", desc))
+ return DESC_NOCAP_A;
+ else if (!strcmp("Your", desc))
+ return DESC_CAP_YOUR;
+ else if (!strcmp("your", desc))
+ return DESC_NOCAP_YOUR;
+ else if (!strcmp("its", desc))
+ return DESC_NOCAP_ITS;
+ else if (!strcmp("worn", desc))
+ return DESC_INVENTORY_EQUIP;
+ else if (!strcmp("inv", desc))
+ return DESC_INVENTORY;
+
+ return DESC_PLAIN;
+}
+
// Should return true if the filename contains nothing that
// the shell can do damage with.
bool shell_safe(const char *file)