diff --git a/include/timeout.h b/include/timeout.h index a65f2bf51..be4a28801 100644 --- a/include/timeout.h +++ b/include/timeout.h @@ -1,4 +1,4 @@ -/* NetHack 3.7 timeout.h $NHDT-Date: 1703294874 2023/12/23 01:27:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.22 $ */ +/* NetHack 3.7 timeout.h $NHDT-Date: 1705087443 2024/01/12 19:24:03 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.23 $ */ /* Copyright 1994, Dean Luick */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,6 +24,8 @@ enum timer_type { /* * Timeout functions. Add an enum here, then put it in the table * in timeout.c. "One more level of indirection will fix everything." + * Also add it to timerstr[] in nhl_get_timertype(nhlua.c); the entries + * there match these but are spelled diffently. * * Note: if any are inserted, removed, or reordered then EDITLEVEL * needs to be incremented because timeout indices get written into save diff --git a/src/nhlua.c b/src/nhlua.c index 0ed1016f8..23d185813 100644 --- a/src/nhlua.c +++ b/src/nhlua.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 nhlua.c $NHDT-Date: 1704497031 2024/01/05 23:23:51 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.126 $ */ +/* NetHack 3.7 nhlua.c $NHDT-Date: 1705087450 2024/01/12 19:24:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.129 $ */ /* Copyright (c) 2018 by Pasi Kallinen */ /* NetHack may be freely redistributed. See license for details. */ @@ -255,10 +255,12 @@ get_table_mapchr_opt(lua_State *L, const char *name, schar defval) short nhl_get_timertype(lua_State *L, int idx) { + /* these are in the same order as enum timeout_types in timeout.h and + ttable timeout_funcs[] in timeout.c, although not spelled the same */ static const char *const timerstr[NUM_TIME_FUNCS + 1] = { "rot-organic", "rot-corpse", "revive-mon", "zombify-mon", - "burn-obj", "hatch-egg", "fig-transform", "melt-ice", - "shrink-glob", NULL + "burn-obj", "hatch-egg", "fig-transform", "shrink-glob", + "melt-ice", NULL }; short ret = luaL_checkoption(L, idx, NULL, timerstr);