NHOrus
9e2cb3c191
Put some of important parameters into fixed width signed integers
...
Massaged test files. Fixes issue #41
2017-09-11 00:58:13 +03:00
NHOrus
43f0cb232b
Silenced fallthrough warning
2017-09-05 18:32:56 +03:00
NHOrus
96ead306b5
Prevent RNG overflow.
...
Pass save under validation by pointer, so we could mess with underlying
values a little. Only thing I feel we can safely and sanely modify.
2017-09-05 18:20:21 +03:00
NHOrus
0dd40bba32
Removed old copy-paste error
...
Put numdie bounds check in croak to prevent OOB access on negative
numdie while preserving tests
2017-09-05 17:46:38 +03:00
NHOrus
e5a0c6e2b7
Prevent tampering with PRNG parameters in save
2017-08-24 14:48:02 +03:00
NHOrus
917af2e744
Fixed copy-paste errors
2017-08-24 14:41:21 +03:00
NHOrus
17d94c46cd
Prevent division by zero
2017-08-24 14:25:29 +03:00
NHOrus
25424a01db
Verify bounds for linked lists
2017-08-24 13:47:57 +03:00
NHOrus
5e39abf730
Corrected limit for atloc, see init.c for filling double-linked list
2017-08-24 13:40:10 +03:00
NHOrus
aeaa0400cb
Fix value, add check for linked locations
2017-08-24 13:02:51 +03:00
NHOrus
98b21323a6
Bounds check for properties; it is not violated in normal game
2017-08-24 11:21:10 +03:00
NHOrus
f496bff945
Syntax error
2017-08-13 15:58:35 +01:00
NHOrus
ad9c53abdb
Validate dwarves and tally
2017-08-13 15:56:37 +01:00
NHOrus
f0dc3d3b7c
Verify sanity of location arrays
2017-08-13 15:16:09 +01:00
NHOrus
36f72f1902
Validating sanity of locations in restored game
2017-08-13 15:13:20 +01:00
Jason S. Ninneman
26bf324e07
Use the '=' operator (not memcpy()) to shallow-copy structs.
2017-08-03 12:41:35 -07:00
NHOrus
63152e6714
Broke all logical or into multiline statement to show lcov's lies
...
Results are weird, some things that need to be checked aren't and
at least my local lcov doesn't show them as unchecked
2017-07-03 07:20:37 +03:00
Jason S. Ninneman
73278b1a3c
Bump save file version number.
...
Also add missing space in the version mesage.
2017-07-02 09:55:53 -07:00
Jason S. Ninneman
d23111daba
Replace datime() with just time().
...
Also make the 'savetime' value meaningful.
This removes a separate library dependency on some systems.
2017-07-02 09:46:01 -07:00
Aaron Traas
85f8334e17
centralize calls to make_zzword()
...
make_zzword() now called in set_seed(), because the only times it was
called in the entire application is after every invocation of set_seed().
2017-07-02 02:02:09 -04:00
Jason S. Ninneman
ad3b097c9e
Replace linenoise with libedit in code and build.
2017-07-01 07:22:53 -07:00
Eric S. Raymond
58b44313d3
Without IGNORE, -Wunused-result throws a warning on fread(2).
...
I've seen it happen on fwrite(2) as well; wrapping that as well in
case some compiler decides to be finicky.
2017-07-01 08:35:05 -04:00
Jason S. Ninneman
8bc08773fa
Various cleanups.
...
* Remove disused macro.
* GCC doesn't seem to mind if IGNORE() is left off.
* Enumify phase codes.
* Use EXIT_* macros in all exit() calls.
* How did this even work without extern?
* Give advent.h a much-needed makeover.
* Use the chomp indicator in YAML string blocks to avoid code ugliness.
2017-07-01 03:19:33 +00:00
NHOrus
0f15c9e0f3
Breaking one-line conditionals
2017-06-29 22:51:30 +03:00
NHOrus
bf2fa227f0
Unshadowed k2 into k3 in main.c
...
Reindented everything
2017-06-29 20:11:53 +03:00
Jason S. Ninneman
1ee0e5c7b0
Finish newdb -> dungeon renaming.
2017-06-29 08:54:55 -07:00
Jason S. Ninneman
83fb64b5a8
Jettison MAKEWD(), GETTXT(), vocab(), GETIN(), and the old db compiler.
2017-06-29 08:54:35 -07:00
Jason S. Ninneman
50435465a6
Completely wire vocab words in YAML to the code.
...
This massive patch:
* Finishes working all the vocab words into YAML structures.
* Adds vocab ID generator functions.
* Redoes the input-getting system, removing the need for GETIN(),
GETTXT(), etc.
* Changes advent<->ascii mapping to avoid the special 'shift'
character.
* Works around some bad behavior in the dragon attack logic.
* Handles the reservoir magic word without changing the database
contents.
2017-06-29 01:59:37 -07:00
Aaron Traas
0a30176a8c
Allow cheat to generate save files with bogus numbers.
...
Also remove pre-built save file for resumefail.log
2017-06-27 16:13:49 -04:00
Eric S. Raymond
d6cb6f0d8d
Create a cheater to test strange save/resume cases.
...
Patch due to Aaron Traas, but needed modification because of code
drift since submission.
2017-06-26 15:07:09 -04:00
Eric S. Raymond
59243cf8bc
Take FORTRANish upper-case function names to C-style lowercase...
...
...except for a few we're planning to get rid of. This will avoid some
upcoming collisions with macros defined from YAML.
2017-06-26 10:19:33 -04:00
Eric S. Raymond
ea70341cfe
Eliminate setting of OBJTXT sell for oyster - OBJTXT is now static.
...
A necessary step towards getting rid of it.
2017-06-23 15:50:15 -04:00
Eric S. Raymond
15b7c00e0a
Abolish unclean operation on OBJSOUND - it's now static.
...
Save/Restore no longer needs to treat it specially.
2017-06-23 15:13:47 -04:00
Peje Nilsson
deb61e3dcd
Replace SETPRM/[PR]SPEAK with variadic [pr]speak
...
Rename/rewrite old speak to vspeak and take a va_list
Add new speak that takes variadic parameters
Remove SETPRM & PARMS[]
2017-06-21 13:14:53 -04:00
Jason S. Ninneman
624ba16aad
Change YES() to take const char* arguments.
2017-06-18 19:51:59 -07:00
Bob Little
04eca720d9
magic numbers, show usage, fixed linty warnings
...
Show usage when using bad parameter with ./advent
Converted magic numbers to enums for BUG(). Also bug now shows
stringify'ed version of bug enumeration (not just a number).
2017-06-18 19:33:21 -04:00
Jason S. Ninneman
550734fd3f
Gut and rebuild YES() with cleaner approach that doesn't rely on packing.
...
The new support functions get_input() and echo_input() (and others not made yet) will eventually replace GETIN() and MAPLIN().
2017-06-18 13:39:59 -07:00
Eric S. Raymond
b3057f038b
Re-format to consistent indent style with "make indent".
2017-06-18 06:18:51 -04:00
NHOrus
a37e578f63
Compile switch to disable save and restore
2017-06-18 10:37:51 +03:00
NHOrus
a0a35d8c7b
Improved docs, fixed identation
2017-06-17 11:09:55 -04:00
NHOrus
300d246179
Resume from file on startup
2017-06-17 09:20:42 +03:00
Peje Nilsson
a6feda5307
Split saveresume to reduce complexity
...
Fixed a bug where current time was printed as version of advent
when loading an old savegame.
2017-06-16 14:16:02 -04:00
Eric S. Raymond
a141f021d5
Meaningful shortnames for RSPEAK messages.
2017-06-15 07:35:03 -04:00
Eric S. Raymond
1d37262a16
More ARB tagging.
2017-06-15 07:16:39 -04:00
Eric S. Raymond
fef9657e3e
Move from random message numbers to ARB_* symbols generate from YAML.
2017-06-14 17:36:30 -04:00
NHOrus
46bb20deb3
Lowering the scope And cleaning up some warnings from static analysis
2017-06-14 15:17:02 -04:00
Eric S. Raymond
fdd72c6417
Fix a minor memory leak.
2017-06-14 08:50:41 -04:00
Eric S. Raymond
a02b387999
FORTRAN line numbers returned from action() become action symbols.
2017-06-12 14:42:04 -04:00
Eric S. Raymond
2576613759
Readability tweak.
2017-06-11 11:28:30 -04:00
Eric S. Raymond
62e1fddd1d
Cosmetic fix: blank line before filename prompt...
...
...in the style of the original.
2017-06-10 07:19:26 -04:00