Commit Graph

2466 Commits

Author SHA1 Message Date
nethack.rankin
cbfe97cf51 mimicking by pets (trunk only)
I killed a mimic in a shop, then left.  My dog or cat entered that shop
where I could no longer see it, and I got
    You see a tripe ration appear where it was!
when it evidently ate the corpse, without me being able to see any such thing.
This fix is only approximate but I didn't want to figure out all the
permutations of esp or prolonged monster detection or infravision.  (There
probably aren't as many permutations as I first thought since only "ordinary"
pets will take on alternate monster form, so won't ever switch from detectable
via esp to not detectable or vice versa.  Maybe this is good enough.)

     No fixes entry; this is post-3.4.3 code.  There was an early return with
a comment stating that idx==0 was impossible.  I took that out since 0 is not
only possible, it's a valid index into the array of transformations.
2012-02-10 09:29:28 +00:00
nethack.rankin
6ac27851a6 fix #H2591 - sitting while swallowed (trunk only)
From a bug report, sitting while
swallowed gave "you are sitting on air," and the intended message "there are
no seats in here" was never reached.  Move the latter so that it works, and
add a new one when you try to sit while a grabber is holding on to you.

     Also add theft vs donning fixes entry which was left out two days ago.
2012-02-06 04:17:25 +00:00
nethack.rankin
a2f15cfd61 theft vs donning, round 2 (trunk only)
The message "you stop taking off <that armor>" when interrupted by a
nymph's or monkey's theft attack would only be given if you were using 'A'
to take off the armor.  If you used 'T', you'd get "you stop putting on
<that armor>" instead.  The fix for that also makes it easy to vary the
nymph message "<the nymph persuades> you to start taking off" to be "<the
nymph persuades you to continue taking off" when taking that same piece
of armor off was interrupted by the theft.
2012-02-05 04:26:48 +00:00
nethack.rankin
ef888e065a fix #H2589 - theft vs donning/doffing (trunk only)
From a bug report, having some
armor stolen while in the midst of putting on armor--when both items have
a multiple turn completion delay--could result in side-effects for the
latter item being reversed even though they hadn't been applied yet.  So
you'd lose points of Int and Wis when attempting to put on a positively
enchanted helm of brilliance, or gain such with a negatively enchanted one.

     steal() was assigning to afternmv before it had been used to finish the
action of putting on or taking off armor.  Fix by interrupting the attempt
to put on or take off armor when being victimized by theft (or being hit by
succubus or incubus seduction).  The existing stop_occupation() call wasn't
sufficient because afternmv is different from occupation.
2012-02-04 08:13:26 +00:00
nethack.rankin
9b61b368b4 unconsciousness (trunk only)
When testing armor theft by nymph I got a message "you dream that you
hear <something or other>" even though I was awake.  steal() was leaving
nomovemsg null in order to get the default of "you can move again", but
unconscious() was treating null value as 'yes, hero is unconscious'.  I'm
pretty sure its intent was just to guard against passing null to strncmpi()
and didn't really mean that null indicates unconsciousness.
2012-02-04 07:20:23 +00:00
nethack.rankin
a7aaee910e #overview overhaul, part I (trunk only)
Reformat the DUNGEON_OVERVIEW code in dungeon.c.  It's clear from the
way lines were wrapping that the original author used an editor that let
him set tab expansion to columns of four, and when they're treated as the
conventional eight then some longish lines won't fit.  Switch to using a
mix of tabs and four spaces instead of all tab characters.

     I've separated out my more interesting changes (which will come later).
