Commit Graph

6926 Commits

Author SHA1 Message Date
nhmall
c58b6119ca be consistent with the tex version 2018-05-20 15:36:51 -04:00
nhmall
9cb9164ce5 update note of appreciation in Guidebooks (dat/history to follow) 2018-05-20 15:11:49 -04:00
PatR
4fa455e306 more status_hilite threshold handling
Negative AC needed one extra change to support >-N since there was
a place in the code that assumed 0 was the lowest possible value.
(My earlier testing was with <-N which didn't have that issue.)

Make '/<N/' work as 'val < N' instead of 'val <= N', and />N/ work
as 'val > N' instead of >=.  The <= and >= behavior might have been
intentional but the only support for that I could find was that
the 'O' menu used "N or less" for '<' and "N or more" for '>' when
setting up 'absolute' rules.  If we actually want <= and >= (and we
probably do...), we should add them as more relationship operators
instead of misusing < and >.

Simplify the is_ltgt_percentnumber() case when parsing options
since input has been fully validated by the point that that test
passes.  Among other things, /<-0/ and />-0' are now accepted (as
synonums for 0; -0 doesn't mean anything special) instead of being
silently rejected and then discarding the rest of the config file.
(That bad behavior is a separate issue not dealt with here.)
2018-05-20 01:20:51 -07:00
PatR
b17c6d0b54 fix #H7155 - polearm can reveal hidden monster
The code to choose a likely target when applying a polearm was
basing its decision on visible spots which contained monsters,
so could expose the location of a hidden monster if there was
only one such spot within polearm range.  Not mentioned in the
report:  it also wouldn't pick remembered, unseen monster unless
there was a monster still at that spot.

I've changed it to choose candidate location based on the glyphs
shown rather than on the presence of monsters.
2018-05-19 15:46:09 -07:00
PatR
98099863ff fix #H7159 - orc hero can start with lembas wafers
Orc heroes get an extra food item ("to compensate for generally
inferior equipment") and it could randomly be lembas wafers (or
cram rations), and Ranger heroes always started with cram rations
even when they're orcs.  Fixing the latter was simple, but the
normal race-based substitutions weren't applied to randomly
generated items, so the fix for the former required a bit of code
reorganization in ini_inv().

Elf heroes already get lembas instead of cram; do the reverse for
dwarves (although I don't think this case can happen--no role gets
lembas wafers and only orcs and always-human tourists get random
food); give orc heroes tripe instead of either lembas or cram.
2018-05-19 11:47:15 -07:00
PatR
e9f1e03271 fix some of #H7156 - perm_invent issues
> [1. perm_invent is kept in flags so persists across save/restore, but
>  perm_invent capability can change if player restores with a different
>  interface--or same one running on a different-sized display--so it
>  ought to be in iflags instead.]

Not addressed here.

> 2. perm_invent window does not get updated when charging a wand (or
> other chargeable item presumably), with a scroll of charging.

Most scrolls rely on useup() -> update_inventory(), but charging uses up
the scroll early so that it will be gone from inventory when choosing an
item to charge.  It needed an explicit update_inventory() after charging.

> 3. update_inventory(), is called from setworn(), which is called from
> dorestore(), when loading a save.  Segfaults have been observed in
> variants based on this code (though not yet in vanilla 3.6.1), so it's
> possible this may be unsafe.  The update_inventory() call in setworn()
> could be protected with "if (!restoring) ..."

tty doesn't support perm_invent, so this might be a win32 issue.
I've made the suggested change, but a better fix would be to turn off
perm_invent as soon as options processing (new game) or options restore
(old game unless/until #1 gets changed) has finished setting things up,
then turn it back on at the end of moveloop()'s prolog when play is
about to start.

 = =

Most of the read.c change is reordering prototypes to match the order
of the corresponding functions.  I did this when adding a new static
routine, then ended up discarding that routine.
2018-05-19 04:19:18 -07:00
PatR
bed79b8391 more hilite_status threshold number parsing
In addition to leading '-' for negative values, accept explicit '+'
for positive values as a no-op.
2018-05-18 22:56:21 -07:00
nhmall
ee36206fdc Merge branch 'NetHack-3.6.2' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.2 2018-05-18 22:05:57 -04:00
nhmall
3b77543bcc preserve change from old branch 2018-05-18 22:05:05 -04:00
PatR
546321d055 Unix Makefile changes 2018-05-18 22:04:21 -04:00
nhmall
2fb9d6c94e save Pat's change 2018-05-18 21:42:41 -04:00
PatR
5c6245c312 commit test for renamed branch
Locally I've committed to NetHack-3.6.0 and haven't yet pulled from
upstream to get the branch rename.  I expect this commit to be
rejected but it could conceivably go through to the new name.
2018-05-18 21:40:22 -04:00
PatR
4b98266e25 fix #H7160 - hilite thresholds reject negatives
There was a prior report about this but I can't find it; maybe it
didn't go through the web contact form.  Anyway, status_hilite
threshold numeric values wouldn't accept a minus sign before the
digits, preventing negative AC values from being tracked.
2018-05-17 15:48:09 -07:00
nhmall
1641409d1c Merge branch 'NetHack-3.6.0' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6.0 2018-05-16 23:46:12 -04:00
nhmall
2758cd998a Guidebook.txt update 2018-05-17 03:42:38 +00:00
nhmall
84d4fcc4c8 another beta bit 2018-05-16 23:31:27 -04:00
nhmall
1e60a16565 sync date between two Guidebook files (.mn, .tex) 2018-05-16 23:26:07 -04:00
nhmall
05e84babb8 beta bit
Display the word beta in a better spot on the line
2018-05-16 23:23:08 -04:00
nhmall
5a62515d7b more bump of version ID 2018-05-16 23:08:37 -04:00
nhmall
2b66b5ecd1 bump version ID values 2018-05-16 23:06:44 -04:00
PatR
fa0a136b06 tty/wintty.c w/o TEXTCOLOR
With TEXTCOLOR disabled, compiler warnings about term_start_color()
and term_end_color() not being declared were followed by link failure
because they weren't available.

This tries to simplify color handling in the tty status code without
resorting to #if TEXTCOLOR (the proper fix, but somewhat intrusive).
For the usual case where TEXTCOLOR is defined, there were instances
of
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
and also of
  if (color != NO_COLOR)
    term_start_color();
  ...
  if (color != NO_COLOR)
    term_end_color();
I've changed both types to be
  if (color != NO_COLOR && color != CLR_MAX)
    term_start_color();
  ...
  if (color != NO_COLOR && color != CLR_MAX)
    term_end_color();
so that start/end pairing will always be consistent.

Also, ((color_and_attr & 0xFF00) >> 8) might not work as intended if
using 16-bit int and color_and_attr happened to have its sign bit set.
Change to ((color_and_attr >> 8) & 0x00FF) to ensure just the desired
bits.

Also also, a couple more formatting bits.
2018-05-15 17:09:47 -07:00
PatR
d752a4ad93 X11/winX.c w/o TEXTCOLOR
Avoid warnings when TEXTCOLOR isn't enabled.
2018-05-15 17:08:40 -07:00
PatR
1ecb2c1e79 mapglyph.c w/o TEXTCOLOR
Avoid warnings when TEXTCOLOR isn't enabled.
2018-05-15 17:06:51 -07:00
nhmall
8dc2c59796 fixes36.2 catch-up for previous commit 2018-05-15 19:41:12 -04:00
nhmall
821399c6be fix access violation when --debug:xxxx has no other args after it 2018-05-15 19:39:05 -04:00
nhmall
88f5dcbfb4 fix spaces in hilite_status option text field not working H7107 (GitHub #88)
Fixes #88

H7107: FWD: spaces in hilite_status option text field not working
2018-05-15 19:35:36 -04:00
keni
f810a45dc1 fix H7138: sys/unix/setup.sh fails with no arguments
Sanity check was in the wrong place.
2018-05-15 16:30:28 -04:00
nhmall
c2103b84db fix a couple of status items, gold highlighting and a boundary check
typo
gold highlighting
boundary check on tty_curs()
2018-05-15 09:03:35 -04:00
PatR
5586cca8b9 tty status
Started by removing two or three unused variables, ended up cleaning
up a lot of formatting (tabs, trailing spaces, indentation, a few
wide lines, 'if (test) return' on same line).  Marked some static
functions as static in their definitions instead of leaving it hidden
in their prototypes.  Moved a pair of short-circuit checks to skip
several initializations.
2018-05-15 04:16:40 -07:00
PatR
fc75055263 debug logging
Remove unused variables.
2018-05-15 04:15:41 -07:00
nhmall
504f0a4510 integrate aklys feature introduced in 3.6.1 into 3.6.x display 2018-05-15 06:41:06 -04:00
nhmall
64a771da4b add prototype
(cherry picked from commit 438cfd3815)
2018-05-15 06:31:22 -04:00
nhmall
cc1d43fad4 integrate aklys feature introduced in 3.6.1 into display
(cherry picked from commit 3fe8325f14)
2018-05-15 06:29:40 -04:00
nhmall
340ff13a1d Merge branch 'win-minor' into NetHack-3.6.0 2018-05-15 01:30:31 -04:00
nhmall
80218a7855 boundary bit 2018-05-15 01:29:36 -04:00
nhmall
aaddab5450 catch up on fixes36.2 updates 2018-05-15 01:10:32 -04:00
nhmall
f36c3ae1ab Merge branch 'win-minor' into NetHack-3.6.0 2018-05-15 00:27:11 -04:00
nhmall
589bdb4e2d Merge branch 'win-tty-status' into win-minor 2018-05-15 00:26:26 -04:00
nhmall
26654ef079 a few cut-and-paste errors 2018-05-14 22:25:25 -04:00
nhmall
2e8b69d5ff some tty per field rendering and optimization 2018-05-14 21:13:37 -04:00
nhmall
fba7c06fd6 put back the functionality of commandline --debug:immediateflips overwritten recently 2018-05-14 21:09:01 -04:00
Bart House
1f877dbca1 Additional changes to xputc_core() and early_raw_print() to manage
the cursor position correctly.  This is needed to handle raw printing
correctly.  Added check for when we might be running off the bottom
of the screen when handling msmsg().  Added runtime checks to keep
cursor always within bounds.
2018-05-13 20:46:43 -07:00
Bart House
53c7cb8c78 Changes to xputc_core to handle cursor correctly. 2018-05-13 18:54:20 -07:00
nhmall
860b9c35c1 testing build with STATUS_HILITES 2018-05-13 21:24:14 -04:00
nhmall
2b8ac8af9e missing stubs for NetHackW.exe 2018-05-13 16:42:11 -04:00
Bart House
0afd2570cb Removing temporary debugging code and fixing compiler warnings. 2018-05-13 13:29:13 -07:00
Bart House
3dbbd188d9 Fixing typo. 2018-05-13 12:49:52 -07:00
nhmall
0d23e7b44d Merge branch 'tty-status' into win-tty-status 2018-05-13 15:21:46 -04:00
nhmall
3b2f7e86e0 more status updates
- prevent an overflow
- add make_things_fit()
2018-05-13 15:19:39 -04:00
Bart House
650d5230ec Fix memory leak. See bug 1169. 2018-05-12 19:45:16 -07:00