Provide escape item in water-surrounded vaults

Water vaults are one of the few places that can/will generate completely
sealed off in a normal level.  Other such spots are designed to provide
a guaranteed means of escape (vault guard, scrolls of teleportation in
niches, etc) -- water vaults were an exception that didn't do this, so a
hero who fell into one from above could have ended up in a position
where she had no choice but to wait to starve to death or #quit. Provide
an escape item in one of the vault's chests to give a hero more options
in that position.

Also fix a minor mistake (I'm pretty sure, though I'm not a Lua expert
enough to be certain) in an nhlib.c comment describing how to use
obj.addcontent() -- when called as box.addcontent(contents) as the
comment suggested it produces an error, but works OK when called as
box:addcontent(contents) or obj.addcontent(box, contents).
This commit is contained in:
Michael Meyer
2023-06-07 17:53:05 -04:00
committed by PatR
parent 60a3263a85
commit 95b410ee94
2 changed files with 20 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ l_obj_getcontents(lua_State *L)
/* Puts object inside another object. */
/* local box = obj.new("large chest");
box.addcontent(obj.new("rock"));
box:addcontent(obj.new("rock"));
*/
static int
l_obj_add_to_container(lua_State *L)