Tutorial: hunger and eating food

Reset hunger when exiting the tutorial.
Add an optional second parameter to lua pline, forcing a more-prompt.
This commit is contained in:
Pasi Kallinen
2023-03-18 13:57:24 +02:00
parent 633487849b
commit 2a7be0b050
3 changed files with 20 additions and 2 deletions

View File

@@ -603,14 +603,17 @@ nhl_impossible(lua_State *L)
}
/* pline("It hits!") */
/* pline("It hits!", true) */
static int
nhl_pline(lua_State *L)
{
int argc = lua_gettop(L);
if (argc == 1)
if (argc == 1 || argc == 2) {
pline("%s", luaL_checkstring(L, 1));
else
if (lua_toboolean(L, 2))
display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
} else
nhl_error(L, "Wrong args");
return 0;
@@ -1593,6 +1596,7 @@ nhl_gamestate(lua_State *L)
if (wornmask)
setworn(otmp, wornmask);
}
init_uhunger();
stored = FALSE;
} else {
/* store game state */