Commit Graph

7771 Commits

Author SHA1 Message Date
nhw_cron
a2649ae879 This is cron-daily v1-Dec-30-2019. dgncomp updated: sys/share/dgn_comp.h sys/share/dgn_yacc.c 2019-01-01 17:19:11 -05:00
nhmall
cb25676c43 update for 2019 2019-01-01 11:48:30 -05:00
PatR
4fc49a22de tweak the Astral Plane level
Even out the difficulty (from one game to another) somewhat.  Instead
of a 75% chance that two large areas will be opened up on the left
and right sides of the arrival area plus 13.5 (avg) * 1.5 (avg) extra
monsters in that region, change to 60% chance that the left side will
be opened up with 7 (avg) * 1.5 (avg) extra monsters and a separate
60% chance that the right side will be opened up with 7 * 1.5 (avg)
extra monsters.  The chance that both sides get opened up drops to
36% but the chance that neither side gets opened drops to 16%, with
difference made up by 24% chance each for just one side or the other.

I was a little surprised that this actually worked.  I hope there's
a less clumsy way to have a loop index.
2018-12-31 16:48:14 -08:00
nhmall
c2777860e9 incorrect header 2018-12-30 22:02:42 -05:00
PatR
3cc4db7950 Unix Makefile
Separate the compiler flags used for compiling X11 code from the rest
of CFLAGS.  Affects hints/macosx10.8 and later.

Add an explicit output argument to the generated compile rules.
2018-12-30 17:39:56 -08:00
PatR
da40f55a9f 'O' vs bouldersym
The 'O' handling for bouldersym was updating the display value for
boulder even if the value had been rejected, and if it still had the
default of '\0', the map would end up with <NUL> characters.  (When
examined via '//' or ';', those matched dummy monster class #0 and
led to the impossible "Alphabet soup: 'an("")'" that was suppressed
yesterday.)

Attempting to set bouldersym to ^@ or \0 would also be rejected as
duplicating a monster symbol.  That is now accepted and used to reset
the boulder symbol to default.  However, other control characters are
also accepted--not due to this patch, they already are, and from a
config file in addition to via 'O'--so bouldersym can still disrupt
the map.  But that's no different from putting control characters
into a symbol set or setting them from config file via S_foo:^C.
2018-12-30 15:30:38 -08:00
nhmall
83e8033f72 remove curses date.h dependency in Windows Makefiles 2018-12-30 07:58:39 -05:00
PatR
adf64764f4 minor memory leak
I ran the fuzzer with MONITOR_HEAP enabled and heaputil found a dozen
or so un-free'd allocations, all made by the same dupstr() call in
special_handling() for "symset" and "roguesymset".  (Reproducible with
a few tens of thousands of fuzzer moves, although you have to take
over from the fuzzer and make a clean exit rather than just interrupt
it or there'll be lots of other un-free'd memory.)  I haven't actually
figured out how/why it was leaking, but reorganizing the code has made
the leak go away (according to a couple of even longer fuzzer runs) so
I'm settling for that.
2018-12-29 20:41:16 -08:00
PatR
39b6f7f462 alphabet sour warning
A recently added impossible to check for an(Null) and an("") was
triggered by the fuzzer:  Alphabet soup: 'an("")'.  I reproduced it a
couple of times and tracked it do_screen_description(for '/' command)
matching the symbol from mapglyph to monster class #0, a placeholder
with symbol value '\0'.  So mapglyph() returned a symbol of '\0', but
not necessary from showsyms[0 + SYM_OFF_M].

The pager lookup code's monster loop shouldn't have been attempting
to match against class #0, and since this fix I haven't been able to
reproduce the situation again.  But I also didn't trigger it with a
bunch of temporary checks in mapglyph() so don't know what is really
going on under the hood.
2018-12-29 20:39:11 -08:00
PatR
d418008b31 curses splash/copyright screen, role prompt
Back out '#include "date.h"' so that cursinit.c won't be recompiled
every time any other file(s) need to be compiled.  It doesn't need
patchlevel.h either.  There is already a straightforward way to fetch
the copyright banner lines from version.c.

