MCPcopy Create free account
hub / github.com/NetHack/NetHack / nhl_dnum_name

Function nhl_dnum_name

src/nhlua.c:1152–1167  ·  view source on GitHub ↗

local dungeon_name = dnum_name(u.dnum); */

Source from the content-addressed store, hash-verified

1150
1151/* local dungeon_name = dnum_name(u.dnum); */
1152staticfn int
1153nhl_dnum_name(lua_State *L)
1154{
1155 int argc = lua_gettop(L);
1156
1157 if (argc == 1) {
1158 lua_Integer dnum = luaL_checkinteger(L, 1);
1159
1160 if (dnum >= 0 && dnum < svn.n_dgns)
1161 lua_pushstring(L, svd.dungeons[dnum].dname);
1162 else
1163 lua_pushstring(L, "");
1164 } else
1165 nhl_error(L, "Expected an integer parameter");
1166 return 1;
1167}
1168
1169/* return gender-neutral monster type name by integer value,
1170 or empty string if outside LOW_PM - HIGH_PM range */

Callers

nothing calls this directly

Calls 1

nhl_errorFunction · 0.85

Tested by

no test coverage detected