Commit Graph

4911 Commits

Author SHA1 Message Date
Sean Hunt
a67759cbc3 Audit rloc()
Most of the time, rloc() is used for teleporting monsters and it's not a
big deal if they can't find somewhere to go. In a few cases, it is. I
went through all the callsites and made calls to rloc() not cause
impossible()s if they don't need to.

Fixes a bug/suite of bugs reported by ais523.
2015-05-24 09:31:40 -04:00
Sean Hunt
80703597c0 Clean up a rare corner case with mnearto().
With this fix, if the second mnearto fails, we don't accidentally strand
othermon at (0,0).
2015-05-24 09:24:52 -04:00
Sean Hunt
6aaece4ba7 Fix sleep explosion causing impossible().
Also clean up come ternaries while I'm here.

My first attempt to fix was to add AD_SLEE to explode(), but that failed
because do_break_wand() already does the sleeping portion. I don't
generally like the duplication between explode() and do_break_wand as a
result, but I consider that issue a project for another day.
2015-05-24 09:24:11 -04:00
nhmall
137bc4a493 minor comment typo spotted
Changes to be committed:
	modified:   src/objnam.c
2015-05-24 08:17:32 -04:00
PatR
5f0a55f2cd makedefs -q fix
Make the input buffer for quest messages bigger so that the expanded
header line from nhsub won't be too long.  Also, makedefs will notice
and report too long lines ('makedefs -q' only) and sanely proceed with
the rest of the file instead of treating the excess part of a long
line as a separate line.
2015-05-23 23:11:41 -07:00
PatR
7bc1a6e7f3 quest summary messages for B and C
Add '%E [summary line]' to '%Cc' messages for Barbarian and Caveman.
Archeologist was done several years ago; the other roles still need
them.  Creating them is fairly tedious, but DEBUGFILES=questpgr.c
allows them all to be checked on turn 1 via ^P, a great improvement
since that first set.
2015-05-23 01:10:56 -07:00
PatR
ae78865da8 msghistory bandage
Have genl_putmsghistory() pass the message to pline() for the !restoring
case, so that quest summary lines are delivered as ordinary messages.
No effect on tty or win32, which have their own putmsghistory routines.
But for X11, which has a multi-line message window but no save/restore
implementation for its contents, this makes the quest summary lines
actually show up somewhere.  (I looked at maybe implementing
X11_getmsghistory() and X11_putmsghistory() but don't have the energy to
tackle it.)

Other interfaces which lack their own history save/restore will see the
quest summary messages too.  Presumeably they'll all have multi-line
history windows so the extra line won't be displacing the most recent
message.  If not, they'll essentially get the long quest messages twice,
once in full via popup window, then the one-line summary via pline.
2015-05-23 00:59:18 -07:00
PatR
905c21dbe8 qtdump() overhaul
When dumping quest messages at startup via DEBUGFILES=questpgr.c,
give a single message for each one, instead of a pline showing the
message number and delivery protocol followed by a popup message
window containing the text.  This puts the number and protocol info
at the start/top of the popup window, bypassing the pline (and the
extra --More-- given for tty).
2015-05-23 00:50:34 -07:00
nhmall
404e37633f beta info
Changes to be committed:
	modified:   src/version.c
2015-05-22 20:08:33 -04:00
nhmall
37c35bcc15 Guidebook accuracy
Changes to be committed:
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
2015-05-21 20:59:04 -04:00
nhmall
56266a0800 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource 2015-05-21 20:46:58 -04:00
nhmall
43006357bd comment out experimentals 2015-05-21 20:44:32 -04:00
PatR
168572fd0d #terrain update
Make the post-3.4.3 '#terrain' command be more versatile by allowing the
player to choose between floor-only, floor+traps, and floor+traps+objects
so that it is possible to view known traps covered by objects or monsters
and remembered objects covered by monsters.  The extra explore mode and
wizard mode choices aren't affected.
2015-05-21 16:53:46 -07:00
PatR
f0370f5f86 you feel {a,an unexpected} draft
Move the message given when a monster digs through a closed door
or a secret corridor into a separate routine.  In theory, nethack
should determine whether there is a path between the new opening
and the hero's location in order to decide whether a draft can
be felt.  (I don't think anyone is likely to implement that--I'm
certainly not.  Checking whether the hero is in a room with no
breaches in its walls could at least catch being inside a vault.)

