Commit Graph

18 Commits

Author SHA1 Message Date
Pasi Kallinen
fd55d9118e 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.
2019-11-06 18:43:20 +02:00
PatR
fc2f2c51a4 VMS system.h bit
Avoid some duplicate declarations for VMS.  The one for lseek()
has become an issue--not fixed here--and this narrows it down to
one place.
2019-02-15 14:10:09 -08:00
nhmall
4228cf534e follow-up bits 2018-11-20 19:09:05 -05:00
Bart House
8799f05904 Fix lrand48 and srand48 declarations. 2018-11-20 10:26:09 -08:00
keni
d8c49ec9d1 Add updated copyright lines, part 1. 2018-04-25 15:00:13 -04:00
PatR
64f284dd61 USE_OLDARGS update (1 of 2)
Files modified:
    include/tradstdc.h, sp_lev.h, system.h
    util/lev_main.c

Silence a bunch of warnings generated by recent gcc which weren't there
with whatever version I had when 3.6.0 was being readied for release.
For lev_main, there were two basic types:  not enough arguments in calls
to lc_pline, lc_warning, and lc_error (since we weren't passing dummy
arguments as is done for add_opvars), and conversion from 'int' or
narrower to 'char *' (from -Wint-to-pointer-cast, which either wasn't
there yet in the older gcc, or wasn't included in -Wall back then).
[Note that for any configuration decrepit enough to actually need
USE_OLDARGS, such conversions will either work fine or else nethack
simply won't be viable.]

src/pline.c generates a bunch of warnings (for USE_OLDARGS).  The fix
for that will be (2 of 2).

To test, instead of mucking about with CFLAGS or sys/unix/hints, I've
been temporarily adding unconditional
|#undef USE_STDARG
|#undef USE_VARARGS
|#define USE_OLDARGS
to the end of config1.h and then doing my normal build--which is why
-Wall (or possibly -W) is drawing -Wint-to-pointer-cast warnings.
2017-08-02 18:23:42 -07:00
PatR
3c5cb6ae5c malloc/realloc for makedefs
Use of malloc() and realloc() has been added to makedefs but they
weren't being declared anywhere if <stdlib.h> is not available.
2015-12-04 14:56:14 -08:00
Sean Hunt
1c081b1647 Remove stale version control lines. 2015-05-25 09:21:31 +09:00
Sean Hunt
8b57d96fd2 Reformat .h files.
I did my best to exempt some of the bigger aligned blocks from the reformatting
using the /* clang-format off */ and /* clang-format on */ tags. Probably some
that shouldn't have been formatted were anyway; if you encounter them, please
fix.

The clang-format tags were left in on the basis that it's much easier to prune
those out later than to put them back in, and it means that, modulo my custom
version of clang-format, I should be able to run clang-format on the source tree
again without changing anything, now that Pat has fixed the VA_DECL issues.
2015-05-25 09:21:15 +09:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
keni
03140969ee Bulk recovery of file CVS headers and addition of NHDT- headers. 2015-02-26 09:19:03 -05:00
keni
df20791e59 Add RCS version lines 2009-05-06 10:45:32 +00:00
nethack.allison
c146fe012d housekeeping: mark trunk sources 3.5 (include) 2005-01-02 16:50:12 +00:00
nethack.rankin
b56641dc2e status bits
Declare structure before using it in prototypes, and declare atol()
for configurations which don't have or don't use <stdlib.h>.  (Some
#ifdef MICRO code for atoi at the end of system.h might need to be done
for atol too.)
2003-11-30 11:04:54 +00:00
cohrs
362518c3ac BSD and POSIX
Finally got around to installing OpenBSD (rev 3.3) in a vmware partition.
Found that several #if BSD's were inappropriate for modern BSD's.  Haven't
installed FreeBSD or NetBSD, but based on reading their man pages,
these changes are needed there too.  Mostly due to POSIX time() signature.
2003-07-06 22:06:46 +00:00
cohrs
702c373619 untested FreeBSD compilation fix
this particular fix has been sitting around my inbox for a while although
we've had reports of FreeBSD build problems for a long time.  While it's
untested, it certainly looks like the unfixed system.h had a case that
could not be reached.  bsdi seems like it needs to be handled the same way.
2003-05-25 19:03:55 +00:00
nethack.allison
06528d1002 3.3.2 to 3.4.0 2002-02-04 16:06:00 +00:00
jwalz
bc349822bf *** empty log message *** 2002-01-05 21:05:48 +00:00