]> granicus.if.org Git - nethack/log
nethack
4 years agoUse enums instead of magic values
Pasi Kallinen [Sun, 15 Nov 2020 17:31:22 +0000 (19:31 +0200)]
Use enums instead of magic values

4 years agoQt screen layout
PatR [Sun, 15 Nov 2020 16:59:08 +0000 (08:59 -0800)]
Qt screen layout

Simplify a recent change to the screen layout.  Qt can calculate
the details and the recent code resulted in a slight amount of
blank space between the paperdoll and its resize hotspot.

Fix an off-by-one bug in the paperdoll resize routine.  (The one
pixel margin at the top was being overlooked.)

4 years agoQt hitpointbar tweak
PatR [Sun, 15 Nov 2020 16:34:19 +0000 (08:34 -0800)]
Qt hitpointbar tweak

When the hitpointbar is showing thick blue + thin dark blue (75%
or better health but less than 100%) and partial healing occurs,
the dark blue portion was momentarily visible pushed off the
right edge of the bar, resulting in slight flicker as the right
half of the bar got redrawn.  I haven't noticed anything similar
for the paler injured-side colors, nor any temporary gap between
the two sides when losing health.

Also, remove a workaround that was needed at one point but isn't
needed anymore.  (I don't remember the circumstances.)

4 years agosupport for build with current Lua version 5.4.1
nhmall [Sun, 15 Nov 2020 16:08:10 +0000 (11:08 -0500)]
support for build with current Lua version 5.4.1

This may require
make spotless
make fetch-lua
for some platforms.

4 years agoFix an implicit-fallthrough and maybe-uninitialized warning
Patric Mueller [Sun, 15 Nov 2020 15:07:43 +0000 (16:07 +0100)]
Fix an implicit-fallthrough and maybe-uninitialized warning

4 years agoUpdate comment about xchar
Pasi Kallinen [Sun, 15 Nov 2020 12:25:40 +0000 (14:25 +0200)]
Update comment about xchar

4 years agoMore hypothetical type mismatches
Pasi Kallinen [Sun, 15 Nov 2020 11:51:47 +0000 (13:51 +0200)]
More hypothetical type mismatches

4 years agoFix buffer underrun in curses
Pasi Kallinen [Sun, 15 Nov 2020 11:22:45 +0000 (13:22 +0200)]
Fix buffer underrun in curses

4 years agoFutureproofing hypothetical type mismatches
Pasi Kallinen [Sat, 14 Nov 2020 11:41:31 +0000 (13:41 +0200)]
Futureproofing hypothetical type mismatches

If we ever want huge maps with COLNO or ROWNO larger than signed char,
this will at least allow the game to compile and start when typedef'ing
xchar to int. Trying to use huge maps exposes more bugs.

4 years agoQt status
PatR [Sat, 14 Nov 2020 01:15:04 +0000 (17:15 -0800)]
Qt status

Try to set the initial window sizes to be big enough to show the
full welcome line in the message window when the Qt settings
(Preferences on OSX) specify Large font (Huge/Medium/Small/Tiny
seemed ok but I wasn't systematic about checking them).

While at it, I added a long comment about the status window format
and noticed a bug with experience formatting there.  Again only
seemed to matter for Large font but the change to fix ignores font
size.

Plus add a couple of Qt "issues", one old and one just discovered.

4 years agofix github issue #410 - mon throwing c'trice egg
PatR [Sat, 14 Nov 2020 00:52:45 +0000 (16:52 -0800)]
fix github issue #410 - mon throwing c'trice egg

If a monster threw a cocktrice egg that hit and petrified another
monster, the hero would credit (experience) and blame (possible
alignment penalty, &c) for it.

Fixes #410

4 years agowarning fixes
PatR [Fri, 13 Nov 2020 22:11:54 +0000 (14:11 -0800)]
warning fixes

Using 'ladder' as a variable conflicts with 'struct flag flags'
because of a macro in rm.h.  Also remove or hide a couple of
unused variables.

The hack.c diff is unrelated; just a reformatting bit that I had
laying around.

4 years agoRework stairs structure
Pasi Kallinen [Mon, 9 Nov 2020 16:50:02 +0000 (18:50 +0200)]
Rework stairs structure

Use a linked list to store stair and ladder information, instead
of having fixed up/down stairs/ladders and a single "special" (branch)
stair.

Breaks saves and bones.

Adds information to migrating objects and monsters for the dungeon
and level where they are migrating from.

4 years agofix #K2924 - breaking a wand without free hands
PatR [Thu, 12 Nov 2020 12:30:25 +0000 (04:30 -0800)]
fix #K2924 - breaking a wand without free hands

Breaking a wand didn't require the hero to have free hands.
That's definitely a bug when they're both welded to the same
two-handed weapon.  It's debatable when welded separately to
a one-handed weapon and to a shield but simpler to pretend
there's no such distinction.

This also makes glass wand join balsa wand as "fragile".  Hero
doesn't need as much strength to break them as other wands and
the wording for breaking them is slightly different.

My fixes entry initially had a trailing space.  When I took
that out, I spotted a couple of others so take those out too.

4 years agoQt paper doll's depiction of two-handed weapon
PatR [Mon, 9 Nov 2020 00:38:01 +0000 (16:38 -0800)]
Qt paper doll's depiction of two-handed weapon

When wielding a two-handed weapon, Qt's paper doll shows uwep
in the shield slot as well as in the weapon slot to reflect
that it's occupying both hands.  Make the shield slot's copy
be a mirror image of the weapon's tile so that it looks less
like wielding two weapons.

4 years agofix github issue #408 - stuck to distant mimic
PatR [Mon, 9 Nov 2020 00:07:42 +0000 (16:07 -0800)]
fix github issue #408 - stuck to distant mimic

Attacking a concealed mimic at range by applying a polearm
could make the hero be stuck to that mimic in addition to
bringing it out of hiding.  Only do that when adjacent.

This also adds a new sanity check when setting u.ustuck.
It may get triggered by other sticking activity since only
attacking has been tested.  The check must be explicitly
enabled by setting the wizard mode 'sanity_check' option.

Fixes #408

4 years agoQt paper doll comments
PatR [Sat, 7 Nov 2020 10:32:50 +0000 (02:32 -0800)]
Qt paper doll comments

4 years agoQt: update a couple of source comments
PatR [Sat, 7 Nov 2020 00:48:35 +0000 (16:48 -0800)]
Qt: update a couple of source comments

4 years agogithub pull request #406 - polyfodder() macro
PatR [Fri, 6 Nov 2020 00:03:05 +0000 (16:03 -0800)]
github pull request #406 - polyfodder() macro

Some eggs and tins could cause an out of bounds index into the
mons[] array.  Post-3.6 bug: the faulty part of the test is only
relevant for 3.7 genetic engineer monster.  Earlier versions just
called pm_to_cham() which does it's own index validation.

Fixes #406

4 years agoQt text windows
PatR [Thu, 5 Nov 2020 23:35:30 +0000 (15:35 -0800)]
Qt text windows

Text window search behaved very strangely:  at some point after
selecting [Search], entering a search string, having the string
entry popup go away, and having the search performed, but before
the result could be shown, the text window got pushed behind the
main window (map+messages+paperdoll+status).  Clicking on the
main window's minimize button hid the main window and gave access
to the text window behind it.  That was still functional even
after having been inaccessible; another search could be performed
and/or it could be dismissed.  I still don't know what causes
that or how to properly fix it, but using raise() is a workaround
to bring it to the front where it belongs.  Unfortunately you can
see it go away and come back so searching for text is distracting.

Allow <return> (when not searching) to dismiss all text windows
including RIP.  Accept ctrl+[ as ESC.

Make text window searching be case-insensitive.

Searching wouldn't find a match on the first line of text.  Now
it will.

This also includes an attempt to fix github issue #400 (typing a
pickup command while "things that are here" popup text window is
displayed seems to hang the program), but since I can't reproduce
that, I can't tell whether the fix works.  The issue description
says that pickup started executing and "things here" couldn't be
dismissed which is different from "things here" being behind the
map waiting for it to be dismissed.  The attempted fix is for text
window handling to tell Qt that it wants control of the keyboard,
so nethack shouldn't see any attempted pickup command.

4 years agoQt string requestor
PatR [Thu, 5 Nov 2020 22:36:13 +0000 (14:36 -0800)]
Qt string requestor

Some enhancements to the widget used to get player input for
getline() and also menu search and text window search.

give caller control of [cancel] and [okay] button names;
give caller a say in how wide the string input box should be
  instead of basing that on the length of the prompt string
  (needs more work...);
use fixed-width font for displaying the user's input;
clean up the widget layout a little bit.

src/Makefile needs a dependency update for Qt (not included).

4 years agoQt str_copy()
PatR [Thu, 5 Nov 2020 22:28:17 +0000 (14:28 -0800)]
Qt str_copy()

The Qt interface's routine to perform a bounded string copy
ignored the limit when copying and only honored the limit to
lie about the return length.

4 years agoremove obsolete 3.6 compat - Schroedinger's cat
PatR [Wed, 4 Nov 2020 18:17:21 +0000 (10:17 -0800)]
remove obsolete 3.6 compat - Schroedinger's cat

Remove unneeded code.  Noticed while looking for an explanation
of the reported attempt to light eggs.

4 years agoIncrease EDITLEVEL post Zombie Apocalypse
Pasi Kallinen [Wed, 4 Nov 2020 09:36:49 +0000 (11:36 +0200)]
Increase EDITLEVEL post Zombie Apocalypse

I forgot to increase EDITLEVEL, as the Zombie Apocalypse added a timeout
routine, messing up saves and bones.

4 years agoignitable() macro
PatR [Tue, 3 Nov 2020 22:25:06 +0000 (14:25 -0800)]
ignitable() macro

ignitable() was excluding magic lamp and then every place that
used it did so as 'ignitable(obj) || obj->otyp == MAGIC_LAMP'
so just include magic lamp.

I noticed that while hunting for an explanation for report #K2734
where returning to a previously visited level triggered the
warning "begin_burn: unexpected eggs".  I've decided that the
zombie apocalypse is probably the cause.  It inserted a new type
of timer in the list of such but it didn't bump EDITLEVEL to
invalidate save and bones files which relied on indices into the
old list.  I'm not sure whether we should bump that now.

4 years agomore Amask2align()
PatR [Sun, 1 Nov 2020 22:30:25 +0000 (14:30 -0800)]
more Amask2align()

Recent change to Amask2align() was only masking the shrine bit
off its argument some of the time.

4 years agoQt hitpointbar coloring
PatR [Sun, 1 Nov 2020 21:46:16 +0000 (13:46 -0800)]
Qt hitpointbar coloring

A couple of colors used by the Qt hitpointbar didn't look very good.
Switch to lighter green because the named value for that is too dark.
It was using the wrong value for orange; the right one isn't too dark
after all.

4 years agoQt: yn dialog bit
PatR [Sat, 31 Oct 2020 22:34:47 +0000 (15:34 -0700)]
Qt: yn dialog bit

Take care of a Qt TODO:  when using 'popup_dialog' and entering
a count during a yn#aq question, change the default answer button
from 'n' to 'y' since ending the count with <return> accepts it.

4 years agocomment accuracy
PatR [Sat, 31 Oct 2020 19:49:13 +0000 (12:49 -0700)]
comment accuracy

4 years agomerge pr #403 wasm fixes
nhmall [Sat, 31 Oct 2020 13:30:38 +0000 (09:30 -0400)]
merge pr #403 wasm fixes

Closes #403

4 years agoMerge branch 'wasm-pr403' into NetHack-3.7
nhmall [Sat, 31 Oct 2020 13:29:46 +0000 (09:29 -0400)]
Merge branch 'wasm-pr403' into NetHack-3.7

4 years agoMerge branch 'wasm-bug-fixes' of https://github.com/apowers313/NetHack into wasm...
nhmall [Sat, 31 Oct 2020 13:22:55 +0000 (09:22 -0400)]
Merge branch 'wasm-bug-fixes' of https://github.com/apowers313/NetHack into wasm-pr403

4 years agomore alignment conversion
PatR [Sat, 31 Oct 2020 00:46:21 +0000 (17:46 -0700)]
more alignment conversion

The overview code could reveal the true alignment of an altar
if hero saw a mimic pretending to be an altar on that spot, or
reveal junk for the alignment when mimicking at altar on some
other spot.

Avoid passing macros that might evaluate their arguments more
than once to other macros which might also do that.  The hidden
code expansion can easily get out of hand (although in this case
it was modest).

Also, get rid of the unused MSA_foo alignment values since two
of them had the values swapped.  Lastly, make Amask2align() more
robust in case a value with the shrine bit set gets passed to it.

4 years agoFix memory leak when adding basic color menucolors
Pasi Kallinen [Fri, 30 Oct 2020 21:01:50 +0000 (23:01 +0200)]
Fix memory leak when adding basic color menucolors

4 years agoEnable checkpointing again by default
Patric Mueller [Fri, 30 Oct 2020 19:30:21 +0000 (20:30 +0100)]
Enable checkpointing again by default

This was accidentally changed in the options refactoring in commit 68fdc3bbcb.

4 years agorevert to numeric
nhmall [Fri, 30 Oct 2020 13:14:23 +0000 (09:14 -0400)]
revert to numeric

4 years agowarning and a bit of alignment-related header consolidation
nhmall [Fri, 30 Oct 2020 13:08:23 +0000 (09:08 -0400)]
warning and a bit of alignment-related header consolidation

4 years agoRestful sleep regenerates hp
Pasi Kallinen [Thu, 29 Oct 2020 17:14:28 +0000 (19:14 +0200)]
Restful sleep regenerates hp

When sleeping due to wearing an amulet of restful sleep,
hit points will regenerate, one point faster than with normal regeneration.

4 years agoQt character selection hackery
PatR [Thu, 29 Oct 2020 01:07:27 +0000 (18:07 -0700)]
Qt character selection hackery

Tweak the Qt character selection widget format a bit.  Forcing
the 'logo' string to be taller has resulted in stretching the
window enough to fit all the roles without a scrollbar.  (On my
monitor on my OSX system, that is.  It won't necessarily be an
improvement for anybody else but shouldn't break anything.)

The TODO item about making it taller so that role list fits is
still there.

4 years agoQt: character selection
PatR [Wed, 28 Oct 2020 08:43:53 +0000 (01:43 -0700)]
Qt: character selection

For Qt's character selection widget, only allow the [Play] button
to be used when the character name field is non-blank.  When that
field is blank, show "(required)" there.

Catch up with SYSCF for checking generic names like "player".

Fix up handling for some conditionally unused variables.

4 years agoQt: new game vs saved game selection
PatR [Tue, 27 Oct 2020 22:10:22 +0000 (15:10 -0700)]
Qt: new game vs saved game selection

If player got Qt's saved game selection widget at startup but
picked "new game" there, the save file for the last character
in the list of saved games would be clobbered with the new
character's game if a save was performed.  It wasn't necessarily
easy to spot because saved game selection shows the character
name from inside the file rather than from the file name, so the
next restore would look normal except for one older character
missing.

Noticed while testing:  when you used the character selection
widget (either by picking "new game" in saved game selection or
because there aren't any save files), if you blanked out the
name field or it was already blanked because a generic name like
"player" had been specified, then clicked on "play", the program
would get stuck in a loop somewhere.  I didn't try to figure out
where, just changed qt_askname() to revert to original name if
it ended up with a blank one.

4 years agoQt saved game selection
PatR [Tue, 27 Oct 2020 05:37:40 +0000 (22:37 -0700)]
Qt saved game selection

This fixes the Qt popup widget for selecting among saved games.
The character name from each applicable save file is shown in a
button and clicking on one of those buttons restores corresponding
file.  Previously all the buttons were written on top of each
other so only the final name was visible and the button for the
initial name received the click.  The widget also has [quit] and
[new game] buttons.

This fixes restoring an existing save file if no character name
is supplied on the command line in the options.  It does not fix
the problem where picking [new game] remembers the file name of
the last saved game in the popup's list and overwrites that file
(after requesting confirmation to do so) if/when you eventually
save.  The resulting file will contain the character just saved
but be named for the earlier one.  It may not be obvious because
on subsequent restores it will list names from inside the files
rather than deduce those from file names, so the clobbered/
misnamed file will just show up as the former new character.

4 years agoQt popup dialog input vs '&'
PatR [Mon, 26 Oct 2020 19:44:40 +0000 (12:44 -0700)]
Qt popup dialog input vs '&'

I'm not sure whether any yn_function() calls include ampersand
in the list of acceptable choices but if any did, the button
for that character would have shown up blank.  (Clicking on it
would have successfully produced '&' as player's input though.)

4 years agoQt hitpointbar
PatR [Sun, 25 Oct 2020 22:47:49 +0000 (15:47 -0700)]
Qt hitpointbar

Add support for the 'hitpointbar' to the Qt interface.  Rather
than rendering the status title (name+rank or name+monster_species)
using inverse video for leading substring to produce distinct left
and right sides, draw a horizontal bar above that field.

The left portion (current health) is thicker and uses red for <10%
or <5hp, orange for <25% or <10hp, yellow for <50%, green for <75%,
blue for <100%, and black for 100%.

The right portion (missing maximum health) is thinner and runs
from white (paired with red), light gray (paired with orange),
dark gray (with yellow), plain gray (which turns out to be darker
than dark gray, with green), dark blue (with blue), and black (but
black is never shown for injury portion because that's suppressed
when at full health).

Qt already supports a square frame around the hero's map tile that
changes color according to health.  Turning the hitpointbar option
Off or On has no effect on that.

4 years agoList lamps and lanterns in charging prompt
Patric Mueller [Sun, 18 Oct 2020 23:52:46 +0000 (01:52 +0200)]
List lamps and lanterns in charging prompt

Brass lanterns and oil lamps are always chargeable.
Magic lamps are only listed if they are not yet identified.

4 years agoFix monster hiding under hatching egg staying hidden
Pasi Kallinen [Sat, 24 Oct 2020 15:27:34 +0000 (18:27 +0300)]
Fix monster hiding under hatching egg staying hidden

4 years agodisclosure prompt phrasing
PatR [Sat, 24 Oct 2020 10:17:19 +0000 (03:17 -0700)]
disclosure prompt phrasing

With to-be-3.7, if game ends without any achievements, the conduct
disclosure prompt is the same as it has always been
  Do you want to see your conduct?
If it ends after attaining one achievement (probably entering the
mines or acquiring the second rank title when gaining Xp level 3)
you're asked
  Do you want to see your conduct and achievement?
which looks awkward after the fact if 'y' reveals multiple conducts.

Instead of deciding whether to pluralize "conduct(s)", simplify the
prompt when one or more achievements have been attained to be
  Do you want to see your conduct and achievements?
That works even when there is only one achievement.

4 years agoFix "may be used uninitialized" warning
Patric Mueller [Sat, 24 Oct 2020 09:38:22 +0000 (11:38 +0200)]
Fix "may be used uninitialized" warning

4 years agofix #K2622 - fire/frost horn feedback for monster
PatR [Sat, 24 Oct 2020 03:15:01 +0000 (20:15 -0700)]
fix #K2622 - fire/frost horn feedback for monster

When a monster used a fire horn or frost horn to attack the hero,
the feedback claimed that the attack was being directed at itself.
The error occurred in code that was added to 3.7 during 3.6
development but wasn't present in 3.6.x so fixes entry is in the
"exposed by git" section.

4 years agofix #K2617 - metallivores eating iron bars
PatR [Sat, 24 Oct 2020 02:43:10 +0000 (19:43 -0700)]
fix #K2617 - metallivores eating iron bars

Monsters with rust attacks (rust monster) and corrosion attacks
(black pudding, gray ooze) can eat or otherwise destroy iron bars
but xorns could only move through the iron bars spot without being
able to eat the metal there.  Change xorn to eat bars instead of
phazing through them.  Lets rock moles eat bars too.

Hero polymorphed into a rust monster would eat bars if trying to
move to their location but couldn't do so if already there (maybe
was in xorn form and now in rust monster form).  Xorns could pass
through them but not eat them.  Allow hero metallivores to eat
bars at the current location via 'e', similar to eating food off
the floor.  Hero as rock mole behaves like rust monster.

4 years agoMild Zombie Apocalypse
Pasi Kallinen [Wed, 21 Oct 2020 18:04:03 +0000 (21:04 +0300)]
Mild Zombie Apocalypse

When a zombie (or lich) kills a monster in melee without a weapon,
the monster can rise few turns later as a zombie.

The only creatures that can be zombified are ones that actually have
a zombie counterpart monster. A zombie cannot turn a jackal into
a zombie, for instance. But it could turn a shopkeeper into a human
zombie, or a dwarf king into a dwarf zombie.

Zombies will fight with monsters that can be turned into zombies.

Originally this was a SliceHack feature, but this is based on xNetHack
version of it, with some modifications.

4 years agoTossed upwards objects got two times half physical damage reduction
Patric Mueller [Fri, 23 Oct 2020 09:02:59 +0000 (11:02 +0200)]
Tossed upwards objects got two times half physical damage reduction

4 years agoAdd stringization of nhassert expression.
Bart House [Wed, 21 Oct 2020 03:14:27 +0000 (20:14 -0700)]
Add stringization of nhassert expression.

4 years agoclear a couple of new warnings
nhmall [Tue, 20 Oct 2020 23:37:51 +0000 (19:37 -0400)]
clear a couple of new warnings

mondata.c:198:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.

steed.c:43:17: warning: unused variable 's' [-Wunused-variable]
    const char *s;
                ^
1 warning generated.

4 years agoMatch object description via single function
Pasi Kallinen [Tue, 20 Oct 2020 16:19:54 +0000 (19:19 +0300)]
Match object description via single function

making the code more readable.

Instead of doing strcmp(OBJ_DESCR(objects[otyp]), "foo"),
just call objdescr_is(obj, "foo")

(via xNetHack)

4 years agoAdd cpp.hint file to NetHack project.
Bart House [Sun, 18 Oct 2020 21:56:15 +0000 (14:56 -0700)]
Add cpp.hint file to NetHack project.

4 years agoAdd inlcude files to NetHackW project. Add cpp.hint file.
Bart House [Sun, 18 Oct 2020 00:25:00 +0000 (17:25 -0700)]
Add inlcude files to NetHackW project.  Add cpp.hint file.

4 years agoFix compiler warning.
Bart House [Sun, 18 Oct 2020 23:13:52 +0000 (16:13 -0700)]
Fix compiler warning.

4 years agoFix sign/unsigned comparison bug.
Bart House [Mon, 19 Oct 2020 23:19:01 +0000 (16:19 -0700)]
Fix sign/unsigned comparison bug.

We are comparing a signed char with unsigned int.  The signed char will be
sign exetended when converted to unsigned int causing an unexpected
result.

4 years agoRemoving assertion that does not hold under all scenarios.
Bart House [Sat, 13 Jul 2019 17:53:53 +0000 (10:53 -0700)]
Removing assertion that does not hold under all scenarios.

When we save gamestate as part of making an insurance snapshot, we will
save message history which will clear toplines but leaving window state
in tack including the need for more.

4 years agoAdded assertions to check toplin state.
Bart House [Fri, 12 Jul 2019 03:58:20 +0000 (20:58 -0700)]
Added assertions to check toplin state.

4 years agoFixed bug with inmore and toplin state management.
Bart House [Fri, 12 Jul 2019 04:04:29 +0000 (21:04 -0700)]
Fixed bug with inmore and toplin state management.

When fuzzing, we would increment ttyDisplay->inmore but then prematurely
exit more() leaving ttyDisplay->inmore set.

Under various conditions, we can request to remember the topline when
the topline had not yet been acknowledged leaving toplin state in an
inappropriate state.

4 years agoAdd stopping in the debugger when nhassert() is hit in the windows port.
Bart House [Sat, 13 Jul 2019 23:00:14 +0000 (16:00 -0700)]
Add stopping in the debugger when nhassert() is hit in the windows port.

When stopping in the debugger after having called impossible, the windowing
state will have been modified since the assertion was hit.  This made
examining state that caused the nhassert to fire no longer possible.
To avoid this issue, we now detect the debugger and stop in the debugger
prior to impossible.

4 years agoTweaks to nhassert implementation. Change to warnings on MSC build.
Bart House [Sat, 13 Jul 2019 01:40:34 +0000 (18:40 -0700)]
Tweaks to nhassert implementation.  Change to warnings on MSC build.

4 years agoAdded nhassert to core.
Bart House [Fri, 12 Jul 2019 05:01:39 +0000 (22:01 -0700)]
Added nhassert to core.

4 years agoModified nhassert_failed to call impossoible.
Bart House [Fri, 12 Jul 2019 03:55:27 +0000 (20:55 -0700)]
Modified nhassert_failed to call impossoible.

4 years agoRemove the remapping of snprintf to _snprintf when compiling with MSC.
Bart House [Fri, 12 Jul 2019 03:46:19 +0000 (20:46 -0700)]
Remove the remapping of snprintf to _snprintf when compiling with MSC.

_snprintf and snprintf have one very important semantic difference.
_snprintf does NOT add terminating null character when the buffer limit
is reached while snprintf guarantees a terminating null character.  It
was a mistake to make this naming change hiding the fact that the
semantics don't match what the developer might expect.

4 years agoImproved readability of topline state management.
Bart House [Thu, 11 Jul 2019 05:16:08 +0000 (22:16 -0700)]
Improved readability of topline state management.

4 years agofix wasm runtime errors
Adam Powers [Mon, 19 Oct 2020 20:22:02 +0000 (13:22 -0700)]
fix wasm runtime errors

4 years agoremove wasm
Adam Powers [Mon, 19 Oct 2020 20:21:40 +0000 (13:21 -0700)]
remove wasm

4 years agofix NO_SIGNAL
Adam Powers [Mon, 19 Oct 2020 20:21:07 +0000 (13:21 -0700)]
fix NO_SIGNAL

4 years agofix build flags
Adam Powers [Mon, 19 Oct 2020 18:55:04 +0000 (11:55 -0700)]
fix build flags

4 years agowasm requires HACKDIR for embedded files
Adam Powers [Mon, 19 Oct 2020 18:54:42 +0000 (11:54 -0700)]
wasm requires HACKDIR for embedded files

4 years agoupdate to new build system
Adam Powers [Mon, 19 Oct 2020 18:49:34 +0000 (11:49 -0700)]
update to new build system

4 years agofix build path
Adam Powers [Mon, 19 Oct 2020 18:47:56 +0000 (11:47 -0700)]
fix build path

4 years agofix stash merge conflict
Adam Powers [Mon, 19 Oct 2020 18:45:22 +0000 (11:45 -0700)]
fix stash merge conflict

4 years agoPrevent ghosts from being renamed
Pasi Kallinen [Sun, 18 Oct 2020 17:20:55 +0000 (20:20 +0300)]
Prevent ghosts from being renamed

(via xNetHack)

4 years agoSpitting monsters try to stay away from melee range
Pasi Kallinen [Sun, 18 Oct 2020 16:18:38 +0000 (19:18 +0300)]
Spitting monsters try to stay away from melee range

4 years agoQt status window icon alignment
PatR [Sat, 17 Oct 2020 18:10:00 +0000 (11:10 -0700)]
Qt status window icon alignment

When the game windows were initialized, the anhk icon for alignment
was centered relative to Lawful/Neutral/Chaotic label but during
the first status update it noticeably shifted left.  Non-blank
hunger or encumbrance states could change from centered to left
justified when they were present and the icon was replaced.  Oddly,
resetting the 'centered' attribute for the widget wasn't sufficient
to fix this.  Running the resize code for that widget did.  Another
case of trial and error to make things work the way they ought.

Also, don't highlight a change in alignment or dungeon location as
"got worse" if the internal numeric value went down instead of up;
always highlight as "got better" for those two fields.  There ought
to be a third choice for just "changed" but that would have been
more complicated.

4 years agoFix thinko in reset travel dest condition
Pasi Kallinen [Sat, 17 Oct 2020 13:48:07 +0000 (16:48 +0300)]
Fix thinko in reset travel dest condition

4 years agoOnly reset if we actually went to travel destination
Pasi Kallinen [Sat, 17 Oct 2020 09:13:17 +0000 (12:13 +0300)]
Only reset if we actually went to travel destination

4 years agoReset travel destination if reached via teleport
Pasi Kallinen [Sat, 17 Oct 2020 09:08:47 +0000 (12:08 +0300)]
Reset travel destination if reached via teleport

4 years agoPre-populate teleport destination prompt with travel destination
Pasi Kallinen [Fri, 16 Oct 2020 16:10:17 +0000 (19:10 +0300)]
Pre-populate teleport destination prompt with travel destination

This has been implemented in multiple variants, and seems like
a small but useful quality of life improvement.

4 years agoQt paperdoll - slight reorganization
PatR [Fri, 16 Oct 2020 01:22:26 +0000 (18:22 -0700)]
Qt paperdoll - slight reorganization

Three-way swap:  move blindfold to alt-weapon slot, alt-weapon to
quiver slot, and quiver to former blindfold slot.  Affects first
and third rows of the 6x3 grid.

Before  |After
 x H b  | b H q
 S a w  | S a w
 G C q  | G C x

[x=alt-weapon, H=helmet, b=blindfold, S=shield, a=amulet, w=weapon,
 G=gloves, C=cloak, q=quiver; bottom three rows not changed so not
 shown.]

4 years agorecognize visual studio 2019 16.7.6 in sys/winnt/Makefile.msc
nhmall [Thu, 15 Oct 2020 13:38:52 +0000 (09:38 -0400)]
recognize visual studio 2019 16.7.6 in sys/winnt/Makefile.msc

4 years agoQt paperdoll - tool tips used to describe items
PatR [Wed, 14 Oct 2020 23:06:25 +0000 (16:06 -0700)]
Qt paperdoll - tool tips used to describe items

New for Qt, moving the mouse over one of the slots in the paperdoll
inventory subset and letting it pause there will use Qt's tool tip
mechanism to give a description of the item under the pointer, if
there is one, or of what the slot would contain when there isn't.

So "e - uncursed leather gloves (being worn)" or "no gloves" when
the pointer is over the glove slot.  If you do something with the
keyboard to make the paperdoll change while the mouse is still
hovering, you'll need to move the pointer slightly to have Qt
recheck for tool tip at that spot.  It may be feasible to force
an immediate update, but I'm satisfied with how it's working.

Interestingly, you can move pointer and hover while yn_function()
has asked you to pick an inventory item and is waiting for an
answer.  Mostly useful for Take-off/Remove or #adjust.

4 years agoartifact.h formatting
PatR [Wed, 14 Oct 2020 16:25:45 +0000 (09:25 -0700)]
artifact.h formatting

The automated reformatting way back when left artifact.h in need
of manual fixup, particularly SPFX_HPHDAM.

4 years agoQt toolbar: add button for 'search'
PatR [Wed, 14 Oct 2020 10:02:55 +0000 (03:02 -0700)]
Qt toolbar: add button for 'search'

The toolbar contains do-Again, Pick up, Drop, Kick, Throw, Fire,
Eat, and Rest.  Insert Search in front of Rest since it's useful
in its own right and some players prefer it even when resting.
Includes a new 12x13 icon; a tiny magnifying glass shown straight
on is something I can manage.

4 years agoQt "Get" -> "Pick up"
PatR [Tue, 13 Oct 2020 21:05:52 +0000 (14:05 -0700)]
Qt "Get" -> "Pick up"

Both the toolbar button for pick up and the action menu entry for
pick up were labeled "Get".  That's confusing for an experienced
player who is looking for "Pick up".  Rename both of them.

Also, consolidate repetitive code used to set up toolbar buttons.

4 years agoQt toolbar 'rest' button
PatR [Tue, 13 Oct 2020 20:41:57 +0000 (13:41 -0700)]
Qt toolbar 'rest' button

An issue in the core made the "Zz" button in the Qt toolbar only
work if rest_on_space was enabled.  cmd_from_func() was returning
' ' instead of '.' for the keystroke to run the rest command.

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Sun, 11 Oct 2020 18:30:30 +0000 (14:30 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agocron daily Files update
nhmall [Sun, 11 Oct 2020 18:29:16 +0000 (14:29 -0400)]
cron daily Files update

4 years agomore integration suggestion adoption
nhmall [Sun, 11 Oct 2020 17:42:12 +0000 (13:42 -0400)]
more integration suggestion adoption

4 years agoadopt some integration suggestions
nhmall [Sun, 11 Oct 2020 17:33:51 +0000 (13:33 -0400)]
adopt some integration suggestions

sys/lib -> sys/libnh
sys/lib/libnethackmain.c -> sys/libnh/libnhmain.c
libnethack.a -> libnh.a

4 years agoget this working: "make wasm"
nhmall [Sun, 11 Oct 2020 14:51:46 +0000 (10:51 -0400)]
get this working: "make wasm"

4 years agolibnethackmain.c includes date.h
nhmall [Sun, 11 Oct 2020 13:43:15 +0000 (09:43 -0400)]
libnethackmain.c includes date.h

4 years agofollow-up bit
nhmall [Sun, 11 Oct 2020 13:16:23 +0000 (09:16 -0400)]
follow-up bit
remove an unnecessary dependency for top Makefile wasm

4 years agoMerge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into...
nhmall [Sun, 11 Oct 2020 13:12:02 +0000 (09:12 -0400)]
Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7

4 years agocross-compiles need not build host native lua library
nhmall [Sun, 11 Oct 2020 13:08:27 +0000 (09:08 -0400)]
cross-compiles need not build host native lua library

Because some Makefile.top dependencies triggered the build
of the host native lua library, the cross-compiles were
building it needlessly.

Make it a make variable so that it can be overridden by
cross-compile recipes in sys/unix/hints/include/cross-*.2020

4 years agocron daily Files update
nhmall [Sat, 10 Oct 2020 23:36:36 +0000 (19:36 -0400)]
cron daily Files update