Lua NetHack obj bindings
This commit is contained in:
15
src/nhlua.c
15
src/nhlua.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user