Commit Graph

4877 Commits

Author SHA1 Message Date
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
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
Derek S. Ray
f0bf652df8 update fixes with a few things 2015-05-06 17:55:53 -04:00
Derek S. Ray
be98bca06d cherry-pick the YACC/LEX upgrades from elsewhere 2015-05-06 17:55:50 -04:00
Derek S. Ray
9c19f55403 jonadab's patch for engraving on the drawbridge
Should be splinters, not gravel.
Addendum to C343-239
2015-05-06 17:51:18 -04:00
Pasi Kallinen
b8e0394a2e Hidden holes made by breaking a wand of digging
Holes created via applying a wand of digging were not
shown on the map, because holes are always marked as seen,
and seetrap/feeltrap then do nothing.
2015-05-06 18:02:15 +03:00
PatR
9de8b03c03 X11 lint suppression
Suppress close to 400 warnings generated by gcc on the win/X11/*.c code,
most due to -Wwrite-strings which makes string literals implicitly have
the 'const' attribute.  (Since modifying a string literal results in
undefined behavior, that is an appropriate check to have enabled, but
it can be troublesome since string literals have type 'char *' and code
that uses them that way is correct provided it avoids modifying them.)

 113  warning: initialization discards qualifiers from pointer target type
 127  warning: assignment discards qualifiers from pointer target type
  29  warning: passing argument discards qualifiers from pointer target type
 109  warning: unused parameter
  12  warning: comparison between signed and unsigned

The nhStr() hack casts to 'char *', explicitly removing 'const', for
situations where it isn't feasible to make code directly honor const.
The vast marjority of uses are for the second parameter to XtSetArg(),
which is a macro that actually performs an assignment with the second
argument rather than passing it in a function.  It takes values like
'XtNtop', which doesn't need to be altered (although in many places I
changed that to nhStr(XtNtop) for uniformity with the surrounding code,
and 'XtNbottom', which does need to have the extra const stripping to
avoid a warning.  Go figure.

The nhUse() hack actually uses its argument in a meaningless way if the
code is compiled with FORCE_ARG_USAGE defined.  When GCC_WARN is defined,
FORCE_ARG_USAGE will be enabled if it hasn't been already.  Example:

 /*ARGUSED*/
 int foo(arg)
   int arg;  /* not used */
 {
+  nhUse(arg);
   return 0;
 }

The extra line will expand to ';' when FORCE_ARG_USAGE is not defined
or too
   nhUse_dummy += (unsigned)arg;
when it is.  I figured direct assignment might lead to a different
warning by some compilers in a situation like
   nhUse(arg);
   nhUse(otherarg);
where the first assignment would be clobbered by the second, and using
bitwise operations or safer '+= (arg != 0)' would most likely generate
more non-useful code.  Some tweaking might turn out to be necessary.
2015-05-06 00:59:15 -07:00
PatR
e72246f1d1 new file: include/lint.h
modified files: include/hack.h, src/decl.c, sys/unix/Makefile.src

