The previous USE_OLDARGS worked with gcc on Intel, but was inherently
unsafe. This method is completely safe, just obnoxiously intrusive.
It you disliked debugpline*(), you're bound to hate this....
Sean Hunt [Thu, 9 Apr 2015 17:26:43 +0000 (13:26 -0400)]
Make WALLIFIED_MAZE into a level flag.
It should now be randomly disabled for a 3rd of Gehennom, to make things
a tad more interesting there. It's also disabled in Baalzebub's lair,
to make things a little more interesting.
Pasi Kallinen [Thu, 9 Apr 2015 14:53:40 +0000 (17:53 +0300)]
Add sortloot -patch
Adds the "sortloot" compound option, with possible values
of "none", "loot", or "full". It controls the sorting of
item pickup lists for inventory and looting.
Remove the requirement for <stdarg.h> that was introduced to lev_comp.
USE_STDARG still works. USE_OLDARGS required hackery but has been
tested and actually works, although I wouldn't trust it on platforms
where 'long' and 'char *' aren't the same size. USE_VARARGS didn't
require any hackery--aside from the conversion to core's pline code--
but has not been tested: <varargs.h> supplied with OSX won't compile,
with an #error directive that basically says "switch to <stdarg.h>".
I changed several printf formats of %i and %li to %d and %ld because
I'm not sure how widespread the 'i' variant was back in days of yore.
[TODO: avoid use of snprintf since pre-ANSI systems won't have it.]
DEBUGFILES set to "wintty.c" reported a bad cursor positioning attempt
at the end of the RIP tombstone, and when set to "questpgr.c wintty.c"
reported a whole bunch right at the start of the game when enumerating
all the quest messages for the chosen role. Both were triggered by
this x==0 call to tty_curs() near the end of process_text_window().
if (i == cw->maxrow) {
if(cw->type == NHW_TEXT){
tty_curs(BASE_WINDOW, 0, (int)ttyDisplay->cury+1);
cl_eos();
}
...
The x value is always decremented in tty_curs, so passing in 0 yields
a bad value of -1. The bad call returns without doing anything, and
when DEBUG is disabled, it does so silently.
No fixes entry; it was caused by a post-3.4.3 fix for something else.
In order to get level file locking correctly again post 3.4.3
with the newer compilers for windows, I had to funnel close()
calls to an intercepting routine.
I had two choices:
1. Surround every close() in at least 9 source files with messy:
#ifdef WIN32
nhclose(fd);
#else
close(fd);
#endif
OR
2. Replace every close() with nhclose() and
deal with the special code in the nhclose()
version for windows, while just calling
close() for other platforms (in files.c).
It is also possible, although not done in this commit,
to
#define nhclose(fd) close(fd)
in a header file for non-windows, rather than funnel
though a real nhclose() function in files.c.
Derek S. Ray [Sun, 5 Apr 2015 22:04:22 +0000 (18:04 -0400)]
several fixes for farming changes
* don't let player wish for multiple globs
* use newsym() to clean up merged globs on floor
* food effects should match original corpse effects
* tidy up remaining crash when merging in place
Pasi Kallinen [Sun, 5 Apr 2015 09:17:57 +0000 (12:17 +0300)]
Add poison cloud glyph, fumaroles to fire plane.
When a gas cloud that deals damage is created, it uses
a poison cloud glyph instead of the cloud glyph.
(A bright green '#', or a bright-green recolor of the
cloud tile)
The plane of fire has random "stinking clouds", or
fumaroles, centered on lava pools.
Also make poison cloud glyph override lava, pool and
moat glyphs.
Derek S. Ray [Fri, 3 Apr 2015 17:03:55 +0000 (13:03 -0400)]
clean up handling, roll everything into merged()
it should be possible to wish for globs now; also hero's
inventory, containers, ground, monster inventories will all
honor the globbiness.
basically, any way you bring two globs together (adjacent on floor,
same inventory, same bag) should cause them to merge, combining
weight and nutrition as appropriate.
20 seems low-ish on nutrition for a pudding (kelp fronds are 30!)
at first glance but this is easy enough to fix later; don't really
want players to be able to stock up on food _this_ way and accidentally
obsolete all the other food-generation methods.
Same functionality as was recently implemented for tty. If a
character like ':' is an explicit menu selector and the player
types it, select that menu entry rather than treating it as a
search request. (Same for other menu commands like '>', but
offhand I can't think of anything besides container looting's
': - look inside' that uses any non-letter selectors other
than '$', which isn't used as a menu meta command.)
keni [Tue, 31 Mar 2015 13:50:02 +0000 (09:50 -0400)]
NHDT substitution version 2.
Re-run nhgitset.pl to install.
"perldoc DEVEL/hooksdir/nhsub" for details. General docs still to come.
Quick notes:
- "git nhsub" lets you apply substitutions to a file without involving any
version control.
- When doing nhadd/nhcommit, the working directory WILL reflect the results
of the substitutions.
Let's see what this breaks.
Pasi Kallinen [Tue, 31 Mar 2015 09:59:27 +0000 (12:59 +0300)]
Use a menu when user wants to query a glyph
When user presses '/', pop up a meny asking what the user wants to
look at:
What do you want to look at:
a - something on the map
b - something you're carrying
c - something else
This replaces the "Specify unknown object by cursor?" -prompt,
while keepng backwards compatibility, and also allows querying
about items in the inventory.
PatR [Tue, 31 Mar 2015 07:18:00 +0000 (00:18 -0700)]
add .gitignore entries: tile.h, NetHack.ad
Add a couple of missing .gitignore entries for files put into
place when building. include/tile.h is genearated for tiles
and dat/NetHack.ad is copied for X11 resource definitions.
PatR [Tue, 31 Mar 2015 06:20:45 +0000 (23:20 -0700)]
bhitpile lint bit
The 'zdir' function parameter has the same name as 'zdir' global
variable, triggering a 'shadowing' warning. I had to read the 'if'
statement multiple times to convince myself it was doing what was
intended. It was, but I think this rewrite is easier to understand
(at least for my feeble reptilian brain).
I don't know who Tim Wright is, but his 15 mintues of fame has
lasted for at least a decade so I cut his comment out. (The 28.5
year old GAN one a dozen lines lower was a tempting target for
removal, but I managed to stop myself; otherwise it never ends.)
PatR [Mon, 30 Mar 2015 23:10:14 +0000 (16:10 -0700)]
lint cleanup for tty 'gray'
gcc complained about assigning string literals to variables that aren't
const. String literals don't have const type but modifying them results
in undefined behavior, so the warning is justified. Except in this case
the strings were never being modified so if wasn't justified after all.
Switch to a static buffer anyway.
Pasi Kallinen [Mon, 30 Mar 2015 19:09:20 +0000 (22:09 +0300)]
Options to create the character blind or nudist
For those pro players who really want to try their hand
at that zen samurai, without needing to reroll thousands
of times to start with blindfold. Nudist starts without
any armor, and keeps tabs whether you wore any during
the game, for even more bragging rights.
Also makes the Book of the Dead readable even while
blind, for obvious reasons.