diff --git a/dat/themerms.lua b/dat/themerms.lua index 75145eefb..454059125 100644 --- a/dat/themerms.lua +++ b/dat/themerms.lua @@ -686,12 +686,12 @@ xx|.....|xx local itm = obj.new(escape_items[math.random(#escape_items)]); local itmcls = itm:class() local box - if itmcls[ "material" ] == 19 then -- GLASS==19 - -- item is made of glass so explicitly force chest to be unlocked + if itmcls[ "material" ] == "glass" then + -- explicitly force chest to be unlocked box = des.object({ id = "chest", coord = chest_spots[1], olocked = "no" }); else - -- item isn't made of glass; accept random locked/unlocked state + -- accept random locked/unlocked state box = des.object({ id = "chest", coord = chest_spots[1] }); end; box:addcontent(itm); diff --git a/src/nhlobj.c b/src/nhlobj.c index 6e97c3b87..e06fc4b59 100644 --- a/src/nhlobj.c +++ b/src/nhlobj.c @@ -219,7 +219,7 @@ l_obj_objects_to_table(lua_State *L) /* TODO: oc_bimanual, oc_bulky */ nhl_add_table_entry_int(L, "tough", o->oc_tough); nhl_add_table_entry_int(L, "dir", o->oc_dir); /* TODO: convert to text */ - nhl_add_table_entry_int(L, "material", o->oc_material); /* TODO: convert to text */ + nhl_add_table_entry_str(L, "material", materialnm[o->oc_material]); /* TODO: oc_subtyp, oc_skill, oc_armcat */ nhl_add_table_entry_int(L, "oprop", o->oc_oprop); nhl_add_table_entry_char(L, "class",