The splash screen (ascii art spelling "NetHack" preceding the normal
copyright lines) was invisible when showing white text on white-ish
background.  Make it honor !guicolor.

"Shall I pick a character's role, race, gender and alignment for you?
 [ynaq] (y) " was too wide to accept the answer on the same line on
an 80-column display so "(y) " was placed on the second line.  That's
constructed in the core; change the construction to omit " a" when
using "character" rather than a role name.  (tty shortens it by omitting
the default " (y)"; with " a" gone, it could revert to normal prompt.)

Also a bit of lint cleanup and some reformatting of cursinit.c....
2018-12-29 18:38:30 -08:00
keni
9a9f76bf5c fix typos in header line so expansion works 2018-12-29 19:19:30 -05:00
nhmall
eed7c4bdd1 nttty topten output processing
switch back to using the safe routines
after tty port exits on Windows console
tty port.

Fixes H7758
1613
2018-12-29 12:26:33 -05:00
PatR
5882832ef0 X11 on OSX
The change to Makefile.src for X11+XPM on linux broke linking X11 on
OSX.  This updates the hints files (except for the -qt one) so that
 make WANT_WIN_X11=1
and
 make WANT_WIN_X11=1 USE_XPM=1
work correctly.

The comment in macosx10.14 about what version(s) it's intended for
and been tested on is just cloned from 10.10 and should be updated.
2018-12-29 03:28:07 -08:00
Pasi Kallinen
45e06d638f Curses: Remove useless inventory label
The inventory window used a line to say "Inventory:", which is pretty
useless, and that was the only window showing such a label.

Also don't duplicate the "Not carrying anything" text from core.
2018-12-29 13:16:51 +02:00
PatR
4cbfb7d05f X11 USE_XPM lint 2018-12-29 03:02:07 -08:00
Pasi Kallinen
6ac681b5fa X11: default to XPM-format tile file and rip screen
People have been wondering how to change the tiles on the X11
version, and the old default of NetHack-specific binary tile data
isn't directly editable with image editing tools.

Also show in the #version info if xpm and graphic rip are enabled.
2018-12-29 07:19:24 +02:00
PatR
c4bda6a6a8 create_particular 'I' vs mkclass
The revised mkclass() [actually new mkclass_aligned()] has an extra
check which didn't used to be there, and attempting to create a
monster of class 'I' with ^G triggered impossible "mkclass found no
class 35 monsters" which the fuzzer escalates to panic.
2018-12-28 19:10:54 -08:00
PatR
5846aee283 memory #stats
obj->oextra->omonst might contain monst->mextra plus mextra->edog, &c.
That was being ignored when summing up memory allocated for objects.
2018-12-28 15:06:45 -08:00
nhmall
fc504dfa89 yet more Windows Makefile
Now that the dependency lines are corrected for the
correct output files in the Makefile, it revealed a
dependency on a non-existent file.
2018-12-28 12:51:11 -05:00
nhmall
be67656932 More Windows Makefile corrections 2018-12-28 12:34:41 -05:00
nhmall
1cdb9c561c Windows Makefile updates 2018-12-28 12:29:12 -05:00
nhmall
a5f154d925 a couple of source spelling consistencies for /*FALLTHRU*/ 2018-12-28 10:08:56 -05:00
Tangles
9fd28fb852 curses - fix count selection not working for PICK_ONE menus.
eg: d2b would drop 2 of item b, but using d* to pick from a menu
and then selecting 2b would ignore the count and just drop the
whole stack.
2018-12-28 15:42:32 +01:00
Patric Mueller
19f0a2d3ba Fix missing compilation dependency for cursinit.c 2018-12-28 15:21:33 +01:00
Pasi Kallinen
ca336bbf4b curses: include date.h
This way the curses port will show the version and compile date
on the startup banner, just like tty does.
2018-12-28 11:34:01 +02:00
PatR
c056ca1b35 fix github issue #170 - stacks of non-missiles
Fixes #170

Monsters never throw athames or scalpels but some fake player monsters
on the Astral Plane are given those.  Since they're stackable the
quantity usually gets boosted but there's no point in having more than
one if they won't be thrown.

