Use lua for special level files
Game is playable, and should compile on linux and Windows. Assumes you have a lua 5.3 library available. Removes level compiler and associated files. Replaces special level des-files with lua scripts. Exposes some NetHack internals to lua: - des-table with commands to create special levels - nh-table with NetHack core commands - nhc-table with some constants - u-table with some player-specific data (u-struct) - selection userdata Adds some rudimentary tests. Adds new extended command #wizloadlua to run a specific script, and #wizloaddes to run a specific level-creation script. nhlib.lua is loaded for every lua script. Download and untar lua: mkdir lib cd lib curl -R -O http://www.lua.org/ftp/lua-5.3.5.tar.gz tar zxf lua-5.3.5.tar.gz Then make nethack normally.
This commit is contained in:
@@ -306,7 +306,7 @@ gloc_filter_init()
|
||||
{
|
||||
if (iflags.getloc_filter == GFILTER_AREA) {
|
||||
if (!g.gloc_filter_map) {
|
||||
g.gloc_filter_map = selection_opvar((char *) 0);
|
||||
g.gloc_filter_map = selection_new();
|
||||
}
|
||||
/* special case: if we're in a doorway, try to figure out which
|
||||
direction we're moving, and use that side of the doorway */
|
||||
@@ -326,8 +326,8 @@ void
|
||||
gloc_filter_done()
|
||||
{
|
||||
if (g.gloc_filter_map) {
|
||||
opvar_free_x(g.gloc_filter_map);
|
||||
g.gloc_filter_map = (struct opvar *) 0;
|
||||
selection_free(g.gloc_filter_map);
|
||||
g.gloc_filter_map = (struct selectionvar *) 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user