Groundwork for cleaning up the X11 sources, where gcc with the option
settings specified in the OSX hints file currently generates close to
400 warnings for win/X11/*.c.

lint.h is included by hack.h, and I've moved the debugpline stuff from
the latter to the former to hide it better.  (By rights it belongs in
debug.h or something of the sort, but I didn't want to go that far.)
Makefile and project dependencies need to catch up.

nhStr() hides a cast to char *, and is intended to by used on string
literals where it isn't feasible to maintain the 'const' attribute.
(A pernicious problem with X11 code, where the include situation can
become very convoluted, and many, MANY string literals are hidden
behind macros to look like keyword-type tokens.)

nhUse() can be used to force a fake usage on something which triggers
an unused parameter warning.  There are a 6 or 8 or 10 places in the
core code where that applies, but so far I have't touched any of them.
There's a tradeoff since it will result in some worthless code being
generated and executed, but is much simpler than tacking on compiler-
specific workarounds like '#pragma unused' or gcc's __attribute__ hack.
2015-05-06 00:38:16 -07:00
Pasi Kallinen
2a4bf5efa7 Comment for the pudding glob order 2015-05-06 09:54:28 +03:00
PatR
7b75da924e another pass at "gold wield inconsistency"
Handle !fixinv by forcing gold to have slot '$' all the time; that
particular type of object is 'fixed' regardless of user preference.
Also add a couple of checks for non-'$' gold when selecting from
inventory, just in case the issue of multiple gold stacks reappears.
2015-05-05 16:25:49 -07:00
Pasi Kallinen
fd8127dcf4 Fix impossible when quivered gold was stolen from you 2015-05-05 21:29:24 +03:00
Pasi Kallinen
0dd715da11 Revert previous, with a comment in code 2015-05-05 06:55:56 +03:00
nhmall
f692db8581 Merge branch 'master' into win32-x64-working 2015-05-04 17:56:35 -04:00
Pasi Kallinen
766d874a47 Melded pudding object may be gone 2015-05-04 22:19:32 +03:00
PatR
e2e269504c more "deleting worn obj"
Lit candles and burning potions of oil can be on the migrating objects
list and get deleted before arrival, so they need the same cleanup as
rotting corpses to prevent obfree from complaining that they're worn.
2015-05-04 08:49:21 -07:00
karnov
47ea9f7ec0 Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
Pull to resync.
2015-05-03 22:08:07 -04:00
karnov
490092d3ef Made sysconf define contiditional to ensure no double inclusion. 2015-05-03 22:03:09 -04:00
nhmall
636edf2b08 Merge branch 'master' into win32-x64-working
Conflicts:
	src/dig.c
	src/mkobj.c

 Changes to be committed:
	modified:   src/dig.c
	modified:   src/mkobj.c
2015-05-03 20:53:04 -04:00
PatR
3fa8ff9d62 owornmask sanity_check fix and enhancement
Thinko fix:  sanity checking for owornmask was mis-treating
OBJ_MIGRATING as OBJ_MINVENT of migrating monsters rather than as
unattended objects and would have had problems similar to obfree's
inappropriate impossible check.

Sanity checking for objects worn in invalid slots (amulet worn in
a ring slot and so forth) is extended to items worn by monsters.
Also add a check for wielded coins since the loophole that let them
become wielded has been closed.
2015-05-03 16:57:09 -07:00
PatR
505f6246b5 fix "deleting worn object" impossibility
Migrating objects overload obj->owornmask with a destination code,
so rot_corpse needs to clear that before deleting corpses.  (Buried
objects don't touch owornmask, so rot_organic, which does the actual
object deletion, shouldn't need any similar change.)

The corpses with owornmask 3 that have been observed recently were
slated to arrive on the up stairs, so presumeably fell down the down
stairs of the current level and rotted before the hero went down.
Put plainly, it was the [post-3.4.3] impossible() check which was in
error, not the active game data.
2015-05-03 16:54:53 -07:00
nhmall
8ebf5b1759 Merge branch 'master' into win32-x64-working 2015-05-03 09:01:46 -04:00
PatR
181740e874 fix "gold wield inconsistency"
'w$' reported "you can't wield gold" but
'w*$', choosing from inventory and picking gold, let you wield gold.

The old code checked whether gold had been picked before checking
whether '?' or '*' had been picked to request selection from inventory.
This wasn't an issue with 3.4.3's !GOLDINV configuration (but probably
was for anyone who explicitly switched to GOLDINV) because getobj()'s
callers only inserted gold into inventory when they intended to accept
it as a valid choice.

Fix is just to swap two adjacent 'if' blocks in getobj() so that '*'
is processed before the test of whether '$' has been chosen.  Most of
the diff is indentation and other minor reformatting.
2015-05-03 01:22:25 -07:00
PatR
fc567b5ce3 tiles lint
Several instances of "comparison between signed and unsigned".

  win/share/tiletext.c
  win/X11/tile2x11.c
2015-05-03 01:03:24 -07:00
PatR
23a671147f tiles-related build stuff
* Add missing entry for include/tile.h to (top)/Files; also
  add new entry for generated file util/tiletxt.c (Unix only);
* Add several missing entries for tile utility programs that
  can be built by sys/unix/Makefile.utl to util/.gitignore;
* Update sys/unix/Makefile.utl to build 'tilemap' differently so
  that it won't leave behind an unwanted subdirectory tree under OSX:
    util/tilemap.dSYM/
    util/tilemap.dSYM/Contents/
    util/tilemap.dSYM/Contents/Info.plist
    util/tilemap.dSYM/Contents/Resources/
    util/tilemap.dSYM/Contents/Resources/DWARF/
    util/tilemap.dSYM/Contents/Resources/DWARF/tilemap
  It now generates util/tiletxt.c on the fly, to be compiled into
  tiletxt.o, so that tilemap.c can be compiled in the ordinary
  manner and tilemap.o can be kept around for dependency checking.
  (Creating real source file win/share/tiletxt.c would be a little
  bit cleaner, but it's effectively two lines long so seems silly
  to be in the source distribution.)  I looked to see whether I
  could find a linker or compiler option to suppress that stuff but
  failed.  I'm sure something of the sort must exist but didn't
  pursue it.  Someday I might actually learn about how OSX works....
2015-05-03 00:47:10 -07:00
Pasi Kallinen
be60ad6676 Randomize secret door locations
... in the Wizard quest locate level and Rodney tower entrance
2015-05-03 10:31:30 +03:00
Pasi Kallinen
15a5fe8d76 Barb quest home has a forest 2015-05-03 08:56:39 +03:00
PatR
4283bbde64 tiletxt lint
Use 'const' for string literals when compiling win/share/tilemap.c
with '-DTILETEXT' to generate util/tiletxt.o.
2015-05-02 19:44:35 -07:00
nhmall
5dfc98bc6a Merge branch 'master' into win32-x64-working 2015-05-02 18:18:36 -04:00
nhmall
02de9d1313 commit the latest update for wiz_identify
git add mistake on my part
2015-05-02 18:16:11 -04:00
nhmall
be643386c5 permanent wiz_identify correction
wiz_identify (^I) is supposed to bring up the inventory list
with the items identified, in contrast to the regular (I)
inventory, but only for that inventory display.

It is intended that if you then hit ^I again while at that
wiz_identify inventory menu, you'll trigger permanent
identification of itemsand any other key is supposed to
leave them as they were.

In tty however, <space> was doing the same thing as the
second ^I, and permanently identifying everything.
So, for those that like to <space> through menus (like
me) this makes it work as originally intended and
requires a deliberate second ^I at the menu to permanently
identify. (It might also allow trigger permanent ID if you hit
underscore, but nobody "underscores" through menus,
so that's ok.)
2015-05-02 18:04:20 -04:00
Pasi Kallinen
d44e55b9a2 Make the slanted bigrm have more variance 2015-05-02 23:23:04 +03:00
Pasi Kallinen
b950031f55 Occasionally fog maze bigrm is not made of fog 2015-05-02 23:19:38 +03:00
Pasi Kallinen
862c78530b More variations for bigrm-1 2015-05-02 23:04:13 +03:00
Pasi Kallinen
5d116a892a Minor variation for Earth and Astral planes 2015-05-02 22:17:47 +03:00
Pasi Kallinen
816b562e99 Replace some pools in Hea quest home with floor 2015-05-02 22:10:07 +03:00
nhmall
2394009339 Merge branch 'master' into win32-x64-working 2015-05-02 15:06:19 -04:00