This could have been fixed by letting monsters throw those two items,
but I prevented the quantity from being boosted instead.
2018-12-27 18:36:26 -08:00
PatR
96eaca731a stack merging vs shop pricing
When merging one stack into another and they have different obj->o_id
price adjustments, keep the o_id of whichever one commands the higher
shop price.
2018-12-27 15:37:06 -08:00
PatR
9e0d945961 stack splitting vs shop prices
I misread part of the original code and the revision introduced a bug
based on that.  obj->o_id price variations are used for all types of
non-IDed items, not just non-glass gems.
2018-12-27 15:01:15 -08:00
PatR
a6b4322034 fix #H7103 - shop pricing
Player came across a stack of 2 gray stones in a shop and kicked one.
That one ended up with a different (in his case, lower) price once it
was separate.  This behavior only applies to non-glass gems which add
a price variation derived from internal ID (obj->o_id) number.  Make
splitting stacks always yield the same price per item in the new stack
as was being charged in the old stack by choosing a similar o_id.  Do
it for all splits (that can vary price by ID, so just non-glass gems),
not just ones performed inside shops.

He picked up the lower priced one and dropped it back on the original
higher priced one; the combined stack took on the lower price.  That
will no longer happen if they come from splitting a stack, but this
fix doesn't address merging with different prices when they start out
as separate stacks.  (Unpaid items won't merge in inventory if prices
are different, but shop-owned items will merge on floor.)
2018-12-27 14:12:48 -08:00
PatR
f8b4ad3fdc mines luckstone as achievement marker
It was possible to have the guaranteed luckstone at Mines' End become
merged with a random one and lose its specialness for achievement
tracking.  Mark it 'nomerge' when created and clear that if/when the
achievement is recorded.
2018-12-27 13:31:42 -08:00
PatR
ceb446eaea curses lint 2018-12-26 01:45:17 -08:00
PatR
cae50298b6 container_contents() vs show goods
Fix another inconsistency with containers in shops:  prices shown when
looking inside.  Apply had them (because shop goods in containers are
flagged as 'unpaid' when hero carries the container), and loot did not
(because they aren't flagged that way).
2018-12-25 17:07:45 -08:00
PatR
96eebc1955 bill hero for magic bag explosion
Exploding a bag of holding on a shop floor didn't bill for shop-owned
contents which got destroyed.  This puts them on the 'Ix' used up list.
2018-12-25 16:52:33 -08:00
PatR
5f5f7f63f1 stolen_value() vs containers
stolen_value() treated hero-owned container holding shop-owned goods
as free for the taking.

The fix I'm working on which led to discovering this first added
stolen_value() then eventually stopped using it so I don't have an
example of where it is giving the wrong result.
2018-12-25 16:45:41 -08:00
PatR
3aca92215c prices of items on shop floor
get_cost_of_item() was giving different information from shop #chat
when dealing with containers owned by hero containing objects owned
by the shop.  And when it was legitimately reporting a price of 0,
doname_with_price() wasn't reporting 'no charge' for items inside a
shop that were owned by hero or that shopkeeper didn't care about.

Extend the shop price reveal to far-look, but only when hero and item
being examined are inside the same shop.
2018-12-25 13:48:51 -08:00
PatR
99cd9ea264 simplify container_contents()
iflags.in_dumplog is accessible even when DUMPLOG is not enabled.
2018-12-25 13:05:35 -08:00
PatR
02cfd131ee status gold vs symset:Blank
Symset:Blank sets all the map symbols (except STRANGE_OBJECT) to
<space>.  The status lines for !STATUS_HILITES force status to use '$'
instead of ' ' for the prefix before ":1234" for gold, but the status
lines for STATUS_HILITES did not.  tty ended up with ":1234" for gold.
win32 and curses both ignore the prefix and construct their own, but
since win32 uses the map symbol for that it must also be ending up
with ":1234" (I assume; I haven't seen it).  curses is forcing '$' for
the prefix, even on the rogue level.

This attempts to fix win32 without be able to test the result.  I've
left curses alone.
2018-12-24 18:43:51 -08:00
PatR
0ad8a192bf formatting: parse_conf_file() 2018-12-24 17:50:21 -08:00
PatR
e2852f25fd fix temporary strength loss that was permanent
Watching the fuzzer, I saw hero's strength plummet to 3 again and not
rise above 5 after that.  It turns out to be due to life-saving, which
was fixing severe hunger but was not restoring the point of strength
that's lost when you go from hungry to weak.

I'm not sure whether this was caused by 3.6.1's commit
024e9e1225 or already behaved that way.

Another fuzzer bit:  the monk I was watching was bitten by a wererat
early on and was still inflicted with lycanthropy when he reached
level 19.  (I've no idea how his level got to be so high; it jumped
from 14 to 19 while I wasn't paying attention.)  Extend the earlier
hack for drinking a blessed potion of restore ability to recover lost
characteristcs to sometimes drink a potion of holy water instead.
2018-12-24 02:08:44 -08:00
PatR
f6d5862c0d implement #H6051 - fake players resist Conflict
The rationale is that since the player character resists conflict,
fake players should too.

[I'm not sure that I buy that.  Player character is always the one
*causing* conflict and it doesn't affect self.  But this is simple
as long as no other resistance checks are against attack-by-ring.]
2018-12-23 17:25:14 -08: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
PatR
df5dc6050d EXTRA_SANITY_CHECKS build fix
is if/else friendly and semi-colon friendly, but not comma friendly.
2018-12-23 12:13:37 -08:00
PatR
95acf0d93a avoid checkfile() segfault
Recent change for "pair of lenses names The Eyes of the Overworld"
triggered a segfault if item was neither named nor called.
2018-12-23 12:03:53 -08:00
PatR
0eb11aa718 fix github issue #155 - encumbrance vs water
Fixes #155

When drowning, you need to be unencumbered in order to crawl out of
water.  When not drowing, you don't, but put a limit on how much can
be carried.  If polymorphed into a swimming creature, allow stressed
or less; otherwise (magical breathing), burdened or less.  (Doesn't
apply on the Plane of Water since there's no climb from water to land
involved.)
2018-12-22 18:09:44 -08:00
PatR
d6ed41339e fix #H7749 - "you detect it"
'Detect' is used for observing a vampire shape change without being
able to see the vampire.  The problem here is that it changed from
bat form to fog cloud form in order to pass under a closed door,
and the message was being delivered when it was already at the door
location instead of before the move from a visible spot to that door.

I'm not happy with this fix, but any other alternative I considered
seemed to be worse.  Having the shape change use up the monster's
move is probably a better way to go.  Then on its next move it will
be in the right form to make a normal flow-under-door move.
2018-12-22 16:35:15 -08:00
PatR
8dfc10d8c6 fix #H2709 - exercise_steed() for riding skill
Code appears to intend that riding for 100 turns be treated like a
successful weapon hit as far as skill training goes, but it was
actually requiring 101 turns each time.  It's conceivable that that
was intentional, but unlikely.
2018-12-21 17:11:22 -08:00
PatR
d3682dd5ca monsters on melting ice
Reported seven years ago, when ice melts underneath a monster, it
hovers there until its next move, then falls in and drowns.  Dunk it
immediately, and give hero credit/blame if it happens during the
hero's turn (so presumably the melting was caused by the hero).

Also, let monster with teleport capability who gets dunked teleport
away from the water before getting wet, the way hero does.
2018-12-21 14:36:55 -08: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
PatR
4e1eecc7fa data.base lookup bit
When testing the change to the Eyes of the Overworld wording and asking
for information about inventory item
 k - a pair of lenses named The Eyes of the Overworld
I got "I don't have any information on those things".  Not because that
item wasn't identified, but because the lookup was for "pair of lenses"
(finding nothing) and then for "The Eyes of the Overworld" (and not
finding it due to "The" which is stripped from the first attempt but
wasn't from the second nor present in the data.base key).
2018-12-20 18:58:44 -08:00
PatR
de1861aa0f fix #H6189 - Eyes of the Overworld database entry
The phrasing of the data.base entry for the Eyes of the Overworld
reads as if it is continuing some passage in a reference book, but
that comes off strange when using '/' to see it.  Rephrase it.

data.base could stand to have an entry for 'lenses'....
2018-12-20 18:28:57 -08:00