Commit Graph

2944 Commits

Author SHA1 Message Date
Derek S. Ray
be98bca06d cherry-pick the YACC/LEX upgrades from elsewhere 2015-05-06 17:55:50 -04: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
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
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
nhmall
77dd76ed17 Merge branch 'master' into win32-x64-working
Resolved Conflicts:
	src/cmd.c
	src/mkobj.c

 All conflicts fixed but you are still merging.

 Changes to be committed:
	modified:   dat/Priest.des
	modified:   dat/Rogue.des
	modified:   dat/Valkyrie.des
	modified:   dat/Wizard.des
	modified:   dat/gehennom.des
	modified:   src/cmd.c
	modified:   src/mkobj.c
	modified:   src/steal.c
	modified:   sys/share/lev_yacc.c
	modified:   util/lev_comp.y
2015-05-02 13:53:08 -04:00
PatR
ee854e5c76 more owornmask sanity_check
Fix the problem with erroneously detecting wielded or quivered
chained ball which legitimately has more than one mask bit set.

Add an additional check for valid wornmask of an item somehow worn
in an invalid slot (such as an amulet in one of the ring slots).
Only lightly tested; it really needs debugger assistance to force
various invalid situations but I don't know gdb well enough for that.
2015-05-02 02:44:57 -07:00
PatR
40fdbccf84 enlightenment for polymorph & lycanthropy
Fine-tune lycanthropy feedback by combining "you are a werecritter"
and "you are in beast form" into one message.  Also, add some new
feedback when lycanthropy and intrinsic polymorph are blocked by
intrinsic unchanging.
2015-05-01 19:44:56 -07:00
PatR
274904f9be stabilize loss of gold
When gold is stolen by a leprechaun or lost when being "overwhelmed
by an urge to take a bath" while dipping in a fountain, if you had
99 gold pieces or less, you'd lose all of it (in the bath case, only
if it was at least 10 to start with), but if you had 100 or more,
you would lose a random amount which could be as little as 1.  And
in the bath case, if the random amount was less than 10, you would
lose nothing but be told that "you lost some of your money in the
fountain".  After this change, it is still possible to lose less
when starting with more, but not as likely and not as extreme a case
as maybe losing only 1 when starting with thousands.

The fountain-dip bath case has code to handle mutiple denominations
of coins, possibly the only place in the program where that exists.
I've left that alone although it should probably be taken out....
2015-05-01 18:01:12 -07:00
nhmall
088e0471f1 Merge branch 'master' into win32-x64-working 2015-05-01 18:36:39 -04:00
nhmall
573c9dc98f Merge branch 'AlexK-misc' 2015-05-01 18:24:59 -04:00
Pasi Kallinen
8f639796d5 Handle boulder-option in config file
Setting boulder in config file did not work correctly in post-3.4.3
code, due to the symset changes.
2015-05-01 22:03:13 +03:00
nhmall
bd68a6c80c Merge branch 'master' into win32-x64-working
Resolved Conflicts:
	src/mkobj.c
	src/mon.c
	src/options.c

 Changes to be committed:
	modified:   DEVEL/hooksdir/nhsub
	modified:   src/invent.c
	modified:   src/mkobj.c
	modified:   src/mon.c
	modified:   src/options.c
2015-05-01 08:22:36 -04:00
Pasi Kallinen
40080817ce Uninitialized variable 2015-05-01 14:52:25 +03:00
nhmall
67a53a2aa3 another ball & chain tweak
checking if uball is OBJ_FREE was inappropriate, because
sometimes it is in inventory.
2015-05-01 07:39:53 -04:00
PatR
18a29f0dfe sanity check owornmask
Extend the processing done by the wizard mode 'sanity_check' option
to look for anomalies with obj->owornmask since there seem to have
been a few lately.  I haven't actually triggered any so this code
isn't very well exercized yet.

sanity_check uses pline() rather than impossible() or debugpline()
to deliver messages so might not be very useful with keymasking.

A sizeable chunk of this diff is just cleaning up indentation so
that I could see what I was working with....
2015-05-01 02:32:14 -07:00
Pasi Kallinen
fdda06f678 Initialize variable 2015-05-01 11:55:15 +03:00
PatR
e8ec76b551 lint: use const for string literal 2015-04-30 17:59:05 -07:00
Derek S. Ray
586cad7fc9 limit obj manipulation by handless creatures
something that is M1_NOHANDS ought not to be able to pick up a pile of
rocks, daggers, or gold pieces unless it has other features that would
permit such a thing.
2015-04-30 18:34:32 -04:00
nhmall
85c9a61efd Merge branch 'master' into win32-x64-working 2015-04-30 08:29:21 -04:00
nhmall
c25ea3d851 can't use BALL_IN_MON after u.uswallow set to 0
u.uswallow is set to 0 a couple of lines above so
the test will never be TRUE.
2015-04-30 08:26:46 -04:00
nhmall
353417c642 Merge branch 'master' into win32-x64-working
Conflicts:
	src/mon.c
	src/options.c
	src/pickup.c
	src/zap.c

 Changes to be committed:
	modified:   doc/Guidebook.mn
	modified:   doc/Guidebook.tex
	modified:   doc/fixes35.0
	modified:   include/color.h
	modified:   include/extern.h
	modified:   include/mondata.h
	modified:   src/ball.c
	modified:   src/dbridge.c
	modified:   src/dig.c
	modified:   src/display.c
	modified:   src/dokick.c
	modified:   src/dungeon.c
	modified:   src/fountain.c
	modified:   src/invent.c
	modified:   src/mkmaze.c
	modified:   src/mkobj.c
	modified:   src/mon.c
	modified:   src/monmove.c
	modified:   src/mthrowu.c
	modified:   src/options.c
	modified:   src/pickup.c
	modified:   src/sit.c
