Commit Graph

6410 Commits

Author SHA1 Message Date
PatR
263bd05fa0 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.
2017-09-09 16:21:22 -07:00
Pasi Kallinen
a4becd6970 Last of the config error handling 2017-09-09 18:10:15 +03:00
Pasi Kallinen
b9c52ff31c Even more config error handling 2017-09-09 17:41:08 +03:00
Pasi Kallinen
873590afc1 More options parse return values 2017-09-09 14:03:28 +03:00
Pasi Kallinen
cfb09c9bf8 Handle windowtype and CHOOSE config errors 2017-09-09 13:50:34 +03:00
Pasi Kallinen
87f991ecfc Show error on unknown line 2017-09-09 13:25:46 +03:00
Pasi Kallinen
f8211f69f2 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.
2017-09-09 13:04:08 +03:00
Bart House
70ac8a12af Improvements to build.bat scripts used to build Windows builds. Remove CRT Secure warnings. 2017-09-05 13:14:13 +03:00
PatR
056ac5fe64 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.
2017-09-04 15:19:37 -07:00
Bart House
51f7cb5e9d 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. 2017-09-04 12:56:20 +03:00
Bart House
1bc3cbac7f Additional changes needed to support Visual Studio 2017. 2017-09-04 12:56:20 +03:00
Bart House
8a5351c079 Upgrade to VS2017 and newer SDK. 2017-09-04 12:56:20 +03:00
Bart House
3614059379 Fix line endings (CRLF and extra space). 2017-09-04 12:56:20 +03:00
Bart House
5b08481637 Adding vs2015 solution file to starting set of files. 2017-09-04 12:56:19 +03:00
Bart House
ceaf2f6109 Create initial vs2017 files from vs2015 files. 2017-09-04 12:56:19 +03:00
Bart House
be4e0992e6 Fix crash that occurs when closing application window while invetory is displayed. 2017-09-04 12:52:18 +03:00
Bart House
497a0b47c8 Fixed compiler warhing of casting int to pointer. 2017-09-04 12:41:53 +03:00
Bart House
4a4193ab37 Fixed compiler warning using pointer as UINT. 2017-09-04 12:41:53 +03:00
Bart House
c9a82e8ae6 Fix compiler warning where we cast 32bit value to pointer. 2017-09-04 12:41:53 +03:00
Bart House
878a18388c 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. 2017-09-04 12:41:53 +03:00
Bart House
ee61f1b730 Use %p for formatted output of pointers (needed to support x86 and x64 cleanly). 2017-09-04 12:41:53 +03:00
Bart House
1374d148d7 Removing unused function which also contained coding error (calling putc instead of fputc). 2017-09-04 12:41:53 +03:00
Bart House
78bee88b83 Turning off CRT secure warnings. 2017-09-04 12:41:53 +03:00
Pasi Kallinen
697d2953ff Fix proto decl 2017-09-02 18:51:45 +03:00
Pasi Kallinen
27b483c1a8 Remove unused variable 2017-09-02 15:22:42 +03:00
Pasi Kallinen
bfad877fba 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
2017-09-02 12:21:51 +03:00
Alex Smith
a2f886c665 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.
2017-09-01 18:49:43 +01:00
Alex Smith
49ddedc138 Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0 2017-09-01 17:44:31 +01:00
Alex Smith
1d4b6aae40 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.
2017-09-01 17:43:04 +01:00
Pasi Kallinen
26328d28ab Default menucolors for Windows 2017-09-01 12:45:28 +03:00
Pasi Kallinen
ecdebff121 Typofix 2017-09-01 12:20:21 +03:00
Bart House
b54382ec78 Improvements to Visual Studio 2015 build. 2017-09-01 12:14:10 +03:00
Bart House
f9a6cf2bf7 Improvements to Visual Studio 2015 build. 2017-09-01 12:14:04 +03:00
Bart House
77bd37b435 Visual Studio 2015 build improvements. 2017-09-01 12:13:58 +03:00
Bart House
98266801b6 Improve Visual Studio 2015 build. 2017-09-01 12:13:52 +03:00
Bart House
e5dadd525f Visual Studio 2015 build improvements. 2017-09-01 12:13:30 +03:00
Bart House
5a4df357ab Improvements to vs2015 build. 2017-09-01 12:12:58 +03:00
Pasi Kallinen
ffb3f12997 Fix pile display when picking up items while invisible
Reported directly to the devteam. Set hilite_pile on, become
invisible, pick up all but one item from a pile on the floor,
the pile symbol was still there afterwards.

