Commit Graph

8563 Commits

Author SHA1 Message Date
nhmall
0091920f00 travis build update and mkfontdir argument for linux
travis recently changed linux default dist from trusty to xenial, and bionic is next

include an additional travis linux build under bionic to eliminate surprises there

add a parameter to mkfontdir under linux to prevent it form going after .lev files
2019-08-16 13:50:41 -04:00
nhmall
d1bc65b75b add X11 packages to couple of travis builds 2019-08-15 20:41:50 -04:00
PatR
a995929168 fix #H9118 - stoning a sandestin
causes "dmonsfree: N removed doesn't match N+1 pending" warning.  The
sandestin monster definition flags it as MR_STONE, immune to being
turned to stone.  If the hero hit it with a cockatrice while it was
shape-changed into something which isn't MR_STONE, it had its mon->mhp
set to 0, so died, and its form (mon->data) was set back to sandestin.
known_hitum() decided that it didn't turn to stone because of MR_STONE
for that form so proceeded to kill it off due to lack of hit points,
causing it to die twice.

I started to change that so that it didn't kill off the critter a
second time, bit it really shouldn't be able to kill it by stoning in
the first place.  So sandestin how shares some vampire code to revert
to innate form and not turn to stone when "killed" by stoning.  It
only yields the normal visible polymorph message:  "the <foo> turns
into a <bar>" without any attempt to explain why.  Once in sandestin
form, smacking it with a cockatrice corpse doesn't do anything special
(due to MR_STONE now being unambiguously in effect).  It will soon
shape-change to some other form and then become subject to being
forced back to innate shape by stoning again.
2019-08-14 18:49:16 -07:00
PatR
c814ca8e04 fix #H9117 - bookeeping for fatal status condition
When Stoned, Slimed, Strangled, Sick (TermIll or FoodPois or both)
counts down to 0 without being cured, keep it listed as an active
condition while killing off the hero.  It will show in the status
section when disclosing final attributes and in both that section
and map's status lines when producing a dumplog.
2019-08-11 18:56:43 -07:00
PatR
a2a257a512 fix github issue #211 - wrong parentheses
Fixes #211

dopickup() was getting the wrong value from pickup_checks() due
to misplaced closing parenthesis.  But it didn't actually impact
play; picking things up from engulfer's minvent while swallowed
worked even though the special check for that was failing.  The
code which was accidentally being skipped can probably go away but
I haven't gone that far.
2019-08-08 11:25:36 -07:00
PatR
cc3d97d9b3 fix github issue #209 - typo in end_of_input()
Fixes #209

