]> granicus.if.org Git - nethack/commit
more thorough rumor processing (trunk only)
authornethack.rankin <nethack.rankin>
Sat, 6 May 2006 04:55:57 +0000 (04:55 +0000)
committernethack.rankin <nethack.rankin>
Sat, 6 May 2006 04:55:57 +0000 (04:55 +0000)
commit85865eb106629cfd87403d252684f51988167370
tree3d73ea302a071ea5aa3e796c1a3902dd1aa82337
parent43690db0bc77c6605ad12193f2f1c90cdd8364ad
more thorough rumor processing (trunk only)

     To fix the gibberish rumor observed by at least a couple of players on
Windows (where if rumors.tru had <cr><lf> line ends and DLB was defined,
makedefs built a file that caused nethack to end up in the wrong place when
it reached EOF and tried to jump back to the first false rumor), change
the way that makedefs builds the rumors file.  It now will collect more
information about the true and false rumors.  Instead of one hex value on
the second line, there are nine values (three groups of three).

1,2,3;4,5,6;7,8,9

1 = number of true rumors; not previously collected and not currently used
2 = size in bytes for all true rumors (in decimal, as is #1)
3 = offset to first true rumor (in hexadecimal; not previously collected)
4,5,6 = same as 1,2,3 but for the false rumors section
7,8 = always 0 (imaginary third section has no entries, no size)
9 = offset to end-of-file (could be used for sanity checks; currently isn't)

Adding #2 with #3 yields #6; adding #5 with #6 yields #9.  The old format's
lone entry was the same as the new format's #6.  #2, #3, and #5 are values
which nethack was previously calculating on the fly after opening the file.

     This also extends rumor_check() a little bit (displays the last rumor
for both sections in addition to the first), but I think it can probably
now be demoted to ``#if 0'' and removed from the extended commands list.
src/rumors.c
util/makedefs.c