This is yet another case of evil hack, because the gbuf doesn't
distinguish between object piles and single items, see
commit 854fe40609
2017-09-01 09:43:36 +03:00
PatR
06d211f75c rogue starting invent: +9 lock pick
Reported directly to devteam, the starting inventory for rogue chars
specified that their lock pick be +9, but the 'spe' enchantment field
is meaningless for that type of item.  A followup report indicated that
it had been this way since at least the 3.0 era.

It might have been a typo, since 9 and 0 are next to each other.  Or
perhaps before lock picks were introduced, rogues started with a
skeleton key.  That assumes spe==9 meant skeleton key back in the days
when each key and lock had a designated shape and a non-skeleton key
had to match the lock's shape to work.  I don't know whether that was
how skeleton keys were flagged and don't care eough to delve deeper....
2017-08-28 15:56:16 -07:00
Pasi Kallinen
7e793a09d7 Add database entry for "martial arts" the skill 2017-08-28 20:40:41 +03:00
Pasi Kallinen
30aea05f47 Minor Guidebook tweakage 2017-08-24 22:59:46 +03:00
Pasi Kallinen
23be1b81d2 Typofix in Guidebook.tex 2017-08-24 10:34:37 +03:00
Pasi Kallinen
ef9d198d53 Explain "no travel path" in Guidebook 2017-08-24 10:33:23 +03:00
Pasi Kallinen
d1b4253307 Fix reversed stinking cloud targeting logic
...and give indication when blessed scroll of fire was targeted
at illegal position.
2017-08-24 09:04:54 +03:00
Pasi Kallinen
c7d13d6fa3 Make blessed scroll of fire useful
Blessed scroll of fire allows to choose the explosion location like
scroll of stinking cloud does. This should make it somewhat useful
in the early game.
2017-08-23 23:35:53 +03:00
PatR
0ad33783f0 crushed to death by a gas spore's explosion
From the newsgroup, remarking on an usual cause of death seen at NAO.
Surviving a gas spore's explosion (via hit points, not from life-saving)
left "gas spore's explosion" as stale killer.name.  Being killed by
opening a drawbridge (but not by closing or breaking one) only assigned
killer.name if it didn't already have a value, so the stale reason got
used:  crushed to death by a gas spore's explosion.

This fixes it two ways:  clear the stale value after surviving the
explosion, and assign a specific reason when opening the drawbridge.

This also removes stale reason for death set up by various drawbridge
activity.  For the usual case, the hero only survives by life-saving
which does its own clearing of killer.name.  But there might have been
cases where it was being set for the hero when operating on a monster,
so no life-saving involved.  The drawbridge code is not the easiest
code to navigate....
2017-08-21 15:50:36 -07:00
PatR
eadecb1baf BONES_POOLS fix and bonesid fix
The BONES_POOLS implementation added an extra dot to the bones file
name (only when enabled) which would be a problem on some filesystems.
This changes the name from "bonD0.15.3" to "bon3D0.15" which avoids
the second dot and also fits within 8.3 characters.  To enforce that,
the maximum value for BONES_POOLS is now 10 (yielding single-digit pool
numbers 0 through 9).

BONES_POOLS==1 will omit the pool number (that's not a change, just a
reminder), yielding "bonD0.15" and so on.  Right now, BONES_POOLS==0
is equivalent to BONES_POOLS=1, but it could be changed someday to
mean that bones files shouldn't be used if we decide to support that.

The pool number as a suffix was being included in content validation,
so it wasn't possible to move "bonD0.15.3" to pool 2 by renaming it to
"bonD0.15.2".  I'm not sure whether that was intentional, but it seems
overly draconian.  "bon3D0.15" can be renamed to "bon2D0.15" and then
be loaded by a game assigned to pool 2.  Also, pre-pool bones can be
retained by renaming to any valid pool and should still work.

The three letter filecode for quest bones has made the bonesid be
broken since 3.3.0 introduced it (the three letter code, not bones-id).
"QArc.2" for level 2 of the Archeologist quest was being written into
the bones file as "rc.2", but worked as intended because validation
when loading bones had the same mistake.  This fixes it to use "QArc.2"
when saving and accept either "QArc.2" or "rc.2" when loading, so 3.6.0
bones files (and existing to-be-3.6.1 bones) will continue to work.
2017-08-21 02:50:26 -07:00
Pasi Kallinen
73d36b59dd Typofix 2017-08-21 12:00:08 +03:00
Pasi Kallinen
1854d21dd7 Update NetHackW.exe version details 2017-08-20 23:44:35 +03:00
Pasi Kallinen
1eca824321 Add sysconf BONES_POOLS to allow more bones-files per level
Reduce the chance of a player playing on a public server encountering
their own bones, by implementing separate bones pools. The pool a player
belongs to is determined at game start, and only bones in that pool
are used. The sysconf BONES_POOLS allows the sysadmin to define how
many pools there are.
2017-08-20 23:04:59 +03:00