PatR [Wed, 21 Nov 2018 11:10:49 +0000 (03:10 -0800)]
Schroedinger's Cat
If hero was carrying Schroedinger's Box at end of game, disclosing
inventory converted it into an ordinary box. That interferred with
subsequent disclosure when writing DUMPLOG, which saw an empty box
if inventory had been shown or the special box with newly-determined
contents if not. I tried a couple of ways to fix it and decided
that redoing it was better in the long run.
Schroedinger's box is still flagged with box->spe = 1, but instead
of having that affect the box's weight, now there is always a cat
corpse in the box. When opened, that will already be in place for
a dead cat or be discarded for a live one, but the weight will be
standard for container+contents and when box->cknown is set it will
always be "containing 1 item" (which might turn out to be a monster).
Some temporary code fixes up old save/bones files to stay compatible.
TODO: food detection used to skip Schroedinger's Box; now it will
always find a corpse, so some fixup like the ridiculous probing code
is needed.
PatR [Tue, 20 Nov 2018 21:13:23 +0000 (13:13 -0800)]
fix #H7530 - corpse from corpseless monster
Migrating monster attempting to arrive on a level which is already
full of monsters gets killed off. It was leaving a corpse without
regard for whether it was a type of of monster which should never
leave corpses.
I'd prefer that it be put back on the migrating_mons list rather
than be killed off, but this just suppresses impossible corpses.
Bart House [Tue, 20 Nov 2018 18:46:45 +0000 (10:46 -0800)]
Addressed compiler warnings.
Fixed declarations of draw_classic, draw_vertical and draw_horizontal.
Moved definitions of locals before code. Added initialization of
locals. Changed comments to c-style.
PatR [Tue, 20 Nov 2018 00:24:10 +0000 (16:24 -0800)]
life-saving vs sickness
Replace an old instance of direct manipulation of an intrinsic.
If life-saving occurs 1 turn before sickness will kill the hero,
the sickness if cured. But it was leaving delated_killer for SICK
allocated. Harmless but a bug none the less.
Pasi Kallinen [Mon, 19 Nov 2018 20:04:32 +0000 (22:04 +0200)]
Replace long worm on map after removing tail with wormgone
Calling wormgone will also remove the long worm monster from
the map, not just the worm tail. Put the monster back on map
so relmon can actually remove it properly.
Pasi Kallinen [Mon, 19 Nov 2018 19:54:32 +0000 (21:54 +0200)]
Explicitly remove long worm segments from the map
When a long worm was removed from the map, the segments for that worm
retained their map location info. This caused problems later on if
wormgone (or toss_wsegs) was called, because it would try to remove the
segments of that worm from the map.
Pasi Kallinen [Mon, 19 Nov 2018 19:27:19 +0000 (21:27 +0200)]
Long worm may get killed in middle of action
If long worm attacks you, and you have a passive response that may
kill the worm (eg. blue jelly), the worm may die in the middle of
a loop checking for a worm segment that can attack. This'll cause
a segfault because the worm segments will get freed.
Pasi Kallinen [Mon, 19 Nov 2018 19:24:08 +0000 (21:24 +0200)]
Moving long worms may still put tail in old location
When using rloc and friends to move monsters, and the monster
happens to be a long worm, the tail may get randomly placed
in the same place where the long worm was removed from.
In the cases where we expect the location to really be free,
explicitly recheck the location for a monster after rloc.
Pasi Kallinen [Sat, 17 Nov 2018 17:59:09 +0000 (19:59 +0200)]
Fix vault guard not considering monsters in walls
Two different cases here: a) Vault guard did not move away monsters
except if they were standing on gold, and b) moving away monsters
on a completely filled level did not work
Pasi Kallinen [Sat, 17 Nov 2018 17:26:49 +0000 (19:26 +0200)]
Fix freeing monsters not on map
Sometimes we free the monster data, but the monster is not on the
map - usually this happens if the map is full of monsters and a new one
is migrated on the level.
Make m_detach check the monster x coordinate, so it knows not to touch the map
if the monster isn't on it.
PatR [Mon, 19 Nov 2018 02:48:59 +0000 (18:48 -0800)]
fix #H7573 - impossible zero payment in money2mon
When paying for shop door or wall damage, if the entire amount was
covered by shop credit then impossible "zero payment in money2mon"
would occur as the shop code tried to transfer 0 zorkmids from hero
to shopkeeper after using credit to pay.
Bart House [Sun, 18 Nov 2018 07:56:31 +0000 (23:56 -0800)]
Build curses if PDCurses is available.
There are two ways to enable curses in the build. Either set the
environment variable PDCURSES to a folder containing a PDCurses repository
OR place the PDCurses folder alongside the NetHack source repository.
PatR [Sun, 18 Nov 2018 00:40:53 +0000 (16:40 -0800)]
src/ formatting
Clean up quite a bit of minor things found with simple grep patterns:
operator at end of continued line instead of beginning of continuation
(and a few comments which produced false matches, so that they won't
do so next time), trailing spaces (only one or two of those), tabs (a
dozen or so of those), several casts which didn't have a space between
the type and the expression (I wasn't systematic about finding these).
I think the only code change was in the function for the help command.
PatR [Sat, 17 Nov 2018 02:49:12 +0000 (18:49 -0800)]
feedback for missing readonly data files
If bogusmon, engrave, epitaph, oralces, or rumors won't open, assume
it's because the file is missing so don't have impossible() tack on
"saving and restoring might fix this" when telling the player.
(Missing rumors or oracles previously only used pline() rather than
impossible() so this hadn't been an issue for them. Now it would be.)
PatR [Fri, 16 Nov 2018 23:34:09 +0000 (15:34 -0800)]
more vms (vmsbuild.com vs monstr.c)
Apparently I exited emacs without saving and the revised vmsbuild.com
ended up as a backup file that 'git nhadd' wouldn't see. This was
supposed to be included in the patch committed several hours ago....