summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_item.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2011-07-21 13:46:09 +0000
committerRaphael Langella <raphael.langella@gmail.com>2011-07-21 22:25:43 +0200
commitbe4f82525abff13f0aaa2c29abd21f8c8e0c7d10 (patch)
treece913fe0360a2742d8bb3a6a7b6fe2bd49e1f9bf /crawl-ref/source/l_item.cc
parent17dfbce6f42ff75dfefd63ace016e51d9f493aa5 (diff)
downloadcrawl-ref-be4f82525abff13f0aaa2c29abd21f8c8e0c7d10.tar.gz
crawl-ref-be4f82525abff13f0aaa2c29abd21f8c8e0c7d10.zip
Fix lua bugs with unidentied armour.
Bug introduced by 294db2cc.
Diffstat (limited to 'crawl-ref/source/l_item.cc')
-rw-r--r--crawl-ref/source/l_item.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc
index 1428d569fd..a4b4925b7c 100644
--- a/crawl-ref/source/l_item.cc
+++ b/crawl-ref/source/l_item.cc
@@ -287,9 +287,11 @@ IDEF(subtype)
{
if (item)
{
+ const char *s = NULL;
+ if (item->base_type == OBJ_ARMOUR)
+ s = item_slot_name(get_armour_slot(*item), true).c_str();
if (item_type_known(*item))
{
- const char *s = NULL;
if (item->base_type == OBJ_JEWELLERY)
{
if (jewellery_is_amulet(*item))
@@ -325,17 +327,15 @@ IDEF(subtype)
else
s = "spellbook";
}
- else if (item->base_type == OBJ_ARMOUR)
- s = item_slot_name(get_armour_slot(*item), true).c_str();
+ }
- if (s)
- lua_pushstring(ls, s);
- else
- lua_pushnil(ls);
+ if (s)
+ lua_pushstring(ls, s);
+ else
+ lua_pushnil(ls);
- lua_pushnumber(ls, item->sub_type);
- return (2);
- }
+ lua_pushnumber(ls, item->sub_type);
+ return (2);
}
lua_pushnil(ls);