Commit Graph

9137 Commits

Author SHA1 Message Date
nhmall
dbc2e69110 Merge branch 'NetHack-3.6' 2019-08-02 22:50:13 -04: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
nhmall
2dd9aac832 remove some old comments and bits 2019-07-15 07:52:43 -04:00
Bart House
97ca83fd02 Merge branch 'master' into NetHack-3.7
# Conflicts:
#	src/pline.c
#	sys/winnt/windmain.c
#	win/tty/topl.c
#	win/win32/scripts/fuzzer/longtest.bat
#	win/win32/scripts/fuzzer/restore.bat
#	win/win32/scripts/fuzzer/runtill.bat
2019-07-14 23:50:54 -07:00
Bart House
cd1b650fb7 Merge branch 'NetHack-3.6'
# Conflicts:
#	DEVEL/Developer.txt
#	include/config.h
#	include/decl.h
#	include/display.h
#	include/extern.h
#	include/global.h
#	include/hack.h
#	include/patchlevel.h
#	src/display.c
#	src/dothrow.c
#	src/makemon.c
#	src/monst.c
#	src/objnam.c
#	src/sp_lev.c
#	src/wield.c
#	src/zap.c
#	sys/share/pmatchregex.c
#	sys/winnt/Makefile.msc
2019-07-14 23:36:56 -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
nhmall
e933882eb8 fixes entry 2019-07-14 18:20:17 -04:00
nhmall
bd9709ad77 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR 2019-07-14 18:15:49 -04:00
Bart House
6a75dc5dcf Fix build break in pline.c 2019-07-14 14:49:31 -07:00
Bart House
ed5450a1a9 Merge branch 'master' into NetHack-3.7 2019-07-14 14:41:52 -07:00
Bart House
883745a3c4 Merge branch 'NetHack-3.6'
# Conflicts:
#	include/extern.h
#	src/allmain.c
#	win/tty/topl.c
2019-07-14 14:41:11 -07:00
nhmall
865b301f0d another STATIC_VAR bit in sys/msdos 2019-07-14 17:34:47 -04:00
nhmall
6688053802 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from win/tty 2019-07-14 17:33:44 -04: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
nhmall
a0c38bd76c remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from sys/winnt 2019-07-14 17:30:26 -04:00
nhmall
8c20c52ecf remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from sys/share 2019-07-14 17:28:48 -04:00
nhmall
2ae6d72765 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from sys/msdos 2019-07-14 17:26:52 -04:00
nhmall
0d34f43830 remove STATIC_DCL, STATIC_OVL, STATIC_VAR, STATIC_PTR from core 2019-07-14 17:24:58 -04: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