PatR [Tue, 13 Mar 2018 18:27:04 +0000 (11:27 -0700)]
prevent pline() segfault
The use of debugpline() in tty_curs() got me wondering what would
happen if debugpline() was called while pline() is in progress. I
don't know how to trigger the bad coordinate situation, so I put an
unconditional debugpline() in the NHW_MESSAGE case of tty_putstr()
and used DEBUGFILES=wintty.c to enable it. Instant segfault, and
the backtrace was short and not useful so the stack might have been
clobbered. I didn't spend any time trying to figure where or why
the segfault occurred.
Change pline() so that if it is called while the previous pline()
hasn't finished yet (ie, recursively), use raw_print() and return
early. The raw_print message isn't very useful--it pops up wherever
the cursor happens to be, just like the cursor position bug that has
been an issue recently--but does get delivered without any segualt
and isn't completely useless if DUMPLOG is enabled and you save or
quit before the message buffer gets recycled. Message readability
situation could be improved but avoiding the segfault was my goal.
Putting any debugpline() into *_raw_print() would be inadvisable....
nhmall [Mon, 12 Mar 2018 03:29:06 +0000 (23:29 -0400)]
ensure tty_curs() behaves the same whether DEBUG defined or not
ensure tty_curs() behaves the same whether DEBUG defined or not
when it comes to positioning the cursor.
The return statement, in the debug case only, was preventing
the cursor from being moved following a range check, so the
next output was written whereever the cursor happened to be
previously.
The messaging that detects the failed range check will get
written in the DEBUG defined case hopefully allowing resolution
to the range check failure, but now the cmov will still
be attempted just as it is in the case where DEBUG is not
defined.
PatR [Sun, 11 Mar 2018 19:39:01 +0000 (12:39 -0700)]
fix #H6955 - wielded potion 'object lost' panic
Report classified this as 'segfault' but it's actually a controlled
panic(). When hero has lycanthropy and is wielding a potion of unholy
water while in human form, if that potion is boiled then it triggers
a transformation to beast form which in turn causes wielded weapon to
be dropped. When the code unwinds back up through potionbreathe() to
destroy_item(), the boiled potion won't be found in inventory any more
and useup() -> useupall() -> freeinv() -> extract_nobj() panics.
PatR [Sat, 10 Mar 2018 20:32:52 +0000 (12:32 -0800)]
more Unix gitinfo
When make uses 'makedefs -v' to create date.h, force it to create
gitinfo.txt all the time instead of just when that doesn't already
exist. Use 'make GITINFO=0' to get the previous behavior.
To skip it entirely, you need to do that and also make sure that
some file by that name already exists. 'touch dat/gitinfo.txt' or
perhaps 'echo "#no git" > dat/gitinfo.txt' would suffice.
PatR [Fri, 9 Mar 2018 22:11:04 +0000 (14:11 -0800)]
mplayer valkyries w/ Mjollnir
If an mplayer Valkyrie on the Astral Plane is given a war hammer,
give her gauntlets of power instead of random gloves since that will
either be Mjollnir or a very wimpy endgame weapon. (Maybe someday
mplayer Valkyrie's will be able to throw Mjollnir; their chance of
having it on the Astral Plane is moderately high if it hasn't already
been created prior to arriving there.)
I also gave monsters wearing gauntlets of power a 3..6 damage bonus
for hand-to-hand. While making that change, I noticed that monsters
wielding a scalpel or tsurugi wouldn't split puddings, unlike the
hero (a post-3.6.0 change), so fix that.
PatR [Thu, 8 Mar 2018 18:26:08 +0000 (10:26 -0800)]
Files update
I'm not sure of the status for possibly maintaining 'Files' via
automation, so manually add the new file 'gitinfo.sh' to sys/unix.
There was a sys/unix/hints file that wasn't listed, so add linux-qt4.
The whole win/Qt4 subdirectory is missing though. I don't even
remember that being added.
PatR [Mon, 5 Mar 2018 20:26:44 +0000 (12:26 -0800)]
stuck_in_wall tweak
When divine aid granted temporary Passes_walls ability to stuck hero,
it was giving 4d4 turns (4..16, avg 10). But the first warning that
it's timing out is given at 4 turns left so wouldn't be seen if the
random amount of time picked was the minimum. Switch to 4d4+4 (8..20,
avg 14) so that the message at 4 turns left will always happen.
PatR [Mon, 5 Mar 2018 20:01:31 +0000 (12:01 -0800)]
removing a monster from current level
I ended up not using this, but it might as well be included for
potential future use. Extend mlevel_tele_trap() to support forcing
a monster off the current level to make room either for the hero or
some other monster. goto_level() does something similar when the
hero is arriving on a level. This is for situations where the hero
is already there (such as divine aid attempting to fix STUCK_IN_WALL).
mlevel_tele_trap(mon, (struct trap *) 0) will usually move 'mon' off
the level, scheduled to migrate back if the hero leaves the level and
subsequently returns. 'Usually' because it doesn't work in endgame
and certain monsters are excluded regardless of dungeon location, so
caller has to be prepared to try to move another monster (or resort
to goto_level()'s unconditional forced migration).
PatR [Sun, 4 Mar 2018 22:17:13 +0000 (14:17 -0800)]
gitinfo.txt on Unix
Hide the scary perl command during 'make all' feedback in src/.
I'm not a shell programmer but this works fine for me when skipping
NHgithook::NHversioning because dat/gitinfo.txt is already present,
when creating dat/gitinfo.txt successfully, and when creation fails
because perl can't find NHgithook.pm. It hasn't been tested when
perl itself is absent.
PatR [Sun, 4 Mar 2018 00:46:39 +0000 (16:46 -0800)]
fix prayer infinite loop
Reported internally, if a prayer resulted in 'fix all troubles' and
one of those was TROUBLE_STUCK_IN_WALL but safe_teleds() couldn't find
any place to relocate the hero to, nothing was done and STUCK_IN_WALL
would be found again as the next trouble to fix. Since safe_teleds()
eventually resorts to trying every single spot on the map, there was
no other result possible than failing to find an available spot again,
nothing would be done, and next trouble would be STUCK_IN_WALL, ad
naseum.
I started out with a fix that looked for secret corridors to expose
and doors to open, to make more space available, then try to move a
monster off the level, then try digging out rock and/or walls and
smashing boulders. None of those guarantee success and I got bogged
down by the digging case. This was going to be a last resort if all
of those still failed to make somewhere to move the hero, but for now,
at least, I'm skipping all that other stuff and going directly to the
last resort: give the hero Passes_walls ability for a short time, and
let him or her find own way out of trouble. The next trouble to fix
won't be STUCK_IN_WALL because Passes_walls makes that a non-issue.
I'm not thrilled with the new messages involved but want to get this
behind me.
PatR [Sat, 3 Mar 2018 23:26:49 +0000 (15:26 -0800)]
buried_ball()
Noticed when I was looking at float_up()/float_down() vs being trapped.
(I have a substantial patch for that but it involves infrastructure
changes so will have to go into master instead of the 3.6.0 branch.)
buried_ball() was using nested loops as a very convoluted way to test
if (otmp->ox >= cc->x - 2 && otmp->ox <= cc->x + 2
&& otmp->oy >= cc->y - 2 && otmp->oy <= cc->y + 2)
I think this revised version is closer to what was intended.
There are issues. buried_ball() finds the buried iron ball nearest to
the specified location--which is always the hero's current location--
rather than the one which was 'uball' before being buried. A player
can spot that since iron balls aren't necessarily identical. Also, it
searches within a radius of two steps but a tethered hero is only
allowed to move one step away from buried ball, so something is off.
PatR [Sat, 3 Mar 2018 18:54:43 +0000 (10:54 -0800)]
aklys tweaks
It turns out that Mjollnir before the recent aklys enhancement and
aklys since then would end up both wielded and quivered if it returned
to thrower's hand while quiver was empty. Remove it from quiver before
restoring it to hand.
Limit the throwing range of an aklys if it is expected to return (ie,
thrown while wielded as primary) since it is a "thonged club" which is
supposedly attached by a cord to the thrower's wrist or hand. I have
no idea how long a real cord like that might be. I set the range limit
to BOLT_LIM/2. Shorter makes throw-and-return uninteresting for an
item that needs to be wielded to throw--so would probably be swapped
back and forth with a stronger melee weapon or longer range missile
weapon--and longer seems absurd.
Changes to be committed:
modified: doc/fixes36.1
modified: include/unixconf.h
modified: sys/share/ioctl.c
github pull request #19 made reference to resulting code behaviour
being better when windows were resized when USE_WIN_IOCTL was defined.
The logic for including the necessary enabling code in the build in
sys/share/ioctl.c was an explicit "opt-in" strategy, so anything not
deliberately and explicitly listed was not able to take advantae
of the potentially useful code. The need to add #defines to that
list would have been perpetual as new platforms came online, and
unnecessarily restrictive for everything else.
This switches the logic to include the code by default now,
and thus
unless there is an explicit "opt-out" by uncommenting
AVOID_WIN_IOCTL in include/unixconf.h
Some platforms, and we have no way of knowing which ones, may have
to ensure that AVOID_WIN_IOCTL is #define'd.
PatR [Sat, 3 Mar 2018 02:19:23 +0000 (18:19 -0800)]
Cleaver update
I worked on this a while back but didn't commit it because I couldn't
figure out the dead monster which wouldn't die. Pasi beat me to that.
Clean up the Cleaver code some and make the three-target swing alternate
between counter-clockwise and clockwise to simulate normal right-to-left
swing followed by left-to-right backswing. (Alternation happens on each
swing regardless of whether it is consecutive with the most recent one.
That's suboptimal but easy....) Also, stop three-target attack early if
hero is life-saved after being killed by a passive counter-attack from
the first or second target.
Prevent rogue backstab and two-hander breaking foes' weapons when using
Cleaver hand-to-hand because getting more than one of either of those
bonuses at a time would be excessive. I think allowing those for the
primary target but not for the two adjacent ones would be better, but I
just thought of that and am not going back for another round of revising.
This doesn't incorporate the two pull requests: one to avoid hitting
tame or peaceful adjacent targets unless the primary was also tame or
peaceful, the other to avoid hitting unseen adjacent targets. I'm not
sure if that includes remembered-unseen 'I' on the spot or no monster
shown at all. (There's a third one about updating the map but it isn't
needed for the existing Cleaver code either before or after this patch.)
I'm in favor of the first one and am not sure about the second. My
original concern was that someone could use Cleaver to find/hit three
unknown monsters at a time via 'F' prefix, but forcefight aimed at
thin air doesn't reach the Cleaver code so that can't happen, nor can
attacking two known close monsters at once by targetting an empty spot
between them.
Pasi Kallinen [Fri, 2 Mar 2018 13:49:45 +0000 (15:49 +0200)]
Fix Cleaving giving dmonsfree warning
Due to inverted logic, hitting a blue jelly with the Cleaver could cause
a dmonsfree warning - the jelly would die, but then come back to life
via the passive attack. This is a post-3.6.0 bug
PatR [Mon, 26 Feb 2018 19:18:29 +0000 (11:18 -0800)]
throw-and-return for aklys
The comment I added to data.base--to explain that despite what the
short description says, an aklys wouldn't return to sender after being
thrown--was bugging me, so I've made aklyses behave like Mjollnir.
If thrown when wielded as primary weapon, it will usually return and
usually be re-wielded. I also added a new message when either thrown
Mjollnir or thrown aklys is expected to return and fails to do so.
Most of the diff to dothrow.c is a change in indentation level. The
amount of code needed was quite small.
Autopickup for thrown Mjollnir which had failed to return was putting
it into the quiver slot if that was empty. Note quite an outright bug,
but it started wielded and can't be thrown if quivered, so exclude it
from the stuff that will auto-fill the quiver slot when added to invent
(post-3.6.0 issue).
PatR [Mon, 26 Feb 2018 16:35:33 +0000 (08:35 -0800)]
fix #H4997 - "Congratulations" -> "Well done"
Reported suggested that "congratulations" was too modern for use by
your god during ascension and that the longer phrases which were
shortened to yield it were too modest for the god to use. Make the
suggested change.
PatR [Sun, 25 Feb 2018 03:35:56 +0000 (19:35 -0800)]
fix #H6861 - whatis behaves weirdly with plurals
Report indicated that looking up "more info?" for "kittens" would show
the data.base entry for "kitten" and then when the display window was
dismissed, another "--More--" prompt for a empty second display window
would occur. Looking up "2 arrows" from a closely-seen object on the
map behaved similarly. User correctly diagnosed that the two-pass
lookup left the 'found_in_file' flag set from the first pass during
the second but that just clearing that resulted in "I have no info
about such things" on the second pass. The code is on the convoluted
side and needed an extra flag to handle 'seen on first pass' in
addition to clearing found flag after the first pass. I also added a
check to skip the second display if primary and secondary keys don't
match each other but both find the same entry. To test it, I tried
"a +0 aklys named aclys". That found the aclys entry but failed to
find "+0 aklys", so I added another change to have the key massaging
remove +/-N after removing "a", "an", or "the".
If "Want to see more info \"" + lookup string + "\"?" was too long,
the prompt buffer passed to yn() was being left uninitialized. Also,
test for too long was based on BUFSZ but yn() complains (to paniclog)
if the prompt is longer than QBUFSZ. Make checkfile() construct a
truncated prompt if the lookup string is too long.
I untangled some spaghetti by making all the 'goto's be forward. It
didn't help a lot but did simplify a few early returns by having them
jump to a common exit instead of replicating the file close.
keni [Fri, 9 Feb 2018 16:48:04 +0000 (11:48 -0500)]
gitinfo.pl: special case code to allow running it from $TOP or DEVEL without
installing the hooks first
NHgithook.pm: add some warnings if nhversioning can't open files
make sure nhversioning fails before opening gitinfo.txt if it can't get valid
data
nhmall [Mon, 29 Jan 2018 03:54:08 +0000 (22:54 -0500)]
Incorporate some git information into NetHack
Incorporate some git information into NetHack so that it
is potentially visible to a player. That's useful when
collecting details about the version that they are
running and, if the gitinfo is present, it can tie the
code to a specific git commit in the repository.
This modifies 'makedefs -v' to check for the presence of a data file
called dat/gitinfo.txt and if it is there, parse out its
contents, then write additional lines to include/date.h beyond
what 'makedefs -v' was previously putting in there, similar to
this sample:
It also adjusts the contents of the 'v' version information to
include the additional git info when available.
Also adds some hooks DEVEL/hooksdir and a perl file to DEVEL
for simplifying and automating the deposit of dat/gitinfo.txt
so that it generally reflects the most current git commit.
DEVEL/gitinfo.pl can be used to build dat/gitinfo.txt at any
time without doing a commit, merge, or checkout.
perl DEVEL/gitinfo.pl
command line --version and -version support
To complement the extra information being provided in the
version by the 'v' command, this also adds support for the
following new command line arguments:
--version
-version Output the NetHack version string then exit.
--version:paste Output the NetHack version string and also copy it to
-version:paste the platform's paste buffer for insertion somewhere,
then exit.
If the paste variation of -version is requested on a platform that
hasn't incorporated any support for the capability, it will deliver
the version info then an error message, prior to exiting.
To support the extended -version:paste variation, a port needs to:
- provide a port-specific routine to perform
the paste buffer copy in a port code file.
- #define RUNTIME_PASTEBUF_SUPPORT in the include/portconf.h header file.
--skeleton--
void port_insert_pastebuf(buf)
char *buf;
{
/* insert code to copy the version info from buf into
platform's paste buffer in a supported way */
}
macosx and Windows have both added support for RUNTIME_PASTEBUF_SUPPORT
PatR [Fri, 23 Feb 2018 21:07:49 +0000 (13:07 -0800)]
switch docall() to safe_qbuf()
Simplify docall() for object types. Adds some different complexity to
a new routine so the overall simplification is rather minimal, but we
already have a routine to construct prompt buffers involving formatted
object names without allowing overflow, so use it.
tty getlin() limits the input to COLNO characters, so 80 by default.
To get potential QBUFSZ overflow, I had to increase COLNO in global.h
and rebuild from scratch. A value greater than 127 triggers a lot of
warnings. I didn't try 127. 126 gets one warning, involving use of
FARAWAY (defined as COLNO+2) in dogmove.c.
We should change things to limit object names to much less than 80,
but this doesn't attempt to implement that.
PatR [Fri, 23 Feb 2018 15:25:37 +0000 (07:25 -0800)]
fix "wonky secret door" in Cav quest
The earlier fix for hoizontal vs vertical doors would have worked for
the Cav quest (lower left in leader's chamber) where door handling
occurs before wallification, but it wasn't working for minend-3 (east
wall of entry room) which already had walls. The more recent fix
solved the second case but broke the first one. I think this actually
solves both modes of door classification. I hope....
PatR [Thu, 22 Feb 2018 06:44:15 +0000 (22:44 -0800)]
fix #6870 - clairvoyance feedback
Forwarded to the contact form from a github "issue": in some
circumtances clairvoyance lets you move the cursor around to examine
the revealed map, and when doing so starts with "for instructions
type '?'". When extended clairvoyance periodically kicks in, as
opposed to explicitly casting the spell, there wasn't sufficient
context to figure out what it was prompting for (unless you actually
answer '?' to get instructions). Depending upon the most recent
message, it could seem like quite a strange prompt. Explicitly give
a clairvoyance-specific message prior to that.
Also, the getpos() help was including suggestions for targetting
monsters that aren't appropriate when it's being used for detection.
do_name.c has had quite a bit of formatting rot slip in since 3.6.0.
This fixes up the stuff I spotted by manual inspection.
PatR [Wed, 21 Feb 2018 03:32:47 +0000 (19:32 -0800)]
pline() -> raw_print() -> dumplog()
Reorder some code in pline() so that early pline messages which use
raw_print() instead of putstr(WIN_MESSAGE) are included in the DUMPLOG
message buffer. If the game ends soon enough they'll be shown in the
final log; otherwise they'll get pushed out of the buffer once enough
later messages are delivered.
Alex Smith [Tue, 20 Feb 2018 21:53:27 +0000 (21:53 +0000)]
Wake up monsters, and let them stop eating, before angering them
If we do it the other way round, then mimics will forget what
they're mimicking without a seemimic() call, meaning that the
line-of-sight calculations can get confused if the mimic was
mimicking something opaque.
PatR [Mon, 19 Feb 2018 19:59:14 +0000 (11:59 -0800)]
fix #H6867 - mail buffer overrun
Web contact report of a github pull request. A previous fix from
same user dealt with potential crash caused by freeing mailbox data
when the mailbox came from getenv("MAIL"). getenv() doesn't return
a value obtained by malloc so freeing it was bad. The fix was to
allocate memory to hold a copy of getenv("MAIL") so that free() was
valid. Unfortunately it didn't allocate enough space to hold the
terminating '\0' so potentially corrupted malloc/free bookkeeping
data. And the alloc+copy was being performed every time the mailbox
was checked, resulting in leaked memory from the previous check (if
MAIL came from player's environment). Fortunately the recheck only
takes place after new mail is actually detected and reported to the
player so the leak was probably small for most folks.
This compiles for the set of conditionals that apply to me (after
taking out -DNOMAIL that the hints put in my Makefile) but I can't
test that it actually works since mail is never delivered to this
machine.
PatR [Sun, 18 Feb 2018 02:54:52 +0000 (18:54 -0800)]
static analyzer bit
I can't find the original message at the moment, but one of the things
that an analyzer complained about was the *s='\0' possibly assigning
to a Null pointer. The superfluous test of 's' in the while condition
has fooled it into thinking that's possible when it's not.
if (s) {
while (s && ...) {
*s++ = ...
}
*s = '\0';
}
keni [Fri, 16 Feb 2018 17:07:37 +0000 (12:07 -0500)]
infrastructure fixes:
- fix bug in git hooks that loses file permissions when doing variable expansion
- fix execute permissions on sys/unix/hints/macosx.sh
- explicitly call out perl as required for hooks in Developer.txt
PatR [Thu, 15 Feb 2018 18:13:42 +0000 (10:13 -0800)]
place_lregion() bug
Noticed while looking into the TROUBLE_STUCK_IN_WALL prayer bug,
place_lregion() has been using the wrong row for 'low y' in its
whole-level handling, presumeably ever since it was first introduced.
3.4.3 definitely had the same bug; I didn't check any further back.
For maze levels which only consider every other row and every other
column to be viable locations this probably didn't matter. And even
non-maze levels usually don't have anything on row 0, so this fix
isn't likely to be noticeable.
PatR [Thu, 15 Feb 2018 02:38:35 +0000 (18:38 -0800)]
fix #H4240 - linking on VAX/VMS
First reported two years ago, then again this week by someone else
who didn't go through the web contact page (so no new #H number or
bugzilla entry). Using vmsbuild.com to build on VAX complains about
not being able to resolve a bunch of functions--it's basically
trying to build the full program using only the code supplied by
sys/vms/vmsmain.c. The original report mentioned a workaround and
was also dealing with a second issue (already fixed post-3.6.0) that
I incorrectly guessed was responsible for the linking problem. This
report had the correct linker magic to fix the linking issue.
I'm still not sure whether the order of /Library and /Include after
the name of an object library file on a LINK command line matters.
In a linker options file, which vmsbuild.com constructs and uses,
/Include needs to come first so that the contents of the library are
searched after the explicitly included object modules are processed.
Building with the Makefiles (using DEC's MMS or some versions of
freeware MMK) doesn't collect the object files into a library so was
never affected by this. And the linker options ordering issue is
apparently specific to the VAX/VMS linker; vmsbuild.com run on Alpha
and on IA64 linked 3.6.0 successfully without this fix.
PatR [Thu, 8 Feb 2018 01:31:44 +0000 (17:31 -0800)]
'Iu' vs unknown container contents
An inventory of unpaid items where more than one was present would
show
|> bag's contents N zorkmids
if any of the items were inside a container whose contents aren't
known. But if there was only one item (so container must be owned
by hero) the 'Iu' output menu was skipped for pline and yielded
|> scroll of magic mapping 133 zorkmids
Force the menu display if the lone unpaid item is inside a container
whose contents are unknown.
I'm not sure whether a hero-owned container can have both unknown
contents and an unpaid item in normal play. I managed it while
trying to fix a reported problem--except I can no longer find the
relevant report--where itemized shop billing also revealed unseen
container contents (for any number of items, not just 1). That isn't
fixed yet, but I want to get the simpler 'Iu' part out of the way.
PatR [Tue, 6 Feb 2018 00:36:35 +0000 (16:36 -0800)]
fix #H4459 - shopkeeper/scare monster bug
Reported about 18 months ago: standing on a scroll of scare monster
while next to a shopkeeper who was blocking the shop entrance because
hero was carrying unpaid shop goods would yield "<shk> turns to flee"
but <shk> wouldn't move. This was a side-effect of making standing
on scrolls of scare monster be stronger than on "Elbereth" when the
latter was nerfed. Make shopkeepers inside their own shops and temple
priests inside their own temples be immune to the effect of hero
standing on scare monster.
Also, make the Wizard, lawful minions, Angels of any alignment, the
Riders, and shopkeepers and priests in their own special rooms (ie,
all creatures that now ignore standing on scare monster) be immune to
the fright effect of tooled horns. Innate magic resistance usually
prevented them from being scared anyway, but make it explicit.
Reading a scroll of scare monster or casting the spell of cause fear
still rely on innate resistance to avoid chasing away those monsters.
I'm not sure whether they should have the same adjustment.
PatR [Sun, 28 Jan 2018 08:38:08 +0000 (00:38 -0800)]
fix #6691 and a couple other twoweap issues
Report was for dual-wielding hitting an enchanter and assumed that
a resistant artifact as primary weapon was protecting vulnerable
secondary weapon. Actual reason was simpler.
When in normal form, dual-wielding attacks against creatures which
cause erosion to the weapon which hits them would only inflict the
passive erosion damage to the primary weapon, even if it missed and
secondary hit. Make primary attack always trigger passive counter-
attack--before second swing now, rather than after--even if it misses,
and secondary attack trigger another one if that hits. Both weapons
are now subject to passive erosion (but only when they actually hit);
when secondary weapon hits, hero gets a double dose of counter-attack.
Hero poly'd into a monster with multiple weapon attacks (various
leaders: dwarf lord, orc-captain, and so forth) would try to emulate
dual wielding and first hit with uwep then with uswapwep. But it
would do that even if uswapwep was a bow or stack of darts that the
player had no itention of using for hand-to-hand. Stick with repeat
hits by uwep when uswapwep seems inappropriate.
Splitting a pudding while dual-wielding would only do so when hit by
uwep of appropriate material, never when hit by uswapwep. So silver
saber and longsword could split if longsword was primary but never
split if saber was primary. Check material and splitting separately
for each hit. It's now possible to split twice with one dual-weapon
attack if both weapons hit and both are made of the right material
(iron or 'metal'; among relevant objects the latter is only used for
tsurugi and scapel).
PatR [Tue, 23 Jan 2018 08:52:57 +0000 (00:52 -0800)]
fix 'makedefs -z' for config using FILE_PREFIX
Apply user-contributed patch to make do_vision() handle FILE_PREFIX
correctly. It was putting that value into the filename buffer, then
overwriting it with the ordinary filename instead of appending.
Deletion of just-made vis_tab.h when creation of vis_tab.c fails would
have failed too if FILE_PREFIX had been working.
The patch was against 3.4.3 and didn't apply cleanly to current code,
but it is a staightforward fix, although the file deletion case was
buggy (failed to clear "vis_tab.c" from buffer before reconstructing
"vis_tab.h" via appending stuff). FILE_PREFIX seems to be Amiga-only
so I've only tested the usual case where it isn't defined.
PatR [Mon, 22 Jan 2018 00:30:58 +0000 (16:30 -0800)]
fix object pickup
Mentioned in the newsgroup: picked up items have stopped merging with
compatible stacks in inventory.
The commit 0c5155584975731f2c37ace88acd046a54ae5aa6 by me on January 5
|
| fix #H6713 - unpaid_cost: object not on any bill
|
| Stealing a shop object from outside the shop with a grappling hook
| would result in that item being left marked 'unpaid' after the shop's
| bill was treated as being bought and not yet paid for. This led to
| "unpaid_cost: object wasn't on any bill" every time inventory was
| examined. The problem was caused by handling the shop robbery after
| removing the object from the floor but before adding it to inventory,
| so it couldn't be found to have its unpaid bit cleared.
|
inadvertently caused that. The effect was actually deliberate but it
wasn't intended to be so widespread. Handle extract/bill/addinv/rob
sequencing differently instead of overriding inventory merging.
PatR [Sat, 13 Jan 2018 00:13:14 +0000 (16:13 -0800)]
T-shirt punctuation
'It reads: "foo bar quux"' is a sentence so should have a terminating
period. Technically that ought to be placed inside the quotes, but
putting it after distinguishes slogans which have their own punctuation
from ones which don't.
A couple of entries contain multiple sentences. Some used two-space
separation between those sentences, some only one; make all use two.
Add a few new T-shirt messages, including a couple with pop culture
references which are only 10 years old instead of 20 or more....
Alex Smith [Sat, 6 Jan 2018 00:31:11 +0000 (00:31 +0000)]
Fix an exploit involving bags and potions of water
Discovered while writing the previous commit. If you dipped a sack
full of potions into an uncursed potion of water, the potions would
dilute but you wouldn't lose the original potion, letting you repeat
until all were diluted.
Allowing people to do this trick to blank multiple potions from one
potion of water seems like it's not an abuse, given that it can be
done in a more tedious way with water walking or the like and it
costs resources, but it's definitely abusive to make it possible
entirely for free.
Alex Smith [Sat, 6 Jan 2018 00:12:49 +0000 (00:12 +0000)]
Give feedback when oilskin sacks get wet
We can identify them by elimination in this case (they're the only
bag-like container that doesn't produce a message, the others all
do), so it's probably best to be more explicit as to what's going
on (for user interfaces and TDTTOE purposes).
PatR [Fri, 5 Jan 2018 09:23:56 +0000 (01:23 -0800)]
fix #H6713 - unpaid_cost: object not on any bill
Stealing a shop object from outside the shop with a grappling hook
would result in that item being left marked 'unpaid' after the shop's
bill was treated as being bought and not yet paid for. This led to
"unpaid_cost: object wasn't on any bill" every time inventory was
examined. The problem was caused by handling the shop robbery after
removing the object from the floor but before adding it to inventory,
so it couldn't be found to have its unpaid bit cleared.
When investigating this I came across a more severe bug: if the hero
had never entered the shop, the shopkeeper's bill wasn't initialized
properly and add_one_tobill() could crash while attempting to execute
bp->bo_id = obj->o_id;
because 'bp' was Null.
PatR [Tue, 2 Jan 2018 01:14:37 +0000 (17:14 -0800)]
fix #H6707 - double "gush of water hits" messages
When polymorphed into an iron golem (or gremlin with 2/3 chance),
triggering a rust trap would give "a gush of water hits <you or some
body part>" and then give a second "a gush of water hits you" when
dealing with golem or gremlin effects. That made it seem as if the
trap was hitting twice. This removes the redundant messages. (Rust
trap against monster iron golem or gremlin didn't have them.)
PatR [Mon, 1 Jan 2018 01:19:38 +0000 (17:19 -0800)]
special level mimics
The special level loader would allow the level description to specify
an alternate monster appearance for any type of monster, and if one
was specified for a mimic then that mimic would be polymorphed into
the appearance instead of masquerading as it. This changes it to
only use an appearance for mimics, the Wizard, vampires, and general
shapeshifters (chameleons, doppelgangers, sandestins). The mimic
case doesn't work as expected: map display shows the symbol for the
specified shape but farlook describes it as a mimic. The Wizard case
hasn't been tested. The chameleon and vampshifter cases seem to work.
It also allowed shapechangers (including vampires) to be given an
object or furniture appearance. I didn't try things out to find out
what what their behavior would be if/when that happened.
I'm not sure whether the farlook issue for mimics-as-monsters is with
the pager code or the monster name formatting code. (Possibly the
mimic just needs to be flagged has 'hidden' as well has having an
alternate appearance.) I'm not going to worry about it since none of
our special levels attempt to give mimics a monster shape. Mimicking
a monster is a feature for clones of the Wizard, not for mimics,
although it might be nice if the latter worked correctly someday.
PatR [Sun, 31 Dec 2017 11:38:29 +0000 (03:38 -0800)]
fix #H6704 - appearance of mimic's replacement
If mimics were genocided before loading a special level which
contained mimics with specific appearances, whatever random monsters
took their place also end up having their intended appearance.
monst->cham uses NON_PM rather than 0 to mean "not a shapechanger".
PatR [Sat, 30 Dec 2017 00:20:05 +0000 (16:20 -0800)]
uncursing prayer vs helm of opposite alignment
Implement the suggestion that hero's current god not uncurse a worn helm
of opposite alignment when prayer result is fix-worst-cursed-item or
uncurse-all-cursed-items since doing so makes it easy for hero to switch
to another god. The second boon will still uncurse non-worn helms of
opposite alignment since that has no effect on how easy or hard it is
for the hero to change alignments. (The first boon only applies to worn
items plus luckstones and loadstones; non-worn helms aren't applicable.)
PatR [Thu, 28 Dec 2017 23:40:11 +0000 (15:40 -0800)]
playing music while impaired
Newsgroup discussion mentioned that it was possible to open the castle
drawbridge with musical notes even while confused. There was already
some handling for confusion: improvisation treats magical instruments
as their mundane equivalents. This takes if farther: when stunned
or confused or hallucinating you'll always improvise instead of being
given a chance to choose notes. Being stunned now behaves the same
as being confused in regards to magical instruments (possibly/probably
it should prevent playing music altogether). Hallucination gives
different feedback at start but still allows magical playing.