Lua NetHack obj bindings

This commit is contained in:
Pasi Kallinen
2019-12-06 21:29:12 +02:00
parent 1c30c437c3
commit 7043e2134a
10 changed files with 476 additions and 6 deletions

View File

@@ -114,6 +114,19 @@ int value;
lua_rawset(L, -3);
}
void
nhl_add_table_entry_char(L, name, value)
lua_State *L;
const char *name;
char value;
{
char buf[2];
Sprintf(buf, "%c", value);
lua_pushstring(L, name);
lua_pushstring(L, buf);
lua_rawset(L, -3);
}
void
nhl_add_table_entry_str(L, name, value)
lua_State *L;
@@ -874,6 +887,8 @@ nhl_init()
l_selection_register(L);
l_register_des(L);
l_obj_register(L);
if (!nhl_loadlua(L, "nhlib.lua")) {
lua_close(L);
return (lua_State *) 0;