Commit Graph
8347 Commits
Author SHA1 Message Date
PatR c429cf5584 fix github issue #169 - monst vs vibrating square
Fixes #169

Monsters should not be afraid of stepping on the vibrating square
since it's only a trap for display purposes.  [Perhaps they should
deliberately avoid it if the hero hasn't seen it yet, but I didn't
implement that.]

"You see a strange vibration beneath <mon's> <parts>." was strange
when <parts> was a wolf's "rear paws" or horse's "rear hooves"--was
the vibration magically skipping the front ones?  And it sounded
naughty when it was a snake's "rear regions".  If the creature has no
limbs or is floating or flying, just say "beneath <mon>"; otherwise,
if the part is "rear <something>", omit "rear ".

The message was weird in another way.  Caller removes the monster
from it's old location and places it on the new one, calls newsym()
for the old location to show lack of monster, but then calls mintrap()
before newsym() for monster's new location (the trap's location).  If
pline messages cause buffered map output to be flushed, the monster
will be missing during the time the messages are delivered.  I fixed
that for vibrating square [seetrap()->newsym() before pline() rather
than after] but it should probably be fixed in the caller instead.
2018-12-19 14:52:23 -08:00
nhmall 616a469f0f Merge branch 'NetHack-3.6.2' 2018-12-19 06:47:30 -05:00
nhmall 0e446aab49 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-19 06:47:14 -05:00
nhmall a2296d043f eliminate sys/share/pcsys.c from Windows build
Windows build was actually only using a single function
in there, so just add a similar function to sys/winnt/winnt.c
and eliminate the need for including sys/share/pcsys.c in
the build.
2018-12-19 06:43:00 -05:00
PatR b32c93cacd fix #H2636 - vault guard "fakecorr overflow" panic
Another 6.5 year old report.  This one from Steven Melenchuk told
how to reproduce C343-23 which is still open on our 'known bugs'
page.  (I've no idea whether the original bug report came through
the contact page, and if so, what its assigned number was.)

I didn't try to solve this one, I just confirmed that it could be
reproduced and took the fix from grunthack at github.  He didn't
menion a fix at the time but implemented one before abandoing his
variant.  (Others kept it going afterwards; fix was during his time.)

The overflow occurred when the guard couldn't figure out where to
move to next and just repeatedly 'moved' to his current location
until the maximum number of fake corridor spots was used up.  The
fix detects not knowing where to go next and explicitly choosing a
new destination.

Original problem could be reproduced by teleporting into the vault,
digging out a wall and two spaces of stone in a straight line, then
going back into the vault to wait for a guard.  When he shows up:
answer, drop gold, follow.  If the guard's path walks through both
dug spaces, he will stop waiting for the hero.  But hero is in
between the guard and the gap in the vault wall and can't advance;
guard has reached a persistent corridor so doesn't know where to go
next.  Have hero wait for 125-ish more turns and then game panicks.

The code was 3.4.3 vintage so needed thorough reformatting, but not
any actual changes (unless I've overlooked something).
2018-12-19 03:06:40 -08:00
PatR 81d73ce417 disable gcc's __attribute__((warn_unused_result))
Casting to (void) to discard a function return value doesn't satisfy
gcc's -Wunused-result (which we aren't enabling but is apparently
being activated for particular functions by glibc header files).  Turn
it into a no-op to suppress three dozen warnings from Travis builds.
2018-12-18 19:11:36 -08:00
nhmall d7efe0505a Merge branch 'NetHack-3.6.2' 2018-12-18 20:29:41 -05:00
nhmall ab308d5751 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-18 20:29:25 -05:00
PatR 011181a6ed make diluted oil less effective than normal oil
Suggested 6.5 years ago...
2018-12-18 17:16:05 -08:00
PatR 1813865dc8 warn_unused_result in end.c
There is only one warn_unused_result warning from gcc in end.c;
change the code a little to use it.
2018-12-18 14:30:31 -08:00
nhmall 47cb400a37 Merge branch 'NetHack-3.6.2' 2018-12-18 17:11:53 -05:00
nhmall 437f560503 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-18 17:11:36 -05:00
nhmall 95f2c9a5d6 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-12-18 17:10:29 -05:00
nhmall ac1f5feb2c update .gitattributes for recent changes 2018-12-18 17:09:52 -05:00
PatR 4510bc7e50 warn_unused_result in recover.c
There is only one warn_unused_result warning from gcc in recover.c,
so actually use that result.

Plus a bit of reformatting (tab replacement).
2018-12-18 14:01:57 -08:00
nhmall 7df34886a3 Merge branch 'NetHack-3.6.2' 2018-12-18 12:56:34 -05:00
nhmall 8a3cea7801 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-18 12:56:12 -05:00
PatR b5ce81111c plug open file leaks for rumors and oracles
If the rumors file or oralces file got opened successfully but had bad
data, it wouldn't be closed.
2018-12-18 03:24:38 -08:00
PatR f2fe193b03 suppress dead code in move_special()
This dead code was already dead in 3.4.3; I didn't look any further
back.
2018-12-18 03:13:41 -08:00
PatR 39d85a5ce7 life support for comatose code in explmu()
Static analysis notices that
  if (physical_damage)
    tmp = Maybe_Half_Phys(tmp);