Fix typo:  program_statue should be program_state.  Apparently
NOSAVEONHANGUP+INSURANCE isn't used by anyone since it wouldn't
compile.
2019-08-08 11:01:56 -07:00
PatR
380a2d2848 fix #H9100 - typo in Mort #4
For "They look at you but the don't see you", "the" should be a second
"they".  Simple transcription typo rather than a mistake in the book.
2019-08-06 04:24:21 -07:00
PatR
508af05e42 fix #H9084 - teleported boulder left stale screen
Report was for Sokoban but it applied anywhere:  if a teleported
boulder landed in a pit or trap door or hole and flooreffects() used
it up (so returned True), rloco() didn't update the location it was
teleported from and it appeared not to have moved.  (Line of sight was
updated to reflect its absence but map spot wasn't redrawn without it.)
2019-08-02 11:51:26 -07:00
PatR
55e166ba08 fix #H9082 - post-3.6.2 monster throwing crash
Changing
  if (ammo_and_launcher(otmp, uwep) && mwep->otyp == ELVEN_BOW)
(with 'uwep' typo) to
  if (mwep->otyp == ELVEN_BOW && ammo_and_launcher(otmp, mwep))
(with fixed 'mwep') moved ammo_and_launcher()'s hidden non-null
test to after 'mwep->otyp'.  If mwep was Null (so monster must be
throwing non-ammo such as darts or daggers rather than shooting
with a launcher), a crash occurred.  (Throwing such things while
the monster is wielding any weapon doesn't have this problem.)

I don't think 3.6.2 can crash here.  If hero's uwep is a bow, otmp
must be arrows to get past pre-3.6.3's incorrect ammo_and_launcher()
check.  And a monster won't shoot arrows unless wielding a bow, so
monster's mwep would be non-Null regardless of what uwep is.

I tested a kobold with darts and an elven bow.  But I also gave it
one elven arrow to provoke it into wielding the bow and my test
didn't throw darts with nothing wielded....
2019-08-02 10:42:26 -07:00
PatR
31c8038344 bad weapon check for monster multi-shot shooting
A typo caused the bow and arrow check when a monster was wielding an
elven box to test the hero's weapon with monster's ammo.  [I looked
at the old slash'em code where I think this came from and it doesn't
have the typo but does have a different bug.  A monster could get a
multi-shot volley by wielding an elven bow when throwing darts or
spears.  The extra bow and arrow check is intended to prevent that.
The typo was probably by me but I have no memory of that code....]

Elves with bows (or other monsters who manage to pick up and wield an
elven bow) will shoot bigger volleys after this fix.  That will make
them more dangerous but also cause them to run out of arrows more
quickly.
2019-07-31 14:22:09 -07:00
PatR
6dffe52a27 Glory of Arioch vs spellbook
From the newsgroup (reported for slash'em but applies to nethack too):
a chaotic monk was crowned and told he or she had been "chosen to
steal souls for My Glory!" while being given a spellbook of restore
ability which has nothing whatever to do with soul stealing.  There's
alternate wording for when Stormbringer can't be given because it
already exists; also use that for when it's not going to be given
because the character is discouraged against wielding weapons.
2019-07-30 17:24:33 -07:00
PatR
c4a2f20af0 Mjollnir comment in artilist[]
The description of Mjollnir's behavior when thrown was incomplete and
slightly inaccurate.
2019-07-28 15:06:02 -07:00
PatR
ed18ebc545 timer validations
Add the contributed code that checks for attempting to start a
duplicate timer.  It's based on a comment which must have been there
at least 25 years and doesn't solve any known problems, but it is
conceptually similar to the large amount of sanity checking which has
gone into 3.6.x.

It didn't work as is because it was comparing two unions with '=='.
I don't know offhand whether C++ supports that but C doesn't (through
C11 at least; don't know about C17).  The union ('anything') is simple
enough that two instances can be compared without jumping through hoops.

I've also added another check for timer 'kind' (level, object, monster,
or global).
2019-07-27 16:12:24 -07:00
Bart House
a607ea2b7f Revert "When fuzzing, use the number of moves as a proxy for the hour."
This reverts commit f75deae0bc.
2019-07-14 21:29:41 -07:00
Bart House
5870cb6a92 Revert "Added experimental feature NEW_KEYBOARD_HIT."
This reverts commit bc65112ce0.
2019-07-14 21:28:55 -07:00
Bart House
e83fcd0353 Revert "Improved readability of topline state management."
This reverts commit 08a1910867.
2019-07-14 21:28:40 -07:00
Bart House
05d77d91b8 Revert "Moved declaration of topline state to wintty.h."
This reverts commit 7bb41c797f.
2019-07-14 21:28:03 -07:00
Bart House
733e760638 Revert "Remove the remapping of snprintf to _snprintf when compiling with MSC."
This reverts commit 9801635f56.
2019-07-14 21:18:03 -07:00
Bart House
44d84c3163 Revert "Modified nhassert_failed to call impossoible."
This reverts commit 3e4a0759a3.
2019-07-14 21:17:39 -07:00
Bart House
a598428fc9 Revert "Fixed bug with inmore and toplin state management."
This reverts commit 0f57f0e48c.
2019-07-14 21:17:19 -07:00
Bart House
988d474d42 Revert "Added assertions to check toplin state."
This reverts commit 1db45c8016.
2019-07-14 21:16:59 -07:00
Bart House
04f4ac94ca Revert "Comment out nhassert() calls."
This reverts commit 45a9c5eb14.
2019-07-14 21:16:27 -07:00
Bart House
fe9fc4cac1 Revert "Added nhassert to core."
This reverts commit 0ca299acb3.
2019-07-14 21:15:54 -07:00
Bart House
a90f9d4365 Revert "Fixed sign/unsigned comparisions."
This reverts commit 0e8e5aac93.
2019-07-14 21:15:31 -07:00
Bart House
177bd39646 Revert "Tweaks to nhassert implementation. Change to warnings on MSC build."
This reverts commit 2f3da35c68.
2019-07-14 21:15:01 -07:00
Bart House
ec05e1ec70 Revert "Fix compiler warnings."
This reverts commit 90f5aa91b7.
2019-07-14 21:13:43 -07:00
Bart House
2df1b179ca Revert "Removing assertion that does not hold under all scenarios."
This reverts commit c44ad5645d.
2019-07-14 21:13:18 -07:00
Bart House
f7c956c35a Revert "Adding ptr_array data structure."
This reverts commit e665d3b850.
2019-07-14 21:12:59 -07:00
Bart House
1c5b28e7f9 Revert "Re-worked tty_putmsgistory and tty_getmsghistory."
This reverts commit 1d0b8b4680.
2019-07-14 21:12:21 -07:00
Bart House
9bc190d2fc Revert "Add stopping in the debugger when nhassert() is hit in the windows port."
This reverts commit 5d2872dd4f.
2019-07-14 21:11:41 -07:00
Bart House
454419e6c1 Revert "Removed the older version of tty_putmsghistory and tty_getmsghistory."
This reverts commit aa95e20ca7.
2019-07-14 21:10:51 -07:00
Bart House
4c1c247028 Revert "Fuzzer improvements."
This reverts commit 435f1c4626.
2019-07-14 21:10:39 -07:00
Bart House
5d2181ced3 Revert "Fix build issue on linux."
This reverts commit d33160d069.
2019-07-14 21:10:27 -07:00
Bart House
0f0b6c5aab Revert "Tweaks to fuzzer scripts."
This reverts commit cd375064dd.
2019-07-14 21:10:07 -07:00
Bart House
3adaa79858 Revert "Revert type change of lit which would break code."
This reverts commit cc1219b5a8.
2019-07-14 21:09:38 -07:00
Bart House
a66fed3d5a Revert "Move fuzzer_start, fuzzer_stop and fuzzer_log to pline.c"
This reverts commit d9da488c35.
2019-07-14 21:09:29 -07:00
Bart House
340ec01caf Revert "Remove dead code."
This reverts commit 5428d73287.
2019-07-14 21:09:16 -07:00
Bart House
a4317b738a Revert "Fix typo in formatting string."
This reverts commit fa5c499268.
2019-07-14 21:09:07 -07:00
Bart House
fa5c499268 Fix typo in formatting string. 2019-07-14 14:31:30 -07:00
Bart House
5428d73287 Remove dead code. 2019-07-14 14:31:00 -07:00
Bart House
d9da488c35 Move fuzzer_start, fuzzer_stop and fuzzer_log to pline.c 2019-07-14 14:30:38 -07:00
Bart House
cc1219b5a8 Revert type change of lit which would break code.
Cast lit (which will be 1) to unsigned int to remove warning.
2019-07-14 14:02:05 -07:00
Bart House
cd375064dd Tweaks to fuzzer scripts. 2019-07-14 12:13:19 -07:00
Bart House
d33160d069 Fix build issue on linux. 2019-07-14 02:00:21 -07:00
Bart House
435f1c4626 Fuzzer improvements.
phase_of_moon and friday_13th determined using rn2() instead of local
time if fuzzing.  Don't reseed using init_random() if fuzzing.  Allow
set_random to be called outside of hacklib.  rn2_on_display_rng uses
rn2 if fuzzing so that we have a single source of random that we can
ensure is reproducible.  Implement rul() that returns a random unsigned
long.  Fix bug in fuzzer handling of ntposkey which would cause us to use
unitialized values for x and y.  Added command line arguments to allow
auto starting and stopping of fuzzer.  Add a logging facility for the
fuzzer to use to record activity.  Added some scripts used to automate
fuzzer testing on windows.
2019-07-14 00:20:09 -07:00
Bart House
aa95e20ca7 Removed the older version of tty_putmsghistory and tty_getmsghistory. 2019-07-13 16:23:37 -07:00
Bart House
5d2872dd4f Add stopping in the debugger when nhassert() is hit in the windows port.
When stopping in the debugger after having called impossible, the windowing
state will have been modified since the assertion was hit.  This made
examining state that caused the nhassert to fire no longer possible.
To avoid this issue, we now detect the debugger and stop in the debugger
prior to impossible.
2019-07-13 16:08:47 -07:00
Bart House
1d0b8b4680 Re-worked tty_putmsgistory and tty_getmsghistory.
When we were saving message history as part of a game save for insurance,
we were calling remember_topl() and thus inappropriately changing topline
state.  This would cause us to mis-manage the topline in subsequent calls
to update the topline.

The code has been re-worked to fix the issue, reduce complexity and make
the code clearer.
2019-07-13 16:08:27 -07:00
Bart House
e665d3b850 Adding ptr_array data structure. 2019-07-13 16:08:08 -07:00
Bart House
c44ad5645d Removing assertion that does not hold under all scenarios.
When we save gamestate as part of making an insurance snapshot, we will
save message history which will clear toplines but leaving window state
in tack including the need for more.
2019-07-13 10:53:53 -07:00