Commit Graph

8362 Commits

Author SHA1 Message Date
nhmall
397eddedf0 Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6 2019-05-28 21:24:56 -04:00
nhmall
b51c0ebb6f clean up Windows panic results further 2019-05-28 21:24:04 -04:00
PatR
f476638ee0 wizard mode memory leak in endgame
Leaving the Plane of Water to return to a previously visited endgame
level didn't free the air bubbles unless/until you visit a new level.
Returning to that level creates a new set of air bubbles, losing track
of the previous set.  Likewise with Plane of Air and its clouds.  (Not
an issue with actual save and restore when on those levels, or when
just moving forward to not-yet-visited levels.)

Not applicable to normal play where it isn't possible to return to a
previously visited endgame level.

For 3.7, bubble save/restore ought to become part of savlev() instead
of being handled by savegamestate().
2019-05-28 17:08:48 -07:00
PatR
f478b4ec95 curses getline()
After going back and forth between prompts causing message lines
to be overwritten and to be skipped, this yoyo might have finally
run out of string.  Fingers crossed....
2019-05-28 02:27:40 -07:00
PatR
c61d3d6403 curses message window
Fix a 'FIXME': don't follow a message with two spaces in anticipation
of combining with the next one, precede the next one with two spaces
when they're being combined.  Keeps nethack's message window <mx,my>
coordinates in sync with curses' internal coordinates.
2019-05-28 01:52:37 -07:00
nhmall
6f71f483d2 make the rc file match the build target name for Windows 2019-05-27 18:42:25 -04:00
nhmall
09412274e6 Windows .rc files
bump the version in the win/win32/*.rc files

side note: winhack.rc wasn't properly updated for the 3.6.2 release
2019-05-27 17:38:54 -04:00
PatR
6c0f92a264 end of game oddities: thrownobj, ball&chain
If you died while Punished but with attached ball and chain temporarily
off the map (changing levels and when swallowed are the cases I looked
at; there may be others), the ball and chain objects would not appear
in bones (for the falling-down-stairs case; bones are never saved if
hero dies while swallowed) and they weren't being freed.  Put them
back on the map so that they'll be included in bones and also freed as
part of normal map cleanup.

This caused a problem if the attached ball had state OBJ_FREE due to
being thrown rather than being temporarily off the map.  'thrownobj'
was being deallocated without first cancelling punishment, so uball
object was freed via thrownobj pointer but stale uball pointer still
referenced it.  Unpunishing would introduce sequencing issues because
that would need to be after attribute disclosure.  So instead of
deallocating thrown or kicked object, put it/them (can't actually have
both at the same time) back on the map.  This has a side-effect of
saving thrown Mjollnir in bones if it kills hero when failing to be
caught upon return.  (I thought that that had been fixed ages ago?)
2019-05-26 18:44:25 -07:00
PatR
b3689411dd ball.c formatting
Mostly a couple of block comments.
2019-05-26 18:23:05 -07:00
PatR
1702f55c18 savelev() pasta
Avoid some of the spaghetti [mostly the alternate call to
savecemetery()] in savelev().  There should be no change in behavior.
2019-05-26 07:24:52 -07:00
PatR
d06b99d392 free level.bonesinfo
Bones information for the current level was freed during save but not
at end of game.  Have freedynamicdata() call savelev(,,FREE_SAVE) to
throw away current level instead of trying to duplicate the actions
that performs.
2019-05-26 00:40:40 -07:00
PatR
ba6edbe5dc save.c cleanup
Mostly 'sizeof' usage.  This has been sitting around for a while and
I wanted to get it out of the way before making some other save.c
changes.
2019-05-26 00:11:53 -07:00
PatR
5cc7301965 free overview->final_resting_place
The #overview command can provide some feedback about levels loaded
from bones files; that data wasn't being released at end of game.

(There are two copies of that data, one set always in memory with
the overview data [final_resting_place field in the 'mapseen' data],
and another set with portions attached to each relevant level [via
level.bonesinfo].  Neither set was being properly freed; this only
addresses one of them, so far. The per-level data can probably be
eliminated--for post-3.6--since DUNGEON_OVERVIEW isn't a conditional
feature as it was when that was implemented.)
2019-05-25 23:43:42 -07:00
nhmall
f5bc41cc53 refer to the same level the same way in fixes file 2019-05-25 12:25:05 -04:00
Pasi Kallinen
2562144503 Make sure the correct luckstone is the prize
The first generated luckstone is marked as the prize in mines' end.
Make sure we generate the intended one first, before any other
(possibly randomly generated) luckstones.
2019-05-25 19:15:56 +03:00
nhmall
ad47095a5e Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6 2019-05-25 12:01:58 -04:00
nhmall
8a5ffa4085 do not mark multiple luckstones as the prize in mines-end
if one of the random objects happened to be a luckstone then
it and the explicit one got marked as a prize.

Following this change, only one will be marked as the prize,
but a follow-up on the order of things in mines.des may be
warranted to ensure it is the explicitly placed luckstone.
2019-05-25 11:58:32 -04:00
PatR
6bd2f4979c curses memory leak
Back in February, my e991dd1b0c added
ESC (when there's no input) as an early return for curses' getline,
but it neglected to clean up some allocated memory.
2019-05-25 07:37:08 -07:00
nhmall
c5d6ac5561 whitespace bit 2019-05-25 00:42:29 -04:00
nhmall
9361a9153b swap places with pet onto boulder location
when co-located with a boulder you could sometimes swap places
with pets of any size

bg72
2019-05-25 00:33:47 -04:00
nhmall
fa8efb15fb vortex database update
Reported:
"The data.base entry for "vortex" is erronous, as fire and energy vortices have passive attacks (which count as "touching")"
2019-05-24 22:36:21 -04:00
PatR
ba5efe7f61 curses message window vs prompting
Fix a problem introduced by f218e3f15e
and/or a19e64e470.  Sometimes the line
after a prompt would be empty and the next message get shown on the
line after that.  a19e64e470 was intended to fix the opposite problem
so probably overshot the mark....
2019-05-24 01:33:45 -07:00
PatR
5de1666f9c curses message window refresh
Sometimes curses tears down and recreates all its windows (when the
display is resized, for instance) and after doing that it repopulates
the message window with data saved for use by ^P.  But it was showing
the oldest messages available rather than the most recent ones.

There is still room for improvement.  That process combines short
messages but the refresh is based on the available number of lines;
combining messages can result in lines at the bottom of the message
window being left blank.  This could be fixed by reverse-scrolling the
window and inserting more messages at the top, or by combining short
messages in history data instead of at refresh time.  The second seems
easier but won't handle changing the message window's width sensibly,
and neither method handles wrapped, long lines well.  A More>> prompt
(possibly more than one) is issued if the refresh shows too many lines
(either because long messages already took multiple lines or because
the window has become narrower and ones which used to fit now need to
be wrapped).
2019-05-23 18:56:20 -07:00
PatR
3863b17384 curses: remove duplicate wincap2 bit
WC2_HITPOINTBAR was OR'd into wincap2 bitmask twice.
2019-05-23 17:54:37 -07:00
nhmall
23c613c42c vs 2019 update bit 2019-05-23 00:11:18 -04:00
nhmall
564dcd6576 xans fly, but could not reach your feet if you flew 2019-05-22 18:27:03 -04:00
PatR
d541f108f4 fix #H8769 - steed drowns on Plane of Water
Air bubble movement on the Plane of Water manipulated <u.ux,u.uy>
directly when changing hero's coordinates, leaving steed with old
coordinates, resulting in dunking it when the old spot switched from
air to water.  Switch to u_on_newpos() which moves the steed with
the hero and also handles clipping when the screen is too small to
show the whole map at once.
2019-05-22 14:59:43 -07:00
PatR
1e2e3bf492 ball and chain sanity check revisited
Move some duplicated debugging code into its own routine.
2019-05-21 17:40:57 -07:00
nhmall
31e6421348 closes #79 2019-05-20 23:45:51 -04:00
nhmall
cc7353f88d Merge branch 'spixi-engravings' into NetHack-3.6 2019-05-20 23:43:18 -04:00
nhmall
848d954a7c Merge branch 'NetHack-3.6.0' of https://github.com/spixi/NetHack into spixi-engravings 2019-05-20 23:41:40 -04:00
PatR
716b72d682 wintty.c comments
Some minor stuff I had pending that I stripped away for the status
conditions patch.
2019-05-20 18:08:32 -07:00
nhmall
cd6c2ebcdf status line count (word two) bit 2019-05-20 15:16:57 -04:00
nhmall
7d7111ec03 status_sanity_check is most useful in WIP and beta so restrict it 2019-05-20 12:08:51 -04:00
PatR
4c93e1fa21 more #H8609 - tty status condition rendering
The earlier fix removed a valid optimization which happened to be
implemented incorrectly.  Put that back.  It also left an invalid
optimization when applied to conditions.  Remove that one.

I don't think either of these explains truncating 'y' off of "Hungry"
which was shown in one of the reports.
2019-05-20 05:26:19 -07:00
nhmall
cbb3dbb5f5 make it tougher for incomplete render_status() to go unnoticed
Adds a sanity check that will write a paniclog
message if a code change prevents completion of
render_status() for each dirty (changed) field.
2019-05-20 01:33:33 -04:00
nhmall
e653868833 fix a botl status display issue
Reported as #H8609 (1679)

Some code recently added to render_status() for BL_CONDITION:
    if (!tty_condition_bits)
        continue;
was short-circuiting the required copy of NOW
values to BEFORE values for later comparison
further down in the for-loop.
    tty_status[BEFORE][idx] = tty_status[NOW][idx];

This caused some fields to be bypassed for rendering
once no more tty_condition_bits were set because the
length comparisons would match.
2019-05-19 23:35:21 -04:00
nhmall
46d85db233 remove a debug bit from Makefile.msc 2019-05-19 11:55:05 -04:00
nhmall
811fb0174b Makefile.msc bit for Windows 2019-05-19 11:48:20 -04:00
PatR
d1ce0aac89 fixes github issue #190 - EDIT_GETLIN for curses
Fixes #190

Add EDIT_GETLIN support for curses.  It remains disabled by default.
2019-05-18 23:52:04 -07:00
nhmall
8aac36c073 don't merge globs with differing BUC status 2019-05-18 22:56:27 -04:00
nhmall
336908ad3c grammar bit 2019-05-18 16:44:57 -04:00
nhmall
670fc9ca34 further improve additional glob interaction scenarios within a shop
Scenarios:
1. shop_owned glob merging into shop_owned glob
2. player_owned glob merging into shop_owned glob
3. shop_owned glob merging into player_owned glob
4. player_owned glob merging into player_owned glob
2019-05-18 16:24:48 -04:00
PatR
a19e64e470 curses followup
Some prompts were being overwritten by the message that followed.

And clear_nhwindow(WIN_MESSAGE) gets called for just about every
keystroke so try to reduce the overhead I unwittingly added.  The
"scroll up one line earlier than the next message" mentioned in
the prior commit is much more obvious that I realized and prompt
erasure might need to be redone.
2019-05-18 08:12:43 -07:00
PatR
f218e3f15e fix #H8753 - curses message window anomalies
Autodescribe feedback and multi-digit count prompts are always shown
on the last line of the message window and are suppressed from message
history (both ^P and DUMPLOG).  When the message window is using all
available lines, the last one was being overwritten (until the count
or the feedback was completed or dismissed, then last line returned).
Adopt the suggestion that it be scrolled up a line instead of being
overwritten.  [I haven't been able to reproduce the reported problem
where shorter overlaid text left some of longer underlying text visible
but that should now become moot.]

Bonus fix:  while testing, I noticed that if your screen only has room
for a one-line message window and you used ESC to cancel 'pick a spot
with cursor' prompting before moving the cursor, the prompt was left
intact on the message line.  tty erases it in that situation, but the
clear_nhwindow(WIN_MESSAGE) was a no-op for curses because it usually
doesn't erase old messages.  This changes the curses behavior when the
core asks it to erase the message window:  now it forces one blank line
of fake autodesribe feedback (causing the prompt or other most recent
message to scroll off top), then removes that fake feedback (leaving
a blank message line).  For multi-line message window, the old messages
scroll up by one line sooner than they would when waiting for the next
real message but are otherwise unaffected.
2019-05-18 02:25:48 -07:00
PatR
345c1b719f unpaid glob formatting
Make unpaid (shop owned, that is) globs show same weight information
as for-sale globs.  And don't treat required arguments to globwt() as
if they were optional.
2019-05-17 13:38:34 -07:00
nhmall
2cf860fc47 Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6 2019-05-17 16:34:07 -04:00
nhmall
2d07b45582 warning bit 2019-05-17 16:30:52 -04:00
PatR
255d969da2 obj sanity checking specific to globs
Verify that objects with the globby bit set are actually glob objects,
that their quantity is 1, and that their weight at least superficially
makes sense.
2019-05-17 13:28:41 -07:00
nhmall
f172c6fd94 comment typo and an unused variable 2019-05-17 16:15:24 -04:00