Commit Graph

1635 Commits

Author SHA1 Message Date
Bart House
769ad91cc3 mthrowu, nhlan, options, regions, rip and role globals moved to g. 2018-12-25 16:26:27 -08:00
Bart House
c67f7e5122 globals from files.c moved to instance globals. 2018-12-25 12:56:27 -08:00
Bart House
b1ab64db43 program_state moved to g. 2018-12-25 10:09:04 -08:00
Bart House
16db7498d0 UNIX, VMS, DEF_PAGER, MICRO and MFLOPPY globals moved to g. 2018-12-25 09:34:24 -08:00
Bart House
0763046c38 zeroX, tc_gbl_data and fqn_prefix moved to instance globals. 2018-12-25 08:09:37 -08:00
Bart House
1c65e6afe0 context to g.context 2018-12-25 07:29:38 -08:00
Bart House
8c1a4d9a97 invent, youmonst, hackdir moved to g. 2018-12-24 21:04:15 -08:00
Bart House
90547edb83 moves, monstermoves, wailmsg, migrating_objs and billobjs moved to g. 2018-12-24 20:22:33 -08:00
Bart House
be5cdcf77a killer, level and rooms move to instance globals. 2018-12-24 19:50:08 -08:00
Bart House
572ee347b9 Another round of instance globals changes. 2018-12-24 16:43:50 -08:00
Bart House
62e1a45b60 Merge branch 'win-wip3.7' into win-wip3.7-bart
Conflicts:
	src/end.c
2018-12-24 12:09:42 -08:00
nhmall
a229a8a56d Merge branch 'NetHack-3.6.2' 2018-12-24 06:44:27 -05:00
PatR
7bc36ddef4 fix #H6942 - dropx vs hold_another_object
Dropping an existing fragile item while levitating will usually
break it.  Getting a new wished-for fragile item and dropping it
because of fumbling or overfull inventory never would.

Some callers of hold_another_object() held on to its return value,
others discarded that.  That return value was unsafe if the item
was dropped and fell down a hole (or broke [after this change]).
Return Null if we can't be sure of the value, and make sure all
callers are prepared to deal with Null.
2018-12-23 12:37:26 -08:00
Bart House
74edf42f1c Moved decl.c globals into instance globals. 2018-12-22 18:44:22 -08:00
Bart House
c8ae68b06a Merge branch 'win-wip3.7' into win-wip3.7-bart
Conflicts:
	src/o_init.c
2018-12-22 13:22:58 -08:00
PatR
4159dd985a fix #2468 - killer bees without a queen
Seven year old suggestion was to have a killer bee eat royal jelly if
there was no queen around, then after a short delay it would become a
queen.  This does that, with "no queen around" being "no queen bee on
current dungeon level" and the transformation happening immediately
with the "short delay" taking place after.

Pet killer bees will target nearby royal jelly if there's no queen,
hostile killer bees will only eat it if they happen to walk on the
same spot as one.  Both types accept either tame or hostile queen bee
as an existing queen.

Killer bees eating royal jelly will drop dead if queen bees have been
genocided, and aren't smart enough to avoid the instinct to eat such
if/when that happens to be the situation.
2018-12-21 16:59:01 -08:00
nhmall
bba5d14dca Merge branch 'NetHack-3.6.2' 2018-12-21 09:38:22 -05:00
PatR
0e58316109 fix #H2680 - IDing unpaid gem should adjust price
Another one from 6.5 years ago, identifying a type of gem should give
a new price for any unpaid gems of that type and adjust shopping bill
accordingly.  Report was for rubbing with touchstone and learning
worthless glass with price not changing until the learned 'gem' was
dropped.  Fix works for that and also other forms of identification
(and for amnesia, raising prices of forgotten gems); no dropping is
required for the price to change.

