]> granicus.if.org Git - nethack/log
nethack
7 years agoMaster Key of Thievery warns about undetected traps
Pasi Kallinen [Thu, 5 Oct 2017 22:14:00 +0000 (01:14 +0300)]
Master Key of Thievery warns about undetected traps

If the key is wielded and touching skin (that is, you're not
wearing gloves), it will give heat-related messages like
minesweeper, counting the undetected traps around player.

7 years agountrap() formatting bits
PatR [Thu, 5 Oct 2017 09:38:25 +0000 (02:38 -0700)]
untrap() formatting bits

7 years agoSTATUS_HILITES vs multiple interface binary
PatR [Thu, 5 Oct 2017 09:01:18 +0000 (02:01 -0700)]
STATUS_HILITES vs multiple interface binary

My tty+X11 binary was letting me see and modify status highlights under
X11 even though they don't do anything.  Options parsing has to accept
them since we don't know which interface will be chosen, but interactive
option handling does know and shouldn't show inappropriate options.

initoptions_finish() should probably we validating all the wc and wc2
options, but I only added a check for trying to enable statushilites
when they're unavailable.

7 years agoset_uasmon
PatR [Thu, 5 Oct 2017 01:18:21 +0000 (18:18 -0700)]
set_uasmon

Noticed while looking at something else, merging status highlighting
changes introduced a redundant call to polysense() in set_uasmon().

7 years agooptions vs !BACKWARD_COMPAT
PatR [Thu, 5 Oct 2017 00:51:48 +0000 (17:51 -0700)]
options vs !BACKWARD_COMPAT

Give sensible feedback for obsolete options if options.c is modified
to #undef BACKWARD_COMPAT.  Affects boulder, DECgraphics, IBMgraphics,
and MACgraphics.

7 years agoMerge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Wed, 4 Oct 2017 23:58:42 +0000 (19:58 -0400)]
Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0

7 years agoreference the added file sys/msdos/vesa.h in Files
nhmall [Wed, 4 Oct 2017 23:57:31 +0000 (19:57 -0400)]
reference the added file sys/msdos/vesa.h in Files

7 years agomissed file in vesa inclusion back in 2016
nhmall [Wed, 4 Oct 2017 23:55:40 +0000 (19:55 -0400)]
missed file in vesa inclusion back in 2016

7 years agoCleaver can hit three monsters with one swing
Pasi Kallinen [Wed, 4 Oct 2017 19:01:03 +0000 (22:01 +0300)]
Cleaver can hit three monsters with one swing

When hitting a monster with the Cleaver, you swing it in an
arc, possibly hitting the monsters to the left and right of
the targeted monster.

Based on code by Fredrik Ljungdahl

7 years agofirst build in a long while, clear up a warning
nhmall [Wed, 4 Oct 2017 16:21:05 +0000 (12:21 -0400)]
first build in a long while, clear up a warning

..\src\options.c(4005) : warning C4113: 'int (__cdecl *)()' differs in parameter lists from 'int (__cdecl *)(void)'