2015-04-30 06:39:44 -04:00
nhmall
fcfab90907 fix a panic and infinite recursion
Changes to be committed:
	modified:   src/ball.c
	modified:   src/display.c
	modified:   src/mon.c
2015-04-29 23:53:31 -04:00
nhmall
97a5bdfb17 comment rearranged
Requested by Sean for some work he's doing for reindent.
2015-04-29 20:54:11 -04:00
Pasi Kallinen
9edec13063 Extract ball and chain before flooreffects 2015-04-29 20:35:49 +03:00
Pasi Kallinen
0d3c858452 Check for valid coord in obj_nexto_xy 2015-04-29 17:04:49 +03:00
Pasi Kallinen
b8cfa9b33f Prevent monsters throwing items out of map
If a monster was in the projectile's path, the projectile stopping
checks would not be reached.  The thrown object could fly up to
the maximum range, through walls, or even outside the map.
2015-04-29 16:28:05 +03:00
Pasi Kallinen
d768887385 Unquiver gold before making it vanish
This fixes a complaint for "deleting worn obj":  If reading a cursed
spellbook took your money, and the gold was quivered.
2015-04-28 22:14:23 +03:00
Pasi Kallinen
f83523eeb4 Make spell list title obey menu_headings 2015-04-28 14:13:01 +03:00
Pasi Kallinen
d9ac7f3de7 Exclude "grey" from color picker menu 2015-04-28 12:46:39 +03:00
nhmall
3924b01e73 trade a segfault for a panic
Changes to be committed:
	modified:   src/invent.c
	modified:   src/options.c

Apparently we need this based on Pasi's segfault. We just
don't yet know why we need them.

Also fix a warning:
..\src\options.c(1282) : warning C4101: 'tmp' : unreferenced local variable
2015-04-27 23:42:06 -04:00
Pasi Kallinen
86dc5cf588 Unify getting terrain under drawbridge 2015-04-27 22:15:23 +03:00
Pasi Kallinen
0903df974f Unify guards yelling 2015-04-27 21:31:25 +03:00
Pasi Kallinen
f0699b76d9 Add is_watch define for watchmen 2015-04-27 21:09:26 +03:00
Pasi Kallinen
93cbd1fbb1 Allow all text attributes for menu_headings 2015-04-27 18:44:18 +03:00
Pasi Kallinen
eecd19caa9 Allow changing menucolors in-game via Options 2015-04-27 17:45:48 +03:00
Pasi Kallinen
4fa3c39b55 Show only beginning of annotation when redoing it 2015-04-27 16:18:59 +03:00
PatR
b4741d6206 more BUCX: union vs intersection
Fix filtering used by the 'D' command, and a few other activities that
allow both object class filtering and bless/curse state filtering, so
that when both class(es) and state(s) are specified, objects need to
match both rather than either.  D?C will present the player with cursed
scrolls to drop rather than all scrolls plus all other cursed objects.

This also fixes another instance when gold could end up with its bknown
flag set.
2015-04-27 01:22:39 -07:00
nhmall
ea21088d2a Merge branch 'AlexK-misc' into win32-x64-working 2015-04-26 18:08:50 -04:00
Alex Kompel
664b4eb643 bubble structure contains pointer into static array. Bubble objects
are being flat-dumped into save file and this causes segfault in restore()
whenever data segment layout changes (e.g. global variables added/removed).
bmask should either be stored with the objects.
2015-04-26 14:47:38 -07:00
Dion Nicolaas
497247ace0 Merge branch 'win32-x64-working' of https://rodney.nethack.org:20040/git/NHsource into win32-x64-working 2015-04-26 15:49:18 +02:00
Dion Nicolaas
29b9cb7c7d Fix a Borland compile error. Now fix the linking... 2015-04-26 15:47:14 +02:00
Pasi Kallinen
467ee34b2f Prevent possible buffer overflow
getlin() gets at most a BUFSZ string from user; make the buf big
enough to hold that _and_ the query itself.
2015-04-26 16:15:44 +03:00