Theoretically could apply to any type of item, but prices of gems are
by far the most sensitive to whether or not they're identified.
2018-12-21 01:14:45 -08:00
nhmall
47f936ad53 Merge branch 'NetHack-3.6.2' 2018-12-20 08:04:49 -05:00
Bart House
605667b470 Add missing comment from hackpid declaration. 2018-12-19 21:27:31 -08:00
Bart House
576eece500 More globals moved to instance_globals. 2018-12-19 21:26:35 -08:00
Bart House
cb42021389 Last big push for moving globals to instance_globals. 2018-12-19 20:01:56 -08:00
Bart House
af949cb1df Moving globals to instance_globals part 10ish. 2018-12-19 20:01:56 -08:00
Bart House
f312b8cfe6 Even more globals moved to instance_globals. 2018-12-19 20:01:56 -08:00
Bart House
e4ab048c90 Even more globals moved to instance_globals.c 2018-12-19 20:01:55 -08:00
Bart House
ff5fe26e72 More globals moved to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House
3645e415e3 Moved more globals to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House
f1e48cddfe artifact.c, cmd.c and makemon.c globals moved to instance_globals. 2018-12-19 20:01:55 -08:00
Bart House
74caa8d8e4 Moved pray.c globals to instance_globals. 2018-12-19 20:00:35 -08:00
Bart House
1c1e5b7e36 Removing spaces at end of lines. 2018-12-19 20:00:35 -08:00
Bart House
912886a73f First set of changes to move globals to instance_globals. 2018-12-19 20:00:35 -08:00
PatR
f7dd3b8215 clang on OSX
The Unix Makefile.{src,utl} use the compiler name 'gcc' by default on
OSX, and that invokes clang which defines __GNUC__ to deal with gcc
extensions.  But when invoked via the Xcode IDE, it evidently uses its
own name instead, and wasn't defining __GNUC__.  tradstdc.h started
down the road of duplicating gcc features; switch to pretending to be
gcc instead.
2018-12-19 17:52:49 -08:00
nhmall
616a469f0f Merge branch 'NetHack-3.6.2' 2018-12-19 06:47:30 -05: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
PatR
011181a6ed make diluted oil less effective than normal oil
Suggested 6.5 years ago...
2018-12-18 17:16:05 -08:00
nhmall
8548df569f Merge branch 'NetHack-3.6.2' 2018-12-17 07:32:00 -05: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
nhmall
a93066ba83 Merge branch 'NetHack-3.6.2' 2018-12-16 17:39:55 -05:00
PatR
0fe6a731df fix #H2204 - mkclass() mon selection distribution
That #H number isn't a typo.  This finally fixes--at least improves--
something reported eight years ago.  The monster types chosen by
mkclass() could be way off in some circumstances.  Cited example was
repeated same-race sacrifice by chaotic hero on dungeon level 20; it
produced about twice as many incubi as succubi even though they're
the same as far as difficulty goes.  (No changes in the intervening
years had any discernable effect; that was still reproducible.)
The report also mentioned that ndemon() threw away the result from
mkclass() and retried quite often and suggested that mkclass() be
taught to filter by alignment when caller cared about that.

This seems to even things out, although it also made harder monsters
chosen more often.  A test program generated these numbers when
picking a chaotic demon 10000 times (level 1 hero on dungeon level 20,
so not realistic; actually probably level 0 hero since the program
didn't initialize struct u.)  Third column is the number of times the
monster type was chosen with the old mkclass(), fourth is same for
the new one.
    mkclass() calls    27315 10000
286 succubus            2800  3309
288 incubus             5552  3262
291 marilith             973   780
292 vrock                477  1617
293 hezrou               150   626
294 bone devil            46   247
295 ice devil              2   107
296 nalfeshnee             0    23
297 pit fiend              0    15
298 sandestin              0     4
299 balrog                 0    10
Note that vrock has generation frequency 2 and marilith only 1, so
getting twice as many vrocks as mariliths should be expected.

I temporarily changed ndemon() to ask for lawful demons instead of
chaotic ones and got this.
    mkclass() calls    15762 10000
287 horned devil        3197  3375
289 erinys              4991  3339
290 barbed devil        1812  3286

I also ran it for dragons with any alignment (so the outcome was
never thrown away; 10000 calls were needed for 10000 picks) instead
of demons of specific alignment and am suspicious of the outcome.
    mkclass() calls    10000 10000
140 baby yellow dragon  1124     0
141 gray dragon         1096  1096
142 silver dragon       1073  1099
143 red dragon          1061  1126
144 white dragon        1077  1128
145 orange dragon       1141  1118
146 black dragon        1154  1049
147 blue dragon         1137  1123
148 green dragon        1137  1154
149 yellow dragon          0  1107
There may be a flaw in the test program.  Or else old mkclass() was
not very good at picking dragons.
2018-12-16 14:21:30 -08:00
nhmall
9b16cf373c Merge branch 'NetHack-3.6.2' 2018-12-15 23:00:49 -05:00
PatR
dddbb66927 building lev_comp with USE_OLDARGS
The relatively recent change to lev_comp do deal with apparent junk
in some places in its generated data has triggered a bunch of
 "cast to 'vA' (aka 'const char *') from smaller integer type 'int'
 [-Wint-to-pointer-cast]"
from clang when building with USE_OLDARGS.  Probably should have
added a zillion explicit casts to long and 'L' suffix for 0 rather
than trying to handle both int and long.  Or maybe just turned off
that particular warning, which must be coming from -Wall or -Wextra.

This modification has no effect for USE_STDARG or USE_VARARGS configs.
2018-12-15 19:27:08 -08:00
nhmall
2508c98b4d Merge branch 'NetHack-3.6.2' 2018-12-15 19:42:23 -05:00
nhmall
902f76d1fa more win32 gui fuzzer work 2018-12-15 19:31:42 -05:00
nhmall
3709fcbffa Merge branch 'NetHack-3.6.2' 2018-12-15 18:25:08 -05:00
Bart House
266b5e3891 Small improvements to fuzzer for NetHackW.
Can toggle fuzzer on/off using "Pause" key if attached to debugger.
Extended command selected randomly.
2018-12-15 14:49:59 -08:00
Bart House
67037f18b5 Remove parameter names in declaration. 2018-12-13 21:23:43 -08:00
nhmall
e89a278f4b Merge branch 'NetHack-3.6.2' 2018-12-13 08:46:02 -05:00
Bart House
106cc8acde Merge branch 'win-minor' of https://rodney.nethack.org:20040/git/NHsource into win-minor 2018-12-12 21:46:32 -08:00