7 years agofeature options (#version output)
PatR [Tue, 3 Oct 2017 01:25:09 +0000 (18:25 -0700)]
feature options (#version output)

I've sometimes seen
  , and basic NetHack features.
as the last line of the features section from '#version'.  I thought
it was due to the way feature phrases were split into individual words
by makedefs, but it turned out to be due to inserting pattern matching
method at run-time.  That dynamic options update had a second problem:
if the final phrase "and basic NetHack features" was split across two
lines, the run-time substitution didn't find it and the pattern matching
entry ended up being left out.  This fixes both problems, but if future
dynamic entries become more complex, the phrase-splitting/word-wrapping
being done by makedefs may need to be moved into nethack.

Also, add entries for XLOGFILE and PANICLOG to makedefs' options and
re-order a couple of existing ones alphabetically (a failry hopeless
endeavor).

7 years agomore !STATUS_HILITES - option parsing
PatR [Mon, 2 Oct 2017 01:49:47 +0000 (18:49 -0700)]
more !STATUS_HILITES - option parsing

When built without STATUS_HILITES, don't treat highlighting options as
if they were unknown.  This may need some tweaking; the feedback feels
a bit intrusive so perhaps 'statushilites' and 'hilite_status' should
just be ignored when not available.

'hitpointbar' now relies on wc2 handling instead of being conditionally
present.

7 years ago!STATUS_HILITE warning fixes
PatR [Mon, 2 Oct 2017 00:20:30 +0000 (17:20 -0700)]
!STATUS_HILITE warning fixes

Mostly declarations of static functions which don't exist (due to being
conditionally excluded).  One unused local variable.

7 years agoyet another comment typo
PatR [Sun, 1 Oct 2017 23:51:07 +0000 (16:51 -0700)]
yet another comment typo

7 years agohmon() arg fix
PatR [Sun, 1 Oct 2017 15:16:56 +0000 (08:16 -0700)]
hmon() arg fix

The call to hmon() in flooreffects() was passing a boolean where int
is expected.  The 'thrown' argument may have once been a boolean, but
it is 'int' for as far back as the repository history goes.

7 years agoDefault status hilites for Windows
Pasi Kallinen [Sun, 1 Oct 2017 14:44:41 +0000 (17:44 +0300)]
Default status hilites for Windows

7 years agoAddressing bug with the use of static dieroll in uhitm.c.
Bart House [Mon, 25 Sep 2017 06:24:36 +0000 (23:24 -0700)]
Addressing bug with the use of static dieroll in uhitm.c.

7 years agoFix flashing issue that is seen with STATUS_HILITES in Windows port.
Bart House [Sun, 1 Oct 2017 01:14:33 +0000 (18:14 -0700)]
Fix flashing issue that is seen with STATUS_HILITES in Windows port.

7 years agoGive feedback when released from a bear trap
Pasi Kallinen [Thu, 28 Sep 2017 19:38:04 +0000 (22:38 +0300)]
Give feedback when released from a bear trap

7 years agohitpointbar is also available on Windows GUI
Pasi Kallinen [Tue, 26 Sep 2017 14:45:25 +0000 (17:45 +0300)]
hitpointbar is also available on Windows GUI

7 years agoUse the existing othropt options array for the menu items
Pasi Kallinen [Tue, 26 Sep 2017 07:58:26 +0000 (10:58 +0300)]
Use the existing othropt options array for the menu items

7 years agoHilite Status: Improved
Pasi Kallinen [Tue, 26 Sep 2017 07:04:19 +0000 (10:04 +0300)]
Hilite Status: Improved

Allow defining multiple stops per field. Add hitpointbar.

7 years agodoname() bookkeeping
PatR [Tue, 26 Sep 2017 00:17:06 +0000 (17:17 -0700)]
doname() bookkeeping

doname() for a corpse was using two obufs instead of just one.

7 years agoanother comment typo
PatR [Mon, 25 Sep 2017 20:27:12 +0000 (13:27 -0700)]
another comment typo

7 years agocandelabrum weight and burn out
PatR [Mon, 25 Sep 2017 20:20:30 +0000 (13:20 -0700)]
candelabrum weight and burn out

Adjust the Candelabrum of Invocation's weight when it has candles
attached.  This has been a known issue ever since the candelabrum and
candles were introduced.

When the candelabrum burns out, update persistent inventory window to
show that it no longer has candles.

7 years agovomit countdown comment typo
PatR [Mon, 25 Sep 2017 18:15:29 +0000 (11:15 -0700)]
vomit countdown comment typo

A word got left out.

7 years agofix #H6104 - no potion handling in thitu()
PatR [Mon, 25 Sep 2017 17:42:43 +0000 (10:42 -0700)]
fix #H6104 - no potion handling in thitu()

thitu() is mostly used for arrows and darts "thrown" by traps, but
scatter() uses it on items launched by a land mine explosion.  Traps
had no need for potion handling, but scattering does.  Changing thitu()
to call potionhit() required that more information be passed to the
latter in case killer reason was needed, and thitu()'s callers needed
to be updated since it now might use up its missile (only when that's
a potion, so scatter() is only caller which actually needed to care).

Quite a bit of work--especially the testing--for something which will
never be noticed in actual play.  In hindsight, it would have been
much simpler just to make scatter destroy all potions rather than
allow the 1% chance of remaining intact (via obj_resists()), or else
leave any intact ones at the explosion spot instead of launching them.

7 years agoAdd option to make commands ask an inventory item via menu
Pasi Kallinen [Sat, 23 Sep 2017 19:47:09 +0000 (22:47 +0300)]
Add option to make commands ask an inventory item via menu

Turning the boolean option force_invmenu makes all the commands
that ask for an inventory item pop up a menu instead of asking
a text query.  This should be much more friendlier to new
players, and is very useful for window ports on systems
with touch screens and no physical keyboard, such as cell phones.

7 years agomore vomit countdown
PatR [Fri, 22 Sep 2017 22:42:29 +0000 (15:42 -0700)]
more vomit countdown

The new "You vomit!" message shouldn't happen if you're polymorphed
into a rat.

The old "You gag unconrolably!" message misspelled "uncontrollably".

7 years agovulnerable items thrown into lava
PatR [Fri, 22 Sep 2017 22:08:42 +0000 (15:08 -0700)]
vulnerable items thrown into lava

Reported directly to devteam, player threw a troll corpse into lava and
then later got messages about it reviving and burning to death.  Items
thrown, kicked, or dropped into lava were being subjected to fire damage
(so scrolls burned up, potions boiled, non-fireproofed flammable weapons
and armor eroded), but corpses and a lot of other stuff not subject to
erosion remained unaffected.  This makes things that are made out of
wood, cloth, flesh and other flammable stuff burn up (when in lava, not
when hit by fire).

7 years agoFix mention_walls reporting secret doors as solid stone
Pasi Kallinen [Fri, 22 Sep 2017 13:31:31 +0000 (16:31 +0300)]
Fix mention_walls reporting secret doors as solid stone

7 years agofix #H4919 - vomit message sequencing
PatR [Thu, 21 Sep 2017 23:35:56 +0000 (16:35 -0700)]
fix #H4919 - vomit message sequencing

The countdown for delayed vomiting gave message "you suddenly vomit!"
at T-2, allowing you to move some more, then vomit at T-0 with no
message, finally at T+2 get "you can move again", making it seem as
if the program was letting you move during a time it thought that you
couldn't move.  Also, there was nothing "sudden" about it since it was
near the end of a 15 or so turn sequence where a few other messages
are given leading up to that.

Change it to
T-2: You are about to vomit.  // different wording
T-0: You vomit!               // new message
so that "you can move again" more clearly refers to the actual event.

7 years ago'nulls[]' vs saving traps and fruit
PatR [Thu, 21 Sep 2017 22:30:24 +0000 (15:30 -0700)]
'nulls[]' vs saving traps and fruit

It was once pointed out that
  static long nulls[ sizeof (struct trap) + sizeof (struct fruit) ];
should have been
  static long nulls[ max(sizeof (struct trap), sizeof (struct fruit)) ];
which is right, but using an array of longs to represent a null trap or
null fruit doesn't handle pointers properly so replace 'nulls' with
separate structs.  This doesn't recover the previously wasted memory
(fairly trivial since these structs are small) but does guarantee that
null pointers in the relevant structs always have a valid value instead
of just all bits zero.

7 years ago'#' command fix for 'extmenu'
PatR [Thu, 21 Sep 2017 01:52:53 +0000 (18:52 -0700)]
'#' command fix for 'extmenu'

While doing some cleanup I found an old personal bug list with four
entries.  Two have already been fixed, or at least I couldn't reproduce
them with current code, one is still pending (dungeon overview feedback
is inconsistent if you find an unlit temple and haven't seen its altar
yet), plus this one:  a buffer overflow (triggering a crash for me) in
wizard mode if you turn on the 'extmenu' option and start an extended
command.  The menu can't handle long line width for 'w' with all its
wizthis and wizthat entries; strcat() goes out of bounds writing into
a local array.

(This bug predates the keybinding patch that turned all commands into
extended commands.)

7 years agoLint for strncpy return value
Pasi Kallinen [Tue, 19 Sep 2017 11:12:10 +0000 (14:12 +0300)]
Lint for strncpy return value

7 years agoFix possible buffer overrun
Pasi Kallinen [Tue, 19 Sep 2017 11:08:58 +0000 (14:08 +0300)]
Fix possible buffer overrun

7 years agoWin32GUI: Prevent ampersand-escaped mnemonics in menus
Pasi Kallinen [Mon, 18 Sep 2017 12:30:52 +0000 (15:30 +0300)]
Win32GUI: Prevent ampersand-escaped mnemonics in menus

7 years agoChange some regex stuff to use config errors
Pasi Kallinen [Sun, 17 Sep 2017 10:43:48 +0000 (13:43 +0300)]
Change some regex stuff to use config errors

7 years agoShow regex error before asking for color
Pasi Kallinen [Sun, 17 Sep 2017 10:20:25 +0000 (13:20 +0300)]
Show regex error before asking for color

When entering a new menucolor via options, show regex error
immediately afterwards, instead of asking for color and attribute
before showing the error.

Also actually show config errors even if config error handler
hasn't been initialized.

7 years agoWin32GUI: Allow empty separator lines in menus
Pasi Kallinen [Sun, 17 Sep 2017 09:17:46 +0000 (12:17 +0300)]
Win32GUI: Allow empty separator lines in menus

7 years agoRead symbols with config file handler
Pasi Kallinen [Sun, 17 Sep 2017 07:15:04 +0000 (10:15 +0300)]
Read symbols with config file handler

Also, make config file error handler able to cope with recursion.

7 years agoFix invisible gold symbol in status lines
Pasi Kallinen [Sat, 16 Sep 2017 20:49:28 +0000 (23:49 +0300)]
Fix invisible gold symbol in status lines

7 years agoShow in wizmode level teleport menu your current location
Pasi Kallinen [Sat, 16 Sep 2017 15:17:56 +0000 (18:17 +0300)]
Show in wizmode level teleport menu your current location

7 years agofix #H6042 - leash use while engulfed
PatR [Sat, 16 Sep 2017 07:43:03 +0000 (00:43 -0700)]
fix #H6042 - leash use while engulfed

Prevent using a leash while engulfed.  If someone wants to supply a
better message, go ahead.  I just tried to get the logic straight.
(The new swallowed part is easy; the previous lack of handling for
remembered unseen monsters wasn't quite so easy.)

Applying a leash was always using a move, even if player cancelled
at the prompt to pick an adjacent monster.  Now some of the early
exits don't use a move.

7 years agoRemove overview for wizmode regenerated map
Pasi Kallinen [Fri, 15 Sep 2017 11:45:51 +0000 (14:45 +0300)]
Remove overview for wizmode regenerated map

The wizmakemap command throws away the current level, so don't keep
the overview data for it around.

7 years ago'fix' #H5531 - breath damage
PatR [Fri, 15 Sep 2017 11:34:05 +0000 (04:34 -0700)]
'fix' #H5531 - breath damage

For breath damage, the 'S' in NdS is ignored.  'N' for the number of
dice is used, but for number of sides of those dice, 6 is used for
most damage types.  Add a comment to that effect to monst.c and change
a few Nd8 to Nd6 so that viewing the monster definitions matches what
they actually do.

7 years agozap.c formatting
PatR [Fri, 15 Sep 2017 11:33:09 +0000 (04:33 -0700)]
zap.c formatting

7 years agoUse symbolic names for shop repair costs
Pasi Kallinen [Thu, 14 Sep 2017 18:04:56 +0000 (21:04 +0300)]
Use symbolic names for shop repair costs

...and add costs to two places where the door you touched
blew up (picking the lock and opening the door).

7 years agoMinor reformat, fix warnings
Pasi Kallinen [Thu, 14 Sep 2017 11:40:11 +0000 (14:40 +0300)]
Minor reformat, fix warnings

7 years agoMove BoH item loss into separate function
Pasi Kallinen [Thu, 14 Sep 2017 11:11:09 +0000 (14:11 +0300)]
Move BoH item loss into separate function

7 years agofix #H5856 - Amulet draining energy
PatR [Thu, 14 Sep 2017 07:57:50 +0000 (00:57 -0700)]
fix #H5856 - Amulet draining energy

The sequence
  You feel the amulet draining your energy away.
  You don't have enough energy to cast that spell.
didn't use any energy or cost any time so the player could try over
and over until the randomly chosen drain amount happened to be low
enough to succeed.

The old behavior was that the cost of the current cast attempt got
incresed by a random amount.  Now, if hero already lacks sufficient
energy to cast the spell, the Amulet's effect won't take place, the
second message will be given, and no energy or time will be consumed.
When there is enough energy to cast the spell, the drain effect will
occur and some energy will be used up immediately (instead of
increasing the cost of this attempt).  The energy drain might then
result in the second message, but if so, a turn will be used.

No longer increasing the energy cost of the current cast has a
side-effect on not increasing the hunger penalty for the current cast
(since that is based on the energy cost) but the energy drain message
doesn't actually imply any effect on hunger.

7 years agosys/unix/*.c formatting and PANICTRACE fix
PatR [Wed, 13 Sep 2017 22:33:43 +0000 (15:33 -0700)]
sys/unix/*.c formatting and PANICTRACE fix

I started out just reformatting the function header for regularize()
but ended up doing miscellaneous other stuff, including some code
changes.  I think the CHDIR code is a bit cleaner now, but shouldn't
have any differences in behavior.

Along the way I noticed that 'nethack -dpath' or 'nethack -d path'
modifies argv[] before PANICTRACE attempted to save argv[0], so would
break having nethack invoke gdb to get a backtrace.  ('ARGV0' seems to
be unnecessary since 'hname' holds the same value, but I didn't get rid
of it....)

7 years agoFix more warnings
Pasi Kallinen [Wed, 13 Sep 2017 11:12:38 +0000 (14:12 +0300)]
Fix more warnings

7 years agoWin32GUI: Allow toggling mouse_support off
Pasi Kallinen [Wed, 13 Sep 2017 11:02:40 +0000 (14:02 +0300)]
Win32GUI: Allow toggling mouse_support off

Prevents accidental mouse clicks on the map

7 years agoFix compile warnings
Pasi Kallinen [Wed, 13 Sep 2017 10:59:25 +0000 (13:59 +0300)]
Fix compile warnings

7 years agowarning feedback
PatR [Wed, 13 Sep 2017 10:39:19 +0000 (03:39 -0700)]
warning feedback

When polymorphed into a vampire, I saw an '@' in the distance, and
examining that with the cursor yielded "[seen: warned of shopkeepers]".
Fix that to be "warned of humans".  (Vampires are warned of "humans
and elves" but this is a place where being more specific seems better.)

7 years agoconfig parse return values and error msgs
Pasi Kallinen [Wed, 13 Sep 2017 10:26:37 +0000 (13:26 +0300)]
config parse return values and error msgs

7 years agoHandle config file reading at single function
Pasi Kallinen [Wed, 13 Sep 2017 09:20:20 +0000 (12:20 +0300)]
Handle config file reading at single function

The function handles comments, empty lines, config sections,
CHOOSE, and line continuation, while calling another function
for other lines.

Currently used for config file, sysconf, and WIZKIT.

7 years agoaddress #H5931 - bug with shape-shifted vampires
PatR [Wed, 13 Sep 2017 01:40:14 +0000 (18:40 -0700)]
address #H5931 - bug with shape-shifted vampires

[Subject was actually "possible bug with shape-shifted vampires".]
The observation was that a pet vampire which took on fog cloud form
would just stay a fog cloud, rendering it nearly useless as a pet.
Fog clouds are too weak to attack dangerous monsters so are rarely
subject to damage from counter-attacks, so they wouldn't even get
killed to revert to vampire form.

Make a vampire in fog cloud form--hostile or tame--sometimes change
to bat form if not in view or out of missile range (the same criteria
used by vampires to change into alternate shape to begin with).  Bats
are slightly more useful as pets and definitely more prone to revert
to vampire.  The potential transformation from bat to cloud isn't
done randomly; that already occurs when encountering closed doors.

7 years agovampire shift to fog cloud
PatR [Wed, 13 Sep 2017 01:26:14 +0000 (18:26 -0700)]
vampire shift to fog cloud

If a vampire, possibly in bat form, on the far side of a closed door
shifted shape to fog cloud in order to pass under the door, you were
told about the shape change if you could see it after being placed at
the door's location even if you couldn't see the vampire's pre-move
location.  This is a bug introduced after 3.6.0....

7 years agoaddress #H5590 - paranoid_confirm vs lycanthropy
PatR [Tue, 12 Sep 2017 11:14:44 +0000 (04:14 -0700)]
address #H5590 - paranoid_confirm vs lycanthropy

Polymorph control gives the player a chance to accept or reject a form
change due to lycanthropy, but if it occurs during combat or movement
the player might type 'y' before realizing that the prompt is pending.
Provide a paranoid_confirmation setting for 'Were-change' to allow a
player to require "yes" instead of 'y' for that.

The existing setting 'wand' is renamed to 'wand-break' and now requires
at least two letters in the config file options instead of just 1.  The
spelling of its synonym is changed from 'breakwand' to 'break-wand';
it can be shorted to as few as 2 letters (same as before) but if more
than 5 are present, the new dash is required.

Both 'wand-break' and 'Were-change' are placed before 'pray' in the 'O'
menu for paranoid_confirmation so that all the "yes" vs 'y' settings
are grouped together.

Bonus fixes:
Reverting from were-critter form to human (due to timeout) did not give
a player with polymorph control the option of remaining in creature
form; now it does.
The 'O' command's menu would not show "wand" (now "wand-break") in the
current value of paranoid_confirmation.  (A post 3.6.0 issue, so no
fixes entry included.)

The revised Guidebook.mn has been tested; Guidebook.tex has not.

7 years agomuse vs wand of teleportation
PatR [Tue, 12 Sep 2017 01:58:48 +0000 (18:58 -0700)]
muse vs wand of teleportation

Reported directly to devteam, case WAN_TELEPORTATION in use_offensive()
is never used.  Disable it, although this also adds other disabled code
which would make it become used if enabled.

7 years agoonscary() vs "Elbereth"
PatR [Tue, 12 Sep 2017 01:47:26 +0000 (18:47 -0700)]
onscary() vs "Elbereth"

When checking whether hero is on a protected spot, don't check for
engraved "Elbereth" unless/until other conditions have been exhausted.

7 years agoquest artifact followup
PatR [Mon, 11 Sep 2017 23:22:14 +0000 (16:22 -0700)]
quest artifact followup

Fix a typo/thinko that ended up being magnified by copy+paste.

I did test having the artifact be carried by a monster, but it was the
nemesis who accompanied me from the level above when I level teleported
back to his lair.  He must have ended up as first monster in fmon chain
when he was placed on the level.

7 years agofix #HH5887 - Dark One / Eye message bug
PatR [Mon, 11 Sep 2017 22:59:50 +0000 (15:59 -0700)]
fix #HH5887 - Dark One / Eye message bug

Some roles' quest message when returning the nemesis lair refer to
sensing the presence/aura/whatever of the quest artifact, but it might
not be there anymore.  In reported case, the nemesis had picked it up
and later fled up the stairs to another level.  Other situations are
possible; it's feasible for the hero to already have it.  So provide
an alternate message, and some extra code to decide whether to use it.

Other anomalous messages, such as looking down on the dead body of a
nemesis who didn't leave a corpse, can still occur.

7 years agooption warnings
PatR [Sun, 10 Sep 2017 23:04:37 +0000 (16:04 -0700)]
option warnings

Fix a couple of warnings in options.c, and simplify feature_alert_opts()
in the process.

options.c:1126:30: warning: format string is not a string literal
      (potentially insecure) [-Wformat-security]
            config_error_add(buf);
                             ^~~
options.c:1667:9: warning: unused variable 'i' [-Wunused-variable]
    int i, c = NO_COLOR, a = ATR_NONE;
        ^

There are still a couple of warnings in files.c, but fixing them will
impinge open potential reversal of the CONFIG_ERROR_SECURE patch so
I've left them alone for the time being.  The second one is because
VA_START() and/or VA_INIT() do more than just declare stuff; C99 doesn't
care, but for C90 (or pre-ANSI) the local variable should be declared
before them.

files.c:2816:12: warning: address of array 'buf' will always evaluate to
      'true' [-Wpointer-bool-conversion]
          (buf && buf[0]) ? buf : "Unknown error");
           ^~~ ~~
files.c:2799:10: warning: ISO C90 forbids mixing declarations and code
      [-Wdeclaration-after-statement]
    char buf[BUFSZ];
         ^

7 years agoNo secure config errors in linux hints file
Pasi Kallinen [Sun, 10 Sep 2017 18:30:50 +0000 (21:30 +0300)]
No secure config errors in linux hints file

The linux hints file is for a single-user build, no need for this.

7 years agoSecure config errors
Pasi Kallinen [Sun, 10 Sep 2017 18:05:45 +0000 (21:05 +0300)]
Secure config errors

If user can make NETHACKOPTIONS point to a file, that user could then
get the file contents via the extended config file error reporting.
Add CONFIG_ERROR_SECURE compile-time option to make that case output
only the first error, no line number or error context.

7 years agoBand-Aid (tm) for #H5091 - old passive attack
PatR [Sat, 9 Sep 2017 23:51:38 +0000 (16:51 -0700)]
Band-Aid (tm) for #H5091 - old passive attack

Change the wording slightly if the hero simultaneously (in theory)
reverts to normal form and splahes acid on his/her attacker.  Giving
the passive counterattack message first would be better, but several
types of counterattacks need to know in advance whether the hero has
reverted, producing a chicken-vs-egg seqeuncing situation.

I also took out 'register' directives from a bunch of declarations
since they'd been pretty much applied blindly rather than in
circumstances where someone evaluated the situation and decided that
they might matter.

7 years agoformatting bit
PatR [Sat, 9 Sep 2017 23:32:30 +0000 (16:32 -0700)]
formatting bit

The formatting bit actually warranted a cast.

7 years agofix #H6015 - 'crash' on NAO
PatR [Sat, 9 Sep 2017 23:21:22 +0000 (16:21 -0700)]
fix #H6015 - 'crash' on NAO

Reported for nethack.alt.org where impossible events in to-be-3.6.1
trigger a panic instead of just a warning, being polymorphed into a
vampire and draining something to 0 HP (rather than killing it with
the bite attack) didn't properly kill off the victim unless it was
also being drained from level 0 to level -1, resulting in impossible
"dmonsfree: 1 removed doesn't match 0 pending".  If the hero got
another move before dead monsters were purged, applying a stethscope
to the victim could trigger an actual crash rather than an impossible
escalated to a panic.  Other actions such as attacking again probably
could too.

A followup included a diagnosis and one-line patch.  I expanded the
adjacent comment when manually putting the patch into place.

7 years agoLast of the config error handling
Pasi Kallinen [Sat, 9 Sep 2017 15:10:15 +0000 (18:10 +0300)]
Last of the config error handling

7 years agoEven more config error handling
Pasi Kallinen [Sat, 9 Sep 2017 14:41:08 +0000 (17:41 +0300)]
Even more config error handling

7 years agoMore options parse return values
Pasi Kallinen [Sat, 9 Sep 2017 11:03:28 +0000 (14:03 +0300)]
More options parse return values

7 years agoHandle windowtype and CHOOSE config errors
Pasi Kallinen [Sat, 9 Sep 2017 10:50:34 +0000 (13:50 +0300)]
Handle windowtype and CHOOSE config errors

7 years agoShow error on unknown line
Pasi Kallinen [Sat, 9 Sep 2017 10:25:46 +0000 (13:25 +0300)]
Show error on unknown line

7 years agoImprove config file error reporting
Pasi Kallinen [Sat, 9 Sep 2017 10:04:03 +0000 (13:04 +0300)]
Improve config file error reporting

Show the original line from the config file, followed by the line number and
a specific error message. Also show all errors from the config file before
waiting for key press.

7 years agoImprovements to build.bat scripts used to build Windows builds. Remove CRT Secure...
Bart House [Mon, 4 Sep 2017 20:41:07 +0000 (13:41 -0700)]
Improvements to build.bat scripts used to build Windows builds. Remove CRT Secure warnings.

7 years agodebug tweak
PatR [Mon, 4 Sep 2017 22:19:37 +0000 (15:19 -0700)]
debug tweak

Theoretically we still support implementations which don't have %p.
Even if we didn't, it requires a 'void *' argument rather than an
arbitrary pointer, so casts would have been needed.

7 years agoFix build errors with Visual Studio 2017 using latest SDK. We have yet another global...
Bart House [Sun, 3 Sep 2017 04:12:28 +0000 (21:12 -0700)]
Fix build errors with Visual Studio 2017 using latest SDK. We have yet another global namespace collision between window headers and nethack headers. This time it is the macro Protection that is defined before it is used in a function prototype in the windows headers.

7 years agoAdditional changes needed to support Visual Studio 2017.
Bart House [Sun, 3 Sep 2017 04:10:16 +0000 (21:10 -0700)]
Additional changes needed to support Visual Studio 2017.

7 years agoUpgrade to VS2017 and newer SDK.
Bart House [Sun, 3 Sep 2017 03:05:56 +0000 (20:05 -0700)]
Upgrade to VS2017 and newer SDK.

7 years agoFix line endings (CRLF and extra space).
Bart House [Sun, 3 Sep 2017 02:52:17 +0000 (19:52 -0700)]
Fix line endings (CRLF and extra space).

7 years agoAdding vs2015 solution file to starting set of files.
Bart House [Sat, 2 Sep 2017 23:33:44 +0000 (16:33 -0700)]
Adding vs2015 solution file to starting set of files.

7 years agoCreate initial vs2017 files from vs2015 files.
Bart House [Sat, 2 Sep 2017 23:18:37 +0000 (16:18 -0700)]
Create initial vs2017 files from vs2015 files.

7 years agoFix crash that occurs when closing application window while invetory is displayed.
Bart House [Sat, 2 Sep 2017 21:12:32 +0000 (14:12 -0700)]
Fix crash that occurs when closing application window while invetory is displayed.

7 years agoFixed compiler warhing of casting int to pointer.
Bart House [Sat, 2 Sep 2017 19:09:18 +0000 (12:09 -0700)]
Fixed compiler warhing of casting int to pointer.

7 years agoFixed compiler warning using pointer as UINT.
Bart House [Sat, 2 Sep 2017 19:08:44 +0000 (12:08 -0700)]
Fixed compiler warning using pointer as UINT.

7 years agoFix compiler warning where we cast 32bit value to pointer.
Bart House [Sat, 2 Sep 2017 18:48:32 +0000 (11:48 -0700)]
Fix compiler warning where we cast 32bit value to pointer.

7 years agoFixed coding error. strlen() returns size_t causing a size_t sized value pushed onto...
Bart House [Sat, 2 Sep 2017 18:29:23 +0000 (11:29 -0700)]
Fixed coding error. strlen() returns size_t causing a size_t sized value pushed onto stack instead of long. On x64 builds, size_t != long. Caught via compiler warning in x64 build.

7 years agoUse %p for formatted output of pointers (needed to support x86 and x64 cleanly).
Bart House [Sat, 2 Sep 2017 18:21:07 +0000 (11:21 -0700)]
Use %p for formatted output of pointers (needed to support x86 and x64 cleanly).

7 years agoRemoving unused function which also contained coding error (calling putc instead...
Bart House [Sat, 2 Sep 2017 18:06:10 +0000 (11:06 -0700)]
Removing unused function which also contained coding error (calling putc instead of fputc).

7 years agoTurning off CRT secure warnings.
Bart House [Sat, 2 Sep 2017 18:05:20 +0000 (11:05 -0700)]
Turning off CRT secure warnings.

7 years agoFix proto decl
Pasi Kallinen [Sat, 2 Sep 2017 15:51:45 +0000 (18:51 +0300)]
Fix proto decl

7 years agoRemove unused variable
Pasi Kallinen [Sat, 2 Sep 2017 12:22:42 +0000 (15:22 +0300)]
Remove unused variable

7 years agoAdd optional config file sections, selected with CHOOSE
Pasi Kallinen [Sat, 2 Sep 2017 09:04:27 +0000 (12:04 +0300)]
Add optional config file sections, selected with CHOOSE

Allows the user to define arbitrarily named optional sections
in the config file, and select which of those sections are used.

For example:

  OPTIONS=color
  CHOOSE=char A,char B

  [char A]
  OPTIONS=role:arc,race:dwa,align:law,gender:fem

  [char B]
  OPTIONS=role:wiz,race:elf,align:cha,gender:mal

7 years agoHandle the case where we continue after locking a nonexistent file
Alex Smith [Fri, 1 Sep 2017 17:49:43 +0000 (18:49 +0100)]
Handle the case where we continue after locking a nonexistent file

The previous version of this would lead to big warnings and
impossibles. This doesn't seem like a useful case, but it's still
better to have better warning messages just in case it does
happen.

7 years agoMerge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into...
Alex Smith [Fri, 1 Sep 2017 16:44:31 +0000 (17:44 +0100)]
Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0

7 years agoFix error behaviour when perm is missing
Alex Smith [Fri, 1 Sep 2017 16:43:04 +0000 (17:43 +0100)]
Fix error behaviour when perm is missing

The previous behaviour was to mention the missing file, but then to
try and fail to lock the nonexistent file 10 times, which rather
obscured the original cause of the error as it took up so much more
room on the screen.

This patch also changes the error message. Failure to lock a
nonexistent file is almost always the result of a mistake during
the install process (e.g. running from the wrong directory, or
running without an install). We should give the user a hint about
that.

7 years agoDefault menucolors for Windows
Pasi Kallinen [Fri, 1 Sep 2017 09:45:28 +0000 (12:45 +0300)]
Default menucolors for Windows