will never pass the test because all code paths leading to it set
'physical_damage' to False.  Instead of getting rid of it, add a fake
case that leaves that True.
2018-12-18 03:01:50 -08:00
PatR 16e78e5b60 plug potential open file leak in checkfile()
Another item from static analysis.  If an internal error ever caused
the "bad do_look buffer" warning from checkfile(), open file 'data'
would not be closed.  (The bug in checkfile()'s caller which prompted
that check was fixed long go.)

An alternate fix would be to move the input buffer check to before
the file is opened, but verifying the file first seems worthwhile.
2018-12-18 02:44:21 -08:00
PatR 83e35a73bd remove dead code from parse()
From Jessie's old static analysis report.  'prezero' was used in 3.4.3
when processing a count for 'multi', but count handling is now done in
a separate routine and 'prezero' in parse() never changes value, so
get rid of it.
2018-12-18 02:24:19 -08:00
nhmall 9e2eb0381f Merge branch 'NetHack-3.6.2' 2018-12-18 00:30:46 -05:00
nhmall 67aab1aaa1 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-18 00:30:30 -05:00
nhmall c18fa565a2 wording adjustment to fixes entry 2018-12-18 00:24:37 -05:00
nhmall 94ac3047f0 fix OPTIONS=symset:default, roguesymset:RogueEpyx 2018-12-18 00:14:39 -05:00
nhmall 588ad86f6a Merge branch 'NetHack-3.6.2' 2018-12-17 20:39:48 -05:00
nhmall 19d4875151 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-17 20:39:32 -05:00
PatR 44e81187c2 fixes36.2 fixes
Fix a few typos, reword a couple of entries describing the bug rather
than its fix to use past tense, move a couple of entries to be adjacent
to closely related entries (there's a lot of scope for more of that...)
and remove a bunch of trailing spaces.

[fixes36.2 starts with a header line but the tags on it aren't being
substituted.]
2018-12-17 15:45:55 -08:00
nhmall 8548df569f Merge branch 'NetHack-3.6.2' 2018-12-17 07:32:00 -05:00
nhmall 3d84fed5bc Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-17 07:31:39 -05:00
PatR 942961e3e2 throwing recoil inside shop
Another bug from seven years ago, sent directly to devteam so no #H
number.  Report stated that throwing recoil could move a levitating
hero diagonally through a shop's doorway to exit it.  If the thrown
item was unpaid, it remained unpaid after landing on shop's floor
and was an unlisted item on shop's bill.  Moving diagonally out the
door seems to have been fixed, but the same effect still occurred
if you were far enough from the door to have the shopkeeper vacate
his door-blocking spot and throwing recoil took hero to that spot.
The thrown unpaid item remained unpaid, and walking out the door was
treated as shop robbery.
2018-12-17 03:05:10 -08:00
PatR f9cef53758 yet more dropping while inside engulfer
I don't know why we have two different functions which do exactly
the same thing (checking whether an item is unpaid or is a container
that holds at least one unpaid item), but switch the #H2504 fix to
use 'the other one' and reverse one of the changes made when using
the inventory one.
2018-12-17 02:49:38 -08:00
PatR a3a676a6bd more dropping unpaid shop items inside engulfer
I thought that the earlier fix for #H2504 was too easy for anything
shop related.  It didn't deal sensibly with containers owned by hero
but holding unpaid shop goods.
2018-12-17 00:45:00 -08:00
Bart House 022d33149b Correct for rebasing mistakes. 2018-12-16 20:18:52 -08:00
Bart House 8950d01b1a Last big push for moving globals to instance_globals. 2018-12-16 20:03:13 -08:00
Bart House 06201ef833 Moving globals to instance_globals part 10ish. 2018-12-16 20:03:13 -08:00
Bart House 6d6623cf57 Even more globals moved to instance_globals. 2018-12-16 19:55:53 -08:00
Bart House 5807fb5062 Even more globals moved to instance_globals.c 2018-12-16 19:55:53 -08:00
Bart House 1d70c4a1bf More globals moved to instance_globals. 2018-12-16 19:55:52 -08:00
Bart House 40b682ecf6 Moved more globals to instance_globals. 2018-12-16 19:52:43 -08:00
Bart House 471224ea70 artifact.c, cmd.c and makemon.c globals moved to instance_globals. 2018-12-16 19:48:54 -08:00
Bart House cc881d02b1 Moved pray.c globals to instance_globals. 2018-12-16 19:43:02 -08:00
Bart House 0c71f0caac Removing spaces at end of lines. 2018-12-16 19:43:02 -08:00
Bart House ed9082a99a First set of changes to move globals to instance_globals. 2018-12-16 19:43:02 -08:00
nhmall 55ce379927 Merge branch 'NetHack-3.6.2' 2018-12-16 22:22:01 -05:00
nhmall 7c0aeb2011 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2018-12-16 22:21:43 -05:00
PatR a47ad0b918 dropping shop item(s) inside engulfer
'Yobjnam2()' is for beginning of sentence or other deliberate
capitalization.  Switch to yobjnam().
2018-12-16 16:06:15 -08:00
nhmall 6302fe3eaf Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2018-12-16 18:55:30 -05:00
nhmall c8defa67df revert to prior behavior 2018-12-16 18:52:55 -05:00