Commit Graph

8361 Commits

Author SHA1 Message Date
nhmall
16d5d3f2e5 Merge branch 'NetHack-3.6.2' 2019-01-31 19:48:51 -05:00
nhmall
4de4155998 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-31 19:29:55 -05:00
PatR
8bf16b940e stale lock picking context
Lock context wasn't being cleared if it was for a container and that
container got destroyed.  Case discovered was forcelock() ->
breakchestlock() -> delobj() (sometimes the container is destroyed
rather than just breaking its lock) followed by #wizmakemap (replace
current level) and maybe_reset_pick() trying to check whether
xlock.box was being carried.  But being interrupted, destroying the
container or dropping it down a hole to ship it to another level, then
attempting to resume picking the lock would also find a stale pointer.
2019-01-31 15:50:12 -08:00
nhmall
ed79141463 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-01-31 18:22:55 -05:00
Pasi Kallinen
7bbc1f0130 Fix warning
Fix "using integer constants in boolean context"
2019-01-31 21:31:29 +02:00
nhmall
c456b313a7 Revert "adjust sample config file when STATUS_HILITES isn't defined"
This reverts commit 03e6c26af6.
2019-01-31 13:03:00 -05:00
PatR
48e7643739 fix monstone() ... dealloc_obj() panic
Fuzzer feebdack.  When turning a monster into a statue, monstone()
builds a linked list of mon->minvent items to put into that statue.
It doesn't use obj_extract_self() to take them off again, leaving
obj->nobj non-Null.  Not noticed for the normal case where each item
gets linked into the container's contents, but triggers panic if an
item merges with something already put inside so gets removed.

Suddenly, the dungeon collapses.
dealloc_obj with nobj
[2] 0x01000c4193 panic + 995
[3] 0x0100155427 dealloc_obj + 71
[4] 0x010021d4de obfree + 686
[5] 0x01000f2f92 merged + 834
[6] 0x010015356e add_to_container + 126
[7] 0x01001628ac monstone + 636

I don't know why the petrified monster's mergeable inventory wasn't
already merged while in inventory.
2019-01-31 04:22:04 -08:00
Pasi Kallinen
8736141f68 Option handling return values and errors
Fix some options not stopping when encountering an error,
some didn't show up any errors, and other minor fixes.
2019-01-31 10:46:44 +02:00
Pasi Kallinen
6a953231a3 Silence sprintf format warnings and dehardcode buffer sizes 2019-01-31 09:42:07 +02:00
nhmall
d36eaf8f99 Merge branch 'NetHack-3.6.2' 2019-01-30 23:12:15 -05:00
nhmall
d9f2d0c622 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-30 23:11:49 -05:00
PatR
409343e8eb another warning fix
Only appeared when ISAAC64 was disabled.
2019-01-30 16:25:31 -08:00
nhmall
6e0d55dfbc rng bit 2019-01-30 11:08:11 -05:00
nhmall
446b0e69d5 add a descriptive comment to integer.h 2019-01-30 08:30:02 -05:00
nhmall
05ec7f36a8 Merge branch 'NetHack-3.6.2' 2019-01-29 22:34:07 -05:00
nhmall
02532667a9 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-29 22:33:18 -05:00
nhmall
f2071a66f7 fix a likely typo/transcription error in integer.h 2019-01-29 22:12:09 -05:00
nhmall
c598da8de4 fix build
../sys/unix/unixmain.c: In function ‘sys_random_seed’:
../sys/unix/unixmain.c:779:29: error: expected expression before ‘long’
         fread(&seed, sizeof long, 1, fptr);
2019-01-29 20:29:56 -05:00
PatR
37e5a9cad2 randrole() fix
Give all the calls to randrole() its new argument.
2019-01-29 17:14:55 -08:00
nhmall
d32b2c8188 Merge branch 'NetHack-3.6.2-beta01' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2-beta01 2019-01-29 20:03:21 -05:00
nhmall
f7b6723053 update the long version info generated by makedefs 2019-01-29 20:01:31 -05:00
PatR
cf49b6fe87 last warning fix
Compiler gave four diagnostics about 'seed' being used uninitialized
if 'no_seed' were false, but two of those were alternate suggestions
for how to suppress them.
2019-01-29 15:27:22 -08:00
PatR
39b6a7e515 another warning fix
Comparison between signed and unsigned.  Compiler stupidity since
the range of possible values that signed 'i' can take is limited and
never negative.
2019-01-29 15:18:17 -08:00
PatR
1b49f60ded warning fix
The new code provoked several warnings; this fixes one of them.
Moving the declaration of 'rolecount' would have been sufficient,
but I've gone another way.
2019-01-29 15:00:07 -08:00
nhmall
b367b4e868 Merge branch 'NetHack-3.6.2' 2019-01-29 17:23:22 -05:00
nhmall
dec463d2f5 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-29 17:23:03 -05:00
nhmall
ccc14a038b more window port code uses of obj_to_glyph() 2019-01-29 17:21:55 -05:00
nhmall
f935331285 try fix for Qt4 using a core macro
../win/Qt4/qt4inv.cpp:41:26: error: macro "obj_to_glyph" requires 2 arguments, but only 1 given
  glyph=obj_to_glyph(nhobj);
                          ^