While at it, add some USA-centric puns about feeling the prospect
of imminent military conscription instead of air current if it
happens while hallucinating.
2015-05-18 18:25:44 -07:00
PatR
9e0e1ac5d1 remove accidentally added util/lev_main.i 2015-05-15 23:08:15 -07:00
PatR
fabf9cd901 VA_DECL/VA_END usage
Make the variadic functions look more like ordinary code rather than
have the function opening brace be hidden inside the VA_DECL() macro.
That brace is still there, but VA_DECL() now needs to be followed by
a visible brace (which introduces a nested block rather than the
start of the funciton).  VA_END() now provides a hidden closing brace
to end the nested block, and the existing closing brace still matches
the one in VA_DECL().

Sample usage:
void foo VA_DECL(int, arg)  --macro expansion has a hidden opening brace
{  --new, explicit opening brace (actually introduces a nested block)
  VA_START(bar);
  ...code for foo...
  VA_END();  --expansion now provides a closing brace for the nested block
}  --existing closing brace, still pairs with the hidden one in VA_DECL()

This should help if/when another round of reformatting ever takes place,
and also with editors or other tools that do brace/bracket/parenthesis
matching.

I had forgotten that there were variadic functions in sys/* and ended
up modifying a lot more files than intended.  The majority of changes
to those just inserted a new '{' line so that revised VA_END()'s '}'
won't introduce a syntax error.  A couple of them needed VA_END() moved
so that local variables wouldn't go out of scope too soon.  Only the
Unix ones have been tested.
2015-05-15 17:45:21 -07:00
PatR
dd62a6831f fix mdig_tunnel impossibility
Reported by the keymasher:  "stone at (48,8) is undiggable".  Bigroom 4
has a tree at that spot and the whole level is flagged as undiggable.
Undiggable trees were supported on arboreal levels (where their terrain
type is STONE rather than TREE), but not elsewhere.  Monster movement
uses IS_ROCK(), which is true for TREEs, but may_dig() uses IS_STWALL(),
which is false for TREEs so doesn't consider the location as being of
interest and fails to disallow digging.  But mdig_tunnel() bypasses
may_dig() and tests the NONDIGGABLE bit directly, disallowing digging.
(If this sounds confusing, it's a stroll in the park compared to the
code itself.  Apologies for the mixed metaphore.)

Digging away a secret corridor could leave rocks, which doesn't make
a whole lot of sense.  Now a monster's dig attempt will reveal the
location as a corridor instead.

This also moves an assignment out of a macro invocation where it was
inviting trouble if that macro gets modified.  And reorganizes an 'if'
to put cheaper tests sooner.
2015-05-13 17:54:26 -07:00
PatR
beaab1b974 Make the #terrain command work as intended if used while the map is
suppressed when the hero is engulfed.  No fixes entry.
2015-05-12 16:07:18 -07:00
nhmall
6de8aa3446 some pre-Beta updates
Changes to be committed:
	modified:   README
	modified:   doc/fixes35.0
2015-05-10 06:27:07 -04:00
Derek S. Ray
b55f6f30ba ...don't forget to include the prebuilt headers
derp.
2015-05-09 20:50:07 -04:00
PatR
91f444b867 code_style for emacs 2015-05-09 17:05:36 -07:00
PatR
2dc2091626 display.h cleanup
I started out just to replace the weird partial expression in the
maybe_display_usteed macro but ended up cleaning up some other stuff
such as line wrapping.

There are still tabs present.
2015-05-09 16:54:05 -07:00
Derek S. Ray
42e7c050c2 catch this up on new features/changes 2015-05-09 15:25:37 -04:00
Derek S. Ray
c429dc8722 Add token Visual Studio section 2015-05-09 15:13:00 -04:00
Derek S. Ray
6d232df8ab update pre-built versions of these 2015-05-09 14:47:46 -04:00
Sean Hunt
dc08561ddb Replace tabs with spaces. 2015-05-09 14:45:43 -04:00
Sean Hunt
82ea1472f4 Add a coding style document.
I've put my best approximation of what the style should be in here. I
don't intend for this to be prescriptive, except as the DevTeam has
agreed, so I do encourage discussion on the mailing list. I would also
appreciate if people with other editors could include the appropriate
configuration recipes.
2015-05-09 14:45:01 -04:00
Derek S. Ray
1770591189 fix duplicated header lines 2015-05-09 14:35:12 -04:00
Derek S. Ray
a3b260f390 Merge branch 'AlexK-misc'
* AlexK-misc:
  erosion is not being removed after reading non-cursed scroll of enchant weapon
2015-05-09 14:34:16 -04:00
Derek S. Ray
a8f95494a1 fix whitespace errors from simultaneous commit 2015-05-09 14:20:36 -04:00
Derek S. Ray
e124a61362 reorder onscary() logic to be in right order 2015-05-09 14:16:47 -04:00
Sean Hunt
97d6fade74 Reformat all C files.
I'll push a formatting guide at some point. There may still be
outstanding changes, but please feel free to resolve those as you arrive
a them.

To the best of my knowledge, there is no changes to the actual code
content, but the formatter does have the occasional bug. If you run into
an issue, please fix it!
2015-05-09 13:43:16 -04:00
Sean Hunt
167800afdf Fix type compatibility warning. 2015-05-09 13:07:49 -04:00
Derek S. Ray
d0fb68795d Merge branch 'derek-elbereth'
* derek-elbereth:
  ensure that the 'safe' objects remain safe
  finish up the changes to trigger erosion on use
  initial pass for toning down Elbereth

Conflicts:
	dat/castle.des
	dat/sokoban.des
	include/extern.h
	src/engrave.c
	src/mklev.c
	src/monmove.c
	src/zap.c
2015-05-09 11:58:36 -04:00
nhmall
222b4c0023 don't break other ports use of tilemap.c
The modifications made for supporting monster-looking tiles
may not be supported on platforms other than windows yet.
2015-05-09 10:59:10 -04:00
nhmall
9d54b5e43e Merge branch 'win32-x64-working' 2015-05-09 08:02:19 -04:00
Alex Kompel
6a66408964 erosion is not being removed after reading non-cursed scroll of enchant weapon 2015-05-08 00:12:36 -07:00
Pasi Kallinen
29ea460446 Used invent letters didn't destroy the window 2015-05-07 18:04:40 +03:00
nhmall
5011459c7e Merge branch 'master' into win32-x64-working 2015-05-07 05:00:36 -04:00
nhmall
b901acc7d6 make internal numbering match updated headers 2015-05-07 04:58:59 -04:00
nhmall
2eed004d5a more header update
Changes to be committed:
	modified:   sys/winnt/nttty.c
	modified:   sys/winnt/winnt.c
2015-05-07 04:55:05 -04:00
nhmall
20069798d4 Merge branch 'master' into win32-x64-working 2015-05-07 04:52:30 -04:00
Sean Hunt
8c0c587fd7 Restore lost executable bits. 2015-05-06 23:23:48 -04:00
karnov
2a907f894e Version number increment 2015-05-06 22:04:27 -04:00
PatR
39fcd6459c couple bits omitted from lint.h patch
* list lint.h in Files
* add dependency to win/X11/dialogs.o since dialogs.c includes lint.h
  directly rather than via hack.h
2015-05-06 17:33:48 -07:00
nhmall
8a620c3dec makefile updates 2015-05-06 20:22:03 -04:00
nhmall
fc102a860b updates forced from master
Changes to be committed:
	modified:   sys/winnt/Makefile.bcc
	modified:   sys/winnt/Makefile.gcc
	modified:   sys/winnt/Makefile.msc
2015-05-06 20:07:18 -04:00
nhmall
8a3a92d2e2 put back Derek's _MSC_VER changes into the lint.h version 2015-05-06 19:58:31 -04:00
nhmall
1ef94c890f Merge branch 'master' into win32-x64-working
Conflicts:
	include/hack.h
	win/X11/winmenu.c
	win/X11/winstat.c
2015-05-06 19:53:26 -04:00
Sean Hunt
b7c5b33173 Add a funny message for when a burrower eats food. 2015-05-06 19:25:23 -04:00