Commit Graph

8380 Commits

Author SHA1 Message Date
PatR
689e7490ec extended ball&chain sanity check
Verify that the locations of ball and chain are consistent.
If chain is on floor then ball is on floor or in hero's inventory
else if chain is free then ball is free or in hero's inventory.
When chain is on floor it is under hero or one step away from hero
and when ball is on floor it is on chain or one step away from chain.
2019-06-03 02:36:44 -07:00
nhmall
0b74f2adeb makedefs: add enum support when generating pm.h
Only changes pm.h content if ENUM_PM is defined when compiling
util/makedefs.c

While NON_PM and LOW_PM could be included, it would require
for the makedefs.c compile, as well as an
around their macro definitions in permonst.h so for now those
particular lines are commented out in makedefs.c
2019-06-02 17:21:35 -04:00
nhmall
7d38435a9b don't clear mtmp->mx, mtmp->my even when obliterating 2019-06-02 10:34:38 -04:00
nhmall
5c30cc5890 elemental_clog() should not destroy the very monster trying to be placed 2019-06-02 08:15:41 -04:00
PatR
4e119f4f00 place_object(obj,0,0) debugging
Got a hit (on Plane of Water) pretty quickly.
2019-06-02 05:02:08 -07:00
nhmall
852995bbeb remove a couple of debugging lines in mon.c 2019-06-01 17:36:54 -04:00
nhmall
4eeebe5e20 fix gcc warning on linux 2019-06-01 17:26:15 -04:00
nhmall
5ee78c5204 improve full level handling in the endgame
Even though a goodpos failure in mnearto() would return 0 to
the caller and trigger proper overcrowding handling for mtmp,
the 'othermon' would be left with its mx,my set to 0,0 under
that circumstance and then trigger a mon_sanity_check()
failure and accompanying impossible() message a short while
afterwards.

This also includes the addition of some flags that proved useful
for troubleshooting the mystery sanity_check failure and helping
to understand some of the code paths the struct monst data had
been through. They are only used for inspection when issues are
reported or when debugging, they don't presently control the
code flow.  Their setting and use is done in an overloaded way
that should not intrude on the existing use of mspare1 for
MIGR_LEFTOVERS. mon->mstate is just a pseudonym for mon->mspare1
and does not alter save file content.
2019-06-01 16:51:10 -04:00
PatR
6f7089de10 whatdoes ('&') for movement commands
The key binding overhaul broke '&' reporting for movement commands.
This is somewhat clumsy but seems to be working as intended.

(M-0 with 'number_pad' set to 2 (or 4) appears to be broken.  It's
supposed to be a synonym for 'I' but brings full inventory ('i')
for me.  I have to set 'altmeta' On and type ESC followed by 0, but
that sequence does work to get M-0.)
2019-06-01 02:52:32 -07:00
PatR
c9e6e44590 help bits
Fix a typo (count example "20s." shouldn't have the period).

Also expand the text for several gotchas that tend to hit newbies.
2019-05-31 18:41:37 -07:00
PatR
cdb4a9e8b3 fix github issue #193 - curses: menu search
Fixes #193

Under curses interface, make characters which are both entry selectors
and menu commands function as a selector.  Needed to support using ':'
to look inside a container when applying/looting it via menu, instead
of performing a menu search operation.  (There was another case like
this but I can't remember what the circumstances are.  The fix is
general enough to cover it, whatever it is.)

For menus which don't have ':' as a choice, make sure search prompt
doesn't offer garbage default input when built with EDIT_GETLIN.

Bug?  If player has 'popup_dialog' option On, EDIT_GETLIN is ignored.
Plain curses I/O doesn't seem to offer a way to implement it.
2019-05-31 10:11:45 -07:00
PatR
a09973851e edge of map feedback
When testing Planes of Air and Water, I found it odd that trying to
move off the edge of a level uses a turn but provides no feedback.
If 'mention_walls' is On, report that you can't go any farther in
whichever direction you're trying to move.  Moving diagonally is
only blocked in one of the two combined directions unless you're in
the very corner, so if you try to move southwest while in the middle
of the bottom row, for instance, it says you can't go farther south
rather than southwest.
2019-05-31 07:35:37 -07:00
PatR
48cd573e32 Planes of Water and Air
Make the Plane of Water be water all the way to edge instead of having
stone on left, top, and right.  The Plane of Air already has air all
the way to edge (including unused/unuseable column #0) but does so via
code rather than the level description file so Water does that now too.

The edges of the Plane of Air were cloudless (3 columns on the left,
2 rows on the top, and 2 columns on the right; don't recall about the
bottom) and that looked pretty strange.  Those rows and columns are
beyond the range of bubble/cloud movement so just make some of those
spots randomly be sight-blocking cloud terrain instead of all open air.
It isn't integrated with the moving clouds but looks fairly good when
the hero moves along the edge of the level.

Using wizard mode to leave Water or Air and later return resulted in
no clouds on the Air level and bubbles as usual on the Water level.
I still don't understand why, but on return to those levels run the
bubble creation routine as if the old discarded bubbles or clouds were
being restored.
2019-05-31 03:42:06 -07:00
PatR
791b87833b mnearto/mnexto/enexto
This doesn't solve the <0,0> problem but it does prevent mnexto()
from using uninitialized coordinates if enexto() fails.  It also adds
several debugging messages.

enexto() was ignoring map row #0 (unlike column #0, row #0 contains
valid map locations).  Fixing that doesn't matter for Plane of Water
though since that row is stone there--that's probably a bug.  It was
also repeatedly re-testing the top+1 and bottom rows and left and
right columns after they had already failed to be acceptable.  It
still does some of that, but less.
2019-05-30 07:50:38 -07:00
PatR
1a35c15588 sortloot memory leak
Unfreed memory noticed after interrupting the fuzzer and quitting.
query_objlist() has an early return--for touching a cockatrice
corpse--that was skipping release of sortloot info (an array with
one element per object from whichever object list was being used).

Some formatting that's been sitting around for a while got mixed in
and I decided not to take that back out.
2019-05-29 04:40:54 -07:00
Bart House
3427d1ce85 Deleting test file which was just checked-in. 2019-05-28 20:30:10 -07:00
Bart House
9dea6c77d8 Merge branch 'NetHack-3.6' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.6 2019-05-28 20:19:33 -07:00
Bart House
7492b1da6c Testing ability to cause chaos. 2019-05-28 20:18:27 -07:00
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