However, there are a bunch of minor ones included:
 1) the lastseentyp array is reused for each level visited, but it wasn't
    being reinitialized when creating a new level, so remembered fountains,
    altars, and so forth could be erroneously propogated across levels
    (the original contributed patch may not have suffered from this because
    it handled last-seen data differently than the code which is in place);
 2) add 3.5.0 health food store to the list of recognized shop types;
 3) make an #annotate value of a single space delete any old annotation
    without adding a new one, the way monster and object naming works;
 4) the code to discard overview data for a branch of the dungeon which
    can no longer be reached (quest expulsion) wasn't capable of doing so
    for the very first level (a hypothetical problem since level 1 isn't in
    the quest...) and didn't free memory used for user-supplied annotations;
 5) reorganize dooverview() where Michael's compiler reported that a
    variable might be used before being initialized (it wasn't, but it also
    wasn't even needed to achieve the intended result);
 6) redo the #overview formatting macros so that they'll work with pre-ANSI
    compilers that don't support concatenation of adjacent string literals;
 7) function-like macro ADDNTOBUF() was used without terminating semi-colon,
    which confused emacs when indenting, so this rewrites it such that it
    expects ordinary termination and will work correctly if ever used in the
    form 'if (some_condition) ADDNTOBUF(args); else ...';
 8) comment out water/ice/lava with #if 0 ... #endif rather than /* ... */.
2012-02-02 10:15:04 +00:00
nethack.rankin
88b88e2ca5 quest pager fix (trunk only)
A priest quest message that was supposed to say "brotherhood" or
"sisterhood" said "itood" instead.  Text "%shood" used the post-3.4.3 'h'
modifier to substitute a pronoun in place of the %s value.  That's only
a valid modifier when it follows %d (deity), %l (leader), %n (nemesis),
or %o (artifact).  Change the substitution routine to leave it as an 'h'
when it follows anything else.  [No fixes entry needed.]
2012-02-02 09:18:14 +00:00
nethack.allison
e701a68175 rolling boulder trap's boulder can be generated in lava
> On 01/30/2012 08:20 PM, <Someone> wrote:
> The boulder from a rolling boulder trap can be generated on a
> lava pool. mkroll_launch() in trap.c, line 1584 checks only for pools
> of water.
2012-02-01 00:49:16 +00:00
nethack.rankin
061d8ec947 strdup/dupstr (trunk only)
Add dupstr() as a substitute for strdup() so that out-of-memory
handling will be consistent with the rest of nethack, and make it aware
of nethack's heap logging.  It's treated like alloc() so that its caller
can be logged for NH_HEAPLOG.

     I put it into use in a few places, but there are lots more candidates
besides the existing calls to strdup() that should be replaced.
2012-01-29 03:00:17 +00:00
nethack.rankin
c76362833a bit logic fix (trunk only)
Fix some expressions that were supposed to use bitwise '&' but were
accidentally using logical '&&', pointed out by Keni's lint tool.  All 3
instances are in post-3.4.3 code, so don't affect the branch and don't
need a fixes entry.
2012-01-29 00:34:33 +00:00
nethack.rankin
7dd8600e17 wizard bones bug (trunk only)
The wizard mode sequence
  load bones? y, unlink bones? y, die, save bones? y
works, but
  load bones? y, unlink bones? n, die, save bones? y, replace old bones? y
fails if/when external compression is in use.  The file gets uncompressed
before being opened to check its existence, then immediately closed, and
re-compressed, changing the file's name, before the deletion attempt takes
place.  Then delete_bonesfile() can't find it via the uncompressed name
and the bones saving code reports "cannot unlink old bones".

     The code involved doesn't seem to have changed since the current cvs
repository was set up, so this bug has gone unnoticed for a long time.
There's no reason this fix shouldn't go into the branch too, other than the
fact that I don't have that checked out on this machine.  If someone wants
to apply it there, be my guest (and move the fixes entry to fixes34.4).
2012-01-28 02:52:14 +00:00
keni
1d219b4e1b SYSCF bits
(This covers some thing that Pat found and some things I found while working
on those.)
Unscramble duplicate use of GREPPATH and GDBPATH symbols.
Add some more info to config.h.
Make missing SYSCF_FILE a fatal error.
Make a parse error in SYSCF_FILE a fatal error.
Rename PANICTRACE_GLIBC (et al) to PANICTRACE_LIBC (et al) since FreeBSD
 and Mac OS X (at least) also implement the needed API.
