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

Function get_table_objclass

src/sp_lev.c:3454–3464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3452}
3453
3454int
3455get_table_objclass(lua_State *L)
3456{
3457 char *s = get_table_str_opt(L, "class", NULL);
3458 int ret = -1;
3459
3460 if (s && strlen(s) == 1)
3461 ret = (int) *s;
3462 Free(s);
3463 return ret;
3464}
3465
3466/* find object otyp by text s (optionally considering oclass) */
3467staticfn int

Callers 3

l_obj_new_readobjnamFunction · 0.85
get_table_objtypeFunction · 0.85
lspo_objectFunction · 0.85

Calls 1

get_table_str_optFunction · 0.85

Tested by

no test coverage detected