../win/Qt4/qt4inv.cpp: In member function ‘void nethack_qt4::NetHackQtInvUsageWindow::drawWorn(QPainter&, obj*, int, int, bool)’:
../win/Qt4/qt4inv.cpp:41:8: error: ‘obj_to_glyph’ was not declared in this scope
  glyph=obj_to_glyph(nhobj);
        ^
2019-01-29 17:07:00 -05:00
nhmall
97fdc3f3e4 build bits - mostly for Windows
Allow sys/share/random.c to be included in the build
always, even if USE_ISAAC64 is defined, by making most
of its contents conditional in that case.

That avoids Makefile tinkering when going back and
forth between USE_ISAAC64 and not during testing.
2019-01-29 11:31:41 -05:00
nhmall
f80223cdb4 Merge branch 'NetHack-3.6.2' 2019-01-29 09:27:46 -05:00
nhmall
9d2764b795 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-29 09:27:17 -05:00
Patric Mueller
b7edc7f8e8 Workaround for including stdint.h on older GCC versions
GCC doesn't set __STDC_VERSION__ for older versions. It is verified to
be set by default on 5.3.0.

Older versions set __INT64_MAX__ though (oldest version tested is
4.5.4).

If compilation with older GCC versions is required, set -std=c99. Even
3.4.6 is supported with this setting.
2019-01-29 15:10:01 +01:00
nhmall
af42273b02 fixes36.2 update for added isaac64 prng 2019-01-29 07:38:57 -05:00
nhmall
fd410148c5 Merge branch 'NetHack-3.6.2' 2019-01-29 07:27:56 -05:00
nhmall
d9a2c572f5 Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-29 07:22:23 -05:00
nhmall
57f03eca1b Merge branch 'alex-and-isaac' into NetHack-3.6.2-beta01 2019-01-29 07:20:17 -05:00
Alex Smith
0c96dd6a22 Consistently use rn2 in trap detection
It's a gameplay-affecting action (it updates the character's
memory of the map), and there's no way to spam it without using
resources, so rn2 is safe.
2019-01-29 03:37:08 +00:00
nhmall
54062e0ad6 include the rnd.c bits 2019-01-28 19:54:18 -05:00
nhmall
457e4b68aa merge Alex's dual rng proposal with the isaac64 rng code and adjust
This is branched from Alex's hallu-rng-stability branch,
with two build corrections (detect.c, zap.c), and merged
with  the isaac64 branch that we have ready to go.

Alex's dual rng is supported by setting up the array
of multiple isaac64 contexts.

I stuck with Alex's approach of passing the rng function
name around as the parameter (rng or rn2_on_display_rng)
for the new additional parameter needed for
set_random(), init_random(), reseed_random(),
and init_isaac64().
2019-01-28 19:43:55 -05:00
nhmall
819ee796f2 Merge branch 'countermeasures' into alex-and-isaac 2019-01-28 18:37:50 -05:00
nhmall
b84ff772cc Merge branch 'NetHack-3.6.2' 2019-01-28 16:36:46 -05:00
nhmall
542019d31e Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2 2019-01-28 16:36:23 -05:00
PatR
30237c73ec fix #H8072 - failing wish segfaults
Having an artifact wish be refused uses zeroobj and code which
followed was attempting to update its weight, triggering a segfault
now that zeroobj is 'const'.
2019-01-28 09:10:52 -08:00
nhmall
3108b18ea5 Merge branch 'countermeasures' of https://rodney.nethack.org:20040/git/NHsource into countermeasures 2019-01-28 09:45:31 -05:00
nhmall
f53d02f0bb Windows build bit 2019-01-28 09:44:35 -05:00
Patric Mueller
bd730dbcaa workaround for C89 not supporting inline 2019-01-28 15:00:04 +01:00
nhmall
22f8d864e2 ntconf.h ensure Rand is always something
order of preference:
USE_ISAAC64
RANDOM
C routine
2019-01-28 10:32:57 +01:00
nhmall
c1327142b5 detect DEV_RANDOM fopen failure and fall back, noting it in paniclog 2019-01-28 10:32:57 +01:00
nhmall
0aa4d62a2c detect rng seed strength at runtime based on algorithm not compile time based on platform features 2019-01-28 10:32:57 +01:00
nhmall
0a430cab11 every platform provides sys_random_seed() and SYS_RANDOM_SEED goes away 2019-01-28 10:32:57 +01:00