Allow SYSCF_FILE to be unreadable by the user (for setgid installs).
If SYSCF, do NOT fall back to the compiled in WIZARD account.
Put WIZARD into sysopt and remove special cases in authorize_wizard_mode().
2012-01-27 20:15:31 +00:00
nethack.rankin
a871ad06e9 outrip() updating (trunk only)
Part II of the bones tracking patch.  Change umpteen different outrip()
routines to handle its new time_t argument, and use formatkiller() instead
of directly accessing killer.{format,name} and killed_by_prefix[].  The
latter is now static within formatkiller().

     The many sys/* and win/* changes are untested....
2012-01-24 04:26:33 +00:00
nethack.rankin
9721470635 bones tracking (trunk only)
[See cvs log for include/rm.h or doc/window.doc for more complete description.]

Attach hero info, death reason, and date+time to a level that's being saved
as bones.  Read such data back when loading a bones file, then treat it as
part of that level for the rest of the game.  Dying on a loaded bones file
will chain the new hero+death+date to previous one(s) if new bones get saved.

outrip() now takes an extra argument of type time_t, and interface-specific
implementations of this routine need to be updated to handle that.
2012-01-23 10:45:31 +00:00
nethack.allison
b5ca45599c msdos build (trunk only) 2012-01-22 06:27:09 +00:00
nethack.allison
5163e6dc20 remove line of unreachable code (trunk only) 2012-01-21 12:39:03 +00:00
nethack.rankin
84c9b09440 save and restore lint cleanup (trunk only)
Fix a couple of signed vs unsigned and unused paramater warnings
that pointed to actual bugs.  uid values were being handled as int, even
though "modern" systems use type uid_t which could be bigger and is almost
certainly unsigned.  There haven't been any reports of nethack falsely
claiming that the wrong user is trying to restore, so in practice this
hasn't mattered, but switch from int to unsigned long to make the chance
of problems be even smaller.

     The code to save message history was ignoring the 'mode' argument so
would have attepted to write even when asked to free memory instead.  It
isn't currently called by freedynamicdata() so the problem was theoretical
rather than real.

     The 'UNUSED' macro is inadequate to handle parameters which are used
by some conditional configurations and unused by others, so there are
still several warnings about unused parameters from save.c and restore.c.
2012-01-18 02:36:50 +00:00
nethack.rankin
141653625d rumors & oracles & data.base vs "%lx" format (trunk only)
For text data processed by makedefs at install time, change all
printf and scanf calls that use %lx format to deal with unsigned long
variables, replacing the makedefs hack of a few days ago.  It's not as
clean as I would have liked (quite a few casts), because the values
involved are derived from ftell and/or passed to fseek, which deal in
signed longs.  But it clears up a few format check warnings by gcc in
rumors.c and pager.c in addition to the previous one in makedefs.c and
uses the right data type even in the places where no warning was issued.
2012-01-15 09:27:06 +00:00
nethack.rankin
ac1707b5e6 lint bit: protects(artifact.c) (trunk only)
Rename 'is_worn' argument; that's also the name of a function.
2012-01-12 09:51:05 +00:00
keni
7f6ee2f759 WINCHAIN - a framework allowing multiple processors between core and winport
This is the code I built trying to figure out the large window size issue.
It completely compiles out if not needed (see -DWINCHAIN in hints/macos10.7)
and except for one call during setup has zero overhead if compiled in and
not used.  See window.doc for more info.

Defs for UNUSED parms.  I know this has been controversial, so use is isolated
to the chain code and windows.c (where it shouldn't be intrusive and saves about
50 warnings).

Hints file for 10.7, but the build process still needs to be migrated from
the branch.
2012-01-11 18:23:35 +00:00
keni
b97d53fb30 cleanup: outdated SCCS lines
Pat noted that I neglected to drop the SCCS lines on the files I've been
committing, so clean up those and any others I could find where the SCCS
line date is out of date.
2012-01-10 17:47:45 +00:00
nethack.rankin
369b1031fd fix #H2559+2564 - using 'a' command to discover potion of oil (trunk only)
From a bug report, if you used the apply command while
not carrying anything applicable except for unknown potion, you would get
"you don't have anything to apply" if that potion wasn't oil but an
inventory selection prompt (with '*' as the default since you wouldn't
have anything considered to be a likely candidate) if that potion was oil,
giving away information.

     This fix makes carrying any unknown potion yield the inventory
selection result, unless oil is already discovered and hero can see that
the unknown potion isn't oil.
2012-01-10 08:50:19 +00:00
keni
c119e8c3d9 add param to ini winsys routines
Provide a mechanism for cleanly moving between tentative window system
selections during startup.  Now, before a second (or later) system is selected,
the first will be notified that it is losing control.  See window.doc.
2012-01-10 01:39:31 +00:00
keni
e442242417 sanity check for dlb_fopen
Fail if dlb_fopen is called with a non-read mode.
2012-01-09 22:42:48 +00:00
nethack.rankin
1563a3e0ec drain life vs drain resisting objects (trunk only)
From the newsgroup:  casting spell of drain life at Stormbringer
(or Excalibur or Staff of Aesculapius) would reduce its enchantment just
like any other weapon.  Drain resistance should protect against that even
when not actively wielded.
2012-01-08 01:26:35 +00:00
keni
52aa3efcce last bunch - pline warnings while testing postcommit.pl 2012-01-04 18:52:36 +00:00
keni
f95549512a another pile on the trunk 2012-01-04 18:14:41 +00:00
keni
e3856eead3 back to trunk: potion.c 2012-01-04 18:05:21 +00:00
keni
01a44fead4 postcommit.pl 1.84 - first branch info test: polyself.c (on the trunk) 2012-01-03 19:11:34 +00:00
keni
f7805b65ae postcommit.pl 1.83: pray.c
(Getting close to the end.  1.83 cleans up the code and updates the bugs list.)
2012-01-01 17:35:48 +00:00
keni
21f9be37a7 worked once, let's press our luck: botl.c invent.c mkobj.c 2011-12-31 00:24:26 +00:00
keni
86e9b65d20 again, looking for that failure condition: pager.c pickup.c 2011-12-30 23:58:48 +00:00
keni
623119a4b6 postcommit.pl 1.82: mthrowu.c music.c 2011-12-30 23:47:06 +00:00
keni
178f66dbe4 now we need one of those temporary failures so we can see if recovery works,
and that's a crapshoot: mcastu.c mhitu.c
2011-12-30 23:14:58 +00:00
keni
6520bbdca9 first try tonight: lock.c makemon.c 2011-12-30 23:10:37 +00:00
keni
404aac46c1 last try for tonight: engrave.c and hack.c 2011-12-30 04:03:27 +00:00
keni
30193b9364 new hack: and we try dungeon.c and eat.c 2011-12-30 03:50:15 +00:00
keni
20148d83fe try another pair: dokick.c dothrow.c 2011-12-29 23:50:13 +00:00
keni
6120c3dd0b can we commit across directories? src/detect.c and util/makedefs.c 2011-12-29 23:29:43 +00:00
keni
03b4813be3 can we do two files? artifact.c cmd.c 2011-12-29 22:46:25 +00:00
keni
f536e7b550 can we get two in a row? muse.c 2011-12-29 22:41:56 +00:00
keni
16c0d0ee20 and now: bones.c (for postcommit.pl 1.75) 2011-12-29 22:36:36 +00:00
keni
a301d5e0e9 next test: dig.c 2011-12-29 22:28:06 +00:00
keni
68cbca9305 more debugging: apply.c 2011-12-29 22:16:49 +00:00
keni
fde6b47810 another try. spell.c 2011-12-29 22:01:25 +00:00
keni
3453ddedbd next try: do.c (three lines of comment - #1)
comment line 2
comment line 3
2011-12-29 21:49:27 +00:00
keni
5542cd9e6b third try: mon.c 2011-12-29 21:24:15 +00:00
keni
837d2bd217 second test file: rumors.c 2011-12-29 21:14:04 +00:00
keni
cbc1031d4e mail test / warnings in save.c 2011-12-29 20:23:00 +00:00
arromdee
2cf8261159 Minor cockatrice fix
PS: Why do we have duplicate fixes__._ files in the branches, since by
definition the same file would have to stay the same in any branch?
2011-12-18 05:16:36 +00:00