]> granicus.if.org Git - nethack/log
nethack
9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed...
Pasi Kallinen [Wed, 1 Apr 2015 13:09:53 +0000 (16:09 +0300)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp

Conflicts:
src/trap.c
sys/winnt/Makefile.msc

9 years agoX11 menu hack for ':'
PatR [Wed, 1 Apr 2015 09:47:04 +0000 (02:47 -0700)]
X11 menu hack for ':'

Same functionality as was recently implemented for tty.  If a
character like ':' is an explicit menu selector and the player
types it, select that menu entry rather than treating it as a
search request.  (Same for other menu commands like '>', but
offhand I can't think of anything besides container looting's
': - look inside' that uses any non-letter selectors other
than '$', which isn't used as a menu meta command.)

9 years agoRemove EXPLORERS from winnt sysconf
Pasi Kallinen [Wed, 1 Apr 2015 05:29:12 +0000 (08:29 +0300)]
Remove EXPLORERS from winnt sysconf

Stupidly added this to the winnt sysconf, when it should've
been *nix only.

9 years agonon-Unix build was broken today
nhmall [Tue, 31 Mar 2015 23:07:25 +0000 (19:07 -0400)]
non-Unix build was broken today

 Changes to be committed:
modified:   src/cmd.c

../src/cmd.c(515) : warning C4013: 'check_user_string' undefined; assuming extern returning int)
link error - cmd.o : error LNK2019:
unresolved external symbol _check_user_string referenced in function _enter_explore_mode

9 years agoShow legal jumping positions
Pasi Kallinen [Tue, 31 Mar 2015 18:40:49 +0000 (21:40 +0300)]
Show legal jumping positions

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
keni [Tue, 31 Mar 2015 17:08:18 +0000 (13:08 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agoUpdate docs for NHDT V2.
keni [Tue, 31 Mar 2015 16:29:58 +0000 (12:29 -0400)]
Update docs for NHDT V2.

9 years agoSome spam for mail daemon to deliver
Pasi Kallinen [Tue, 31 Mar 2015 15:32:23 +0000 (18:32 +0300)]
Some spam for mail daemon to deliver

9 years agoAllow admin to disable explore mode
Pasi Kallinen [Tue, 31 Mar 2015 15:14:10 +0000 (18:14 +0300)]
Allow admin to disable explore mode

Some public servers want to disable explore mode, so
make it configurable in sysconf.

9 years agoNHDT substitution version 2.
keni [Tue, 31 Mar 2015 13:50:02 +0000 (09:50 -0400)]
NHDT substitution version 2.

Re-run nhgitset.pl to install.
"perldoc DEVEL/hooksdir/nhsub" for details.  General docs still to come.
Quick notes:
- "git nhsub" lets you apply substitutions to a file without involving any
  version control.
- When doing nhadd/nhcommit, the working directory WILL reflect the results
  of the substitutions.
Let's see what this breaks.

9 years agoUse a menu when user wants to query a glyph
Pasi Kallinen [Tue, 31 Mar 2015 09:59:27 +0000 (12:59 +0300)]
Use a menu when user wants to query a glyph

When user presses '/', pop up a meny asking what the user wants to
look at:

What do you want to look at:

a - something on the map
b - something you're carrying
c - something else

This replaces the "Specify unknown object by cursor?" -prompt,
while keepng backwards compatibility, and also allows querying
about items in the inventory.

9 years agoUpdate fixes35.0
Pasi Kallinen [Tue, 31 Mar 2015 09:41:35 +0000 (12:41 +0300)]
Update fixes35.0

9 years agoMoving clouds on the plane of air
Pasi Kallinen [Tue, 31 Mar 2015 08:46:41 +0000 (11:46 +0300)]
Moving clouds on the plane of air

Reusing the plane of water air bubbles code

9 years agoRevert one GCC warning
Pasi Kallinen [Tue, 31 Mar 2015 07:20:20 +0000 (10:20 +0300)]
Revert one GCC warning

9 years agoadd .gitignore entries: tile.h, NetHack.ad
PatR [Tue, 31 Mar 2015 07:18:00 +0000 (00:18 -0700)]
add .gitignore entries: tile.h, NetHack.ad

Add a couple of missing .gitignore entries for files put into
place when building.  include/tile.h is genearated for tiles
and dat/NetHack.ad is copied for X11 resource definitions.

9 years agobhitpile lint bit
PatR [Tue, 31 Mar 2015 06:20:45 +0000 (23:20 -0700)]
bhitpile lint bit

The 'zdir' function parameter has the same name as 'zdir' global
variable, triggering a 'shadowing' warning.  I had to read the 'if'
statement multiple times to convince myself it was doing what was
intended.  It was, but I think this rewrite is easier to understand
(at least for my feeble reptilian brain).

I don't know who Tim Wright is, but his 15 mintues of fame has
lasted for at least a decade so I cut his comment out.  (The 28.5
year old GAN one a dozen lines lower was a tempting target for
removal, but I managed to stop myself; otherwise it never ends.)

9 years agoBear traps wound legs
Pasi Kallinen [Tue, 31 Mar 2015 06:38:38 +0000 (09:38 +0300)]
Bear traps wound legs

9 years agoSilence GCC warnings
Pasi Kallinen [Tue, 31 Mar 2015 05:36:32 +0000 (08:36 +0300)]
Silence GCC warnings

...when compiling with -Wall --pedantic

9 years agolint cleanup for tty 'gray'
PatR [Mon, 30 Mar 2015 23:10:14 +0000 (16:10 -0700)]
lint cleanup for tty 'gray'

gcc complained about assigning string literals to variables that aren't
const.  String literals don't have const type but modifying them results
in undefined behavior, so the warning is justified.  Except in this case
the strings were never being modified so if wasn't justified after all.
Switch to a static buffer anyway.

9 years agoOptions to create the character blind or nudist
Pasi Kallinen [Mon, 30 Mar 2015 19:09:20 +0000 (22:09 +0300)]
Options to create the character blind or nudist

For those pro players who really want to try their hand
at that zen samurai, without needing to reroll thousands
of times to start with blindfold.  Nudist starts without
any armor, and keeps tabs whether you wore any during
the game, for even more bragging rights.

Also makes the Book of the Dead readable even while
blind, for obvious reasons.

9 years agoNew T-shirt texts, bogusmon, one YAFM
Pasi Kallinen [Mon, 30 Mar 2015 14:09:12 +0000 (17:09 +0300)]
New T-shirt texts, bogusmon, one YAFM

9 years agocmdline Makefile updates
nhmall [Mon, 30 Mar 2015 01:00:50 +0000 (21:00 -0400)]
cmdline Makefile updates

9 years agoclean up cmdline Makefile for VS2010,VS2013,...
nhmall [Mon, 30 Mar 2015 00:28:38 +0000 (20:28 -0400)]
clean up cmdline Makefile for VS2010,VS2013,...

VS2010 tested ok.
VS2013 tested ok.
VS2015 generated a _lot_ of linker warnings building NetHack, but it built.

9 years agofix some compiler warnings windows cmdline
nhmall [Mon, 30 Mar 2015 00:07:41 +0000 (20:07 -0400)]
fix some compiler warnings windows cmdline
 Changes to be committed:
modified:   src/hack.c
modified:   src/vision.c

9 years agoAdd new hallucinatory gods.
Sean Hunt [Sun, 29 Mar 2015 23:10:46 +0000 (19:10 -0400)]
Add new hallucinatory gods.

9 years agoFix a compiler warning.
Sean Hunt [Sun, 29 Mar 2015 22:20:26 +0000 (18:20 -0400)]
Fix a compiler warning.

9 years agoAdd more explicit helpless reasons
Pasi Kallinen [Sun, 29 Mar 2015 19:08:46 +0000 (22:08 +0300)]
Add more explicit helpless reasons

Instead of just "while helpless", the death reason will tell
more explicitly why the player was helpless.  For example:
"while frozen by a monster's gaze"

9 years agoadd data.base suggestion for whistle
nhmall [Sun, 29 Mar 2015 14:50:39 +0000 (10:50 -0400)]
add data.base suggestion for whistle

On 1/24/2014 6:48 AM, a bug reporter wrote:
> The whistle in Nethack has no encyclopedia entry. I suggest for the next
> release something from the M. R. James ghost story 'Oh, Whistle, and I'll Come
> to You My Lad'.
>

9 years agoKicking a grave may topple the gravestone
Pasi Kallinen [Sun, 29 Mar 2015 14:44:59 +0000 (17:44 +0300)]
Kicking a grave may topple the gravestone

...with similar alignment hit as when digging up a grave.

9 years agoUse dark gray color for black glyphs in TTY
Pasi Kallinen [Sun, 29 Mar 2015 12:49:01 +0000 (15:49 +0300)]
Use dark gray color for black glyphs in TTY

This is Michael Deutschmann's use_darkgray -patch.
Adds a boolean option use_darkgray, settable in config file.

This patch has been in use on NAO for years, and I have heard
once someone say their terminal didn't support the dark gray
color.

9 years agoSave playmode in xlogfile
Pasi Kallinen [Sun, 29 Mar 2015 11:56:23 +0000 (14:56 +0300)]
Save playmode in xlogfile

9 years agodoc/fixes update for C343-357
nhmall [Sat, 28 Mar 2015 22:20:19 +0000 (18:20 -0400)]
doc/fixes update for C343-357

9 years agofix C343-357 Rust monsters may chew non-ferrous items
nhmall [Sat, 28 Mar 2015 22:08:09 +0000 (18:08 -0400)]
fix C343-357 Rust monsters may chew non-ferrous items
 Changes to be committed:
modified:   src/mon.c

website should be updated to reflect this bug closure.

C343-357 Rust monsters may chew non-ferrous items.

9 years agoremove #ifdef TOURIST straggler
nhmall [Sat, 28 Mar 2015 22:05:42 +0000 (18:05 -0400)]
remove #ifdef TOURIST straggler
 Changes to be committed:
modified:   src/worn.c

9 years agoGuidebook transcription typo
nhmall [Sat, 28 Mar 2015 19:23:28 +0000 (15:23 -0400)]
Guidebook transcription typo

9 years agoIt's Wonka Bar, not just Wonka
Pasi Kallinen [Sat, 28 Mar 2015 18:39:40 +0000 (20:39 +0200)]
It's Wonka Bar, not just Wonka

9 years agoFeedback when boomerang hits sink
Pasi Kallinen [Sat, 28 Mar 2015 17:38:15 +0000 (19:38 +0200)]
Feedback when boomerang hits sink

9 years agoYAFMs when trying to pick up terrain features
Pasi Kallinen [Sat, 28 Mar 2015 17:31:01 +0000 (19:31 +0200)]
YAFMs when trying to pick up terrain features

9 years agoAdd missing prototype
Pasi Kallinen [Sat, 28 Mar 2015 17:21:49 +0000 (19:21 +0200)]
Add missing prototype

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Sat, 28 Mar 2015 15:23:47 +0000 (11:23 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agoBalsa wands break easily
Pasi Kallinen [Sat, 28 Mar 2015 15:20:57 +0000 (17:20 +0200)]
Balsa wands break easily

9 years agoflavor enhance zap downwards/upwards when hiding
nhmall [Sat, 28 Mar 2015 15:20:44 +0000 (11:20 -0400)]
flavor enhance zap downwards/upwards when hiding
 Changes to be committed:
modified:   doc/fixes35.0
modified:   include/extern.h
modified:   src/apply.c
modified:   src/zap.c

    On 3/23/2015 6:41 PM, a bug reporter wrote:
    > When you're hiding under an item (e.g. via garter snake polyform), and
    > that item gets polyshuddered into nonexistence, you continue hiding
    > (under nothing).
    This was addressed previously.

    > (Incidentally, it's a bit weird that you use > to aim at items that are
    > flavorwise above you at the time.)

    This addresses the flavorwise concern.

9 years agoUse existing function to count containers
Pasi Kallinen [Sat, 28 Mar 2015 14:24:25 +0000 (16:24 +0200)]
Use existing function to count containers

9 years agoShow legal polearm hit positions
Pasi Kallinen [Sat, 28 Mar 2015 11:32:24 +0000 (13:32 +0200)]
Show legal polearm hit positions

User can press $ to display valid positions when asked
for a position to pick, and the positions will be hilighted

9 years agoRemove migrating monster from polearm targeting
Pasi Kallinen [Sat, 28 Mar 2015 08:55:41 +0000 (10:55 +0200)]
Remove migrating monster from polearm targeting

9 years agoAdd sysconf for linux-X11
Pasi Kallinen [Sat, 28 Mar 2015 08:00:44 +0000 (10:00 +0200)]
Add sysconf for linux-X11

9 years agoa couple of substitution errors in Guidebook.tex
nhmall [Sat, 28 Mar 2015 05:06:28 +0000 (01:06 -0400)]
a couple of substitution errors in Guidebook.tex

9 years agofix up some syntax errors in Guidebook.tex
nhmall [Sat, 28 Mar 2015 04:49:38 +0000 (00:49 -0400)]
fix up some syntax errors in Guidebook.tex

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
keni [Sat, 28 Mar 2015 01:38:25 +0000 (21:38 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agoregenerate Guidebook.txt
keni [Sat, 28 Mar 2015 01:31:25 +0000 (21:31 -0400)]
regenerate Guidebook.txt

9 years agotty menu hack for ':'
PatR [Sat, 28 Mar 2015 01:24:53 +0000 (18:24 -0700)]
tty menu hack for ':'

Looting a container generates a menu which contains ': - look inside'
but the recent change to make ':' be a menu command for selecting
items which match a search string made it impossible to pick that item.
(Well, I suppose you could enter a search string which matched it, but
that's a nuisance compared to just directly picking a choice.)  This
makes menu selection for tty give precedence to menu choice characters
over mapped menu commands when some character happens to be both.  I'm
not sure whether it ought to be expended to group accelerators too, so
didn't do that.

There's bound to be a better way to do this, but it works.

9 years agosubsitution gone amuck
nhmall [Fri, 27 Mar 2015 23:56:04 +0000 (19:56 -0400)]
subsitution gone amuck
 Changes to be committed:
modified:   doc/Guidebook.mn

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Fri, 27 Mar 2015 23:48:17 +0000 (19:48 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agomore doc updates
nhmall [Fri, 27 Mar 2015 23:47:17 +0000 (19:47 -0400)]
more doc updates
Changes to be committed:
modified:   dat/history
modified:   doc/Guidebook.mn
modified:   doc/Guidebook.tex

9 years agoAutomatically find monster to target with polearm
Pasi Kallinen [Fri, 27 Mar 2015 22:32:54 +0000 (00:32 +0200)]
Automatically find monster to target with polearm

If there's only one suitable monster within range, automatically
suggest it for targeting with the polearm

9 years agoRemember position of monster you hit with polearm
Pasi Kallinen [Fri, 27 Mar 2015 21:29:30 +0000 (23:29 +0200)]
Remember position of monster you hit with polearm

If you hit a monster with a polearm, following polearm applications
will try to automatically suggest the monster's position

9 years agoUpdate fixes35.0 with t-shirt text disclose
Pasi Kallinen [Fri, 27 Mar 2015 20:13:35 +0000 (22:13 +0200)]
Update fixes35.0 with t-shirt text disclose

9 years agoUpdate fixes35.0 with reading items
Pasi Kallinen [Fri, 27 Mar 2015 20:11:41 +0000 (22:11 +0200)]
Update fixes35.0 with reading items

9 years agoAllow reading many more items
Pasi Kallinen [Fri, 27 Mar 2015 19:04:01 +0000 (21:04 +0200)]
Allow reading many more items

You can now also read alchemy smocks, credit cards, cans of grease,
magic markers, gold, the Orb of Fate, and candy bars.

9 years agoShow t-shirt text at end of game inventory disclose
Pasi Kallinen [Fri, 27 Mar 2015 14:08:06 +0000 (16:08 +0200)]
Show t-shirt text at end of game inventory disclose

Restricting the text display only to the end of game disclose,
so it doesn't clutter the inventory during gameplay and so that
the readability of t-shirts is not given away.

9 years agoTTY: Guard against impossible x coord
Pasi Kallinen [Fri, 27 Mar 2015 13:29:54 +0000 (15:29 +0200)]
TTY: Guard against impossible x coord

If a menu item was longer than terminal width, the menu wasn't
cleared away after it was finished with.  This easily happened
when an inventory item was named.

9 years agoFix passing non-static buffer out of scope
Pasi Kallinen [Fri, 27 Mar 2015 13:12:04 +0000 (15:12 +0200)]
Fix passing non-static buffer out of scope

9 years agoobjnam formatting for bag of tricks
PatR [Fri, 27 Mar 2015 07:21:40 +0000 (00:21 -0700)]
objnam formatting for bag of tricks

Bag of tricks that had been used at least once was being described
as "empty" regardless of charge count, because it always fails the
Has_contents() test.  After half this patch fixed that, it started
being flagged as "empty" as soon as the last charge was used rather
than after attempting to use it again after that, since 'cknown' was
being set whenever it was used.  Only set that flag when applying
the bag has been observed to fail.

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Thu, 26 Mar 2015 16:41:26 +0000 (12:41 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agosync docs
nhmall [Thu, 26 Mar 2015 16:40:22 +0000 (12:40 -0400)]
sync docs

Pasi pointed it out that the SYSCF stuff was only added
to Guidebook.mn not Guidebook.tex

9 years agoCatch up and sync Guidebooks
Pasi Kallinen [Thu, 26 Mar 2015 14:46:41 +0000 (16:46 +0200)]
Catch up and sync Guidebooks

9 years agoFix typo in Guidebook.tex
Pasi Kallinen [Thu, 26 Mar 2015 14:14:33 +0000 (16:14 +0200)]
Fix typo in Guidebook.tex

9 years agonames of public servers and tournament contrib
nhmall [Thu, 26 Mar 2015 12:05:23 +0000 (08:05 -0400)]
names of public servers and tournament contrib
 Changes to be committed:
modified:   dat/history

9 years agoFix Guidebook typos
Pasi Kallinen [Thu, 26 Mar 2015 09:41:05 +0000 (11:41 +0200)]
Fix Guidebook typos

9 years agoFix typos in fixes35.0
Pasi Kallinen [Thu, 26 Mar 2015 06:44:24 +0000 (08:44 +0200)]
Fix typos in fixes35.0

9 years agofix acid_damage() crash
PatR [Thu, 26 Mar 2015 01:04:50 +0000 (18:04 -0700)]
fix acid_damage() crash

My dog bit an acid blob and triggered a crash, caught by SYSCF panictrace
but yielding confusing information.  The backtrace included a call from
'rustm()+N' that turned out to be passivemm(), which was deferencing a
null pointer since no weapon was involved.

9 years agoFix 'fetch' syntax, include sparkly 'git log' trick
Derek S. Ray [Wed, 25 Mar 2015 21:07:10 +0000 (17:07 -0400)]
Fix 'fetch' syntax, include sparkly 'git log' trick

And bolt a couple more Win32-folders onto .gitignore.

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
Pasi Kallinen [Wed, 25 Mar 2015 20:15:16 +0000 (22:15 +0200)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agoShow object symbols in menu headings
Pasi Kallinen [Wed, 25 Mar 2015 20:13:28 +0000 (22:13 +0200)]
Show object symbols in menu headings

... in menus where those object symbols act as menu accelerators.
Toggleable via "menu_objsyms" boolean option, defaults to off.

9 years agoFix a memory leak on termination.
Sean Hunt [Wed, 25 Mar 2015 18:34:03 +0000 (14:34 -0400)]
Fix a memory leak on termination.

Found by Alex Smith.

9 years agono hiding under nothing
nhmall [Wed, 25 Mar 2015 02:07:16 +0000 (22:07 -0400)]
no hiding under nothing

On 3/23/2015 6:41 PM, a bug reporter wrote:
> When you're hiding under an item (e.g. via garter snake polyform), and
> that item gets polyshuddered into nonexistence, you continue hiding
> (under nothing).

This addresses the "hiding under nothing" bug, but does not
address this flavor comment also included in the report:
> (Incidentally, it's a bit weird that you use > to aim at items that are
> flavorwise above you at the time.)

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource
nhmall [Tue, 24 Mar 2015 23:29:11 +0000 (19:29 -0400)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource

9 years agofix invalid pointer dereference in morguemon
nhmall [Tue, 24 Mar 2015 23:20:14 +0000 (19:20 -0400)]
fix invalid pointer dereference in morguemon

On 3/23/2015 6:41 PM, a bug reporter wrote:
> If the game generates a graveyard, the graveyard places a normal
> demon, but all normal demons are extinct at the time, then morguemon (at
> mkroom.c line 423) indexes mons with NON_PM (the return value of
> ndemon() if it can't find a reference), which is an invalid pointer
> dereference. According to the testbench, this mostly seems to happen on
> dlvl 12.

This fixes the code violation, but the logic will now drop down to the
ghost/wraith/zombie code when that happens.

Is that desireable, or should something else happen (for variety)?

9 years agoNHsubst bugfixes and hack for whitespace errors.
keni [Tue, 24 Mar 2015 22:29:02 +0000 (18:29 -0400)]
NHsubst bugfixes and hack for whitespace errors.

9 years agoAdd an option to give feedback when bumping walls
Pasi Kallinen [Tue, 24 Mar 2015 20:01:29 +0000 (22:01 +0200)]
Add an option to give feedback when bumping walls

Boolean option "mention_walls", defaults to off.
Useful for blind players.

9 years agoAdd more hallu sounds monsters make when hit
Pasi Kallinen [Tue, 24 Mar 2015 19:14:49 +0000 (21:14 +0200)]
Add more hallu sounds monsters make when hit

9 years agoMerge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource...
Pasi Kallinen [Tue, 24 Mar 2015 17:59:40 +0000 (19:59 +0200)]
Merge branch 'paxed-new_lev_comp' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp

Conflicts:
include/obj.h
include/patchlevel.h
src/topten.c
src/trap.c
sys/winnt/Makefile.msc

9 years agoMerge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed...
Pasi Kallinen [Tue, 24 Mar 2015 17:46:38 +0000 (19:46 +0200)]
Merge branch 'master' of https://rodney.nethack.org:20040/git/NHsource into paxed-new_lev_comp

Conflicts:
doc/fixes35.0
include/extern.h
include/ntconf.h
include/obj.h
include/patchlevel.h
src/dig.c
src/do.c
src/files.c
src/fountain.c
src/mklev.c
src/objnam.c
src/options.c
src/potion.c
src/rumors.c
src/save.c
src/topten.c
src/trap.c
src/wield.c
sys/share/pcmain.c
sys/unix/unixmain.c
sys/winnt/Makefile.msc
util/lev_main.c
util/makedefs.c

9 years agoUse the correct declaration macro
Pasi Kallinen [Tue, 24 Mar 2015 17:28:27 +0000 (19:28 +0200)]
Use the correct declaration macro

9 years agoinclude header file <ctype.h> in lev_main.c
nhmall [Tue, 24 Mar 2015 01:41:20 +0000 (21:41 -0400)]
include header file <ctype.h> in lev_main.c

options.c depends on ctype.h  and uses tolower()
so no sense getting into a discussion about
use of _that_

9 years agoActually use the new routines in lev_main
nhmall [Tue, 24 Mar 2015 01:34:28 +0000 (21:34 -0400)]
Actually use the new routines in lev_main

9 years agolev_main's own internal case-insensitive compare
nhmall [Tue, 24 Mar 2015 01:29:06 +0000 (21:29 -0400)]
lev_main's own internal case-insensitive compare

TEST SUITE

int case_insensitive_comp(const char *, const char *);

/* define your built-in compiler library variation here */

/* #define BUILTIN(a,b) strcasecmp(a,b) */
/* #define BUILTIN(a,b) stricmp(a,b) */

int main(int argc, char *argv[])
{
const char *t1 = "NetHack";
const char *t2 = "nethack";
const char *t3 = "Fred";
const char *t4 = "Barney lived next door";

/* try the results with built-in strcmpi first */

printf("builtin:\tcompare <%s> to <%s>, result %d.\n",
t1, t2, BUILTIN(t1,t2));
printf("builtin:\tcompare <%s> to <%s>, result %d.\n",
t3, t4, BUILTIN(t3,t4));

/* try the results with case_insensitive_comp 2nd */

printf("ours:\tcompare <%s> to <%s>, result %d.\n",
t1, t2, case_insensitive_comp(t1,t2));
printf("ours:\tcompare <%s> to <%s>, result %d.\n",
t3, t4, case_insensitive_comp(t3,t4));

}

int
case_insensitive_comp(s1, s2)
const char *s1;
const char *s2;
{
    unsigned char u1, u2;

    for ( ; ; s1++, s2++) {
u1 = tolower((unsigned char) *s1);
u2 = tolower((unsigned char) *s2);
if ((u1 == '\0') || (u1 != u2)) {
    break;
}
    }
    return u1-u2;
}

======================== END TEST SUITE ===========================

9 years agoinclude this also
nhmall [Mon, 23 Mar 2015 23:50:36 +0000 (19:50 -0400)]
include this also

9 years agoan easy fix for strcmpi and we move on
nhmall [Mon, 23 Mar 2015 23:24:56 +0000 (19:24 -0400)]
an easy fix for strcmpi and we move on

Here in branch paxed-new_lev_comp-B (branched
from paxed-new_lev_comp) is a simple fix
for the strcmpi issue.

The bottom section of lev_main.c has a bunch
of forced linkages to names from NetHack etc.
#ifdef STRICT_REF_DEF
bunch of stuff
#endif

This change to lev_main should make everything
work for those that don't supply a compiler
library version of strcmpi()

With this patch, those people can just
add a -DSTRICT_REF_DEF to their compile line
for lev_main.c.

This would close the issue in a simple way,
and doesn't require linking in anything new to
the level compiler, or modifying any port's Makefiles etc.

9 years agoFix use-after-frees on dipped objects.
Sean Hunt [Sat, 21 Mar 2015 15:55:30 +0000 (11:55 -0400)]
Fix use-after-frees on dipped objects.

9 years ago{DEC,IBM,MAC}graphics (2 of 2: unixmain)
PatR [Mon, 23 Mar 2015 01:29:37 +0000 (18:29 -0700)]
{DEC,IBM,MAC}graphics (2 of 2: unixmain)

Unix command line processing required that the initial 'd' of
"-DECgraphics" be lowercase so that it wouldn't conflict with -D for
wizard mode.  This retains -D for wizard mode and now also recognizes
"-debug" (case insensitive, but full 5 letters necessary) for the same
thing, and allows "-DECgraphics" to be capitalized as it is throughout
the rest of the program (actual matching is case-insensitive, so "-dec"
and "-decgraphics" still work.  It now requires that anything  after
"DEC" match the rest of that string instead of accepting "-DECanthing"
as a synonym for "-DECgraphics".  Likewise for "-IBMgraphics":  when
more than 3 letters are supplied, the extra ones must be an initial
substring of "graphics" rather than arbitrary characters.

The raw_printf() warnings don't actually work as intended, but that
isn't a change from the old behavior so I've left them in for now.

9 years ago{DEC,IBM,MAC}graphics (1 of 2: core)
PatR [Mon, 23 Mar 2015 01:22:36 +0000 (18:22 -0700)]
{DEC,IBM,MAC}graphics (1 of 2: core)

DECgraphics, IBMgraphics, and MACgraphics used to be recognized when
at least 3 letters were supplied back when they were true boolean
options.  When they got demoted to shortcuts for the symset option,
they started needing 10 (DEC and IBM) or all 11 (MAC), otherwise
triggering "bad syntax in NETHACKOPTIONS" (or config file).  Revert
to having the first three letters be sufficient.

9 years agoremove stale feature alert
nhmall [Sun, 22 Mar 2015 22:11:49 +0000 (18:11 -0400)]
remove stale feature alert

This old feature alert from 3.3.0 is pretty stale, so remove
if from the code because everybody has probably suppressed
it by now.

/* Because 'Q' used to be quit... */
if (flags.suppress_alert < FEATURE_NOTICE_VER(3,3,0))
pline("Note: Please use #quit if you wish to exit the game.");

9 years agoAdd note about feature alert mechanism
nhmall [Sun, 22 Mar 2015 22:04:18 +0000 (18:04 -0400)]
Add note about feature alert mechanism

9 years agoFile for explaining code quirks/features/caveats
nhmall [Sun, 22 Mar 2015 19:05:18 +0000 (15:05 -0400)]
File for explaining code quirks/features/caveats

- added NOCWD_ASSUMPTIONS and PREFIXES_IN_USE section.

9 years agoadjust PREFIXES_IN_USE for SYSCF
nhmall [Sun, 22 Mar 2015 15:11:41 +0000 (11:11 -0400)]
adjust PREFIXES_IN_USE for SYSCF

9 years agooptions and config file handling
nhmall [Sun, 22 Mar 2015 14:44:36 +0000 (10:44 -0400)]
options and config file handling

With SYSCF, the SYSCF_FILE name was overwriting the
default config file name making it unavailable for
subsequent user config file options handling.

- Keep the name of the last config file successfully opened.
- Do it without orphaning the default config file name needed
  for the next pass.

9 years agofix "mysterious force" probabilities in do.c comment
PatR [Sun, 22 Mar 2015 02:24:08 +0000 (19:24 -0700)]
fix "mysterious force" probabilities in do.c comment

Reported by Alex, the probabilites shown in the comment about the effect
of the mysterious force have been wrong ever since they were added 20 or
so years ago.  Lawfuls and neutrals are much more likely to go down just
one level rather than 2 or 3.

9 years agowishing fix for "eyes"
PatR [Sat, 21 Mar 2015 22:36:47 +0000 (15:36 -0700)]
wishing fix for "eyes"

No, not a blindness cure. :-}  Post-3.4.3 revisions to makesingular()
inadvertently made it impossible to successfully wish for "the Eyes
of the Overworld" because the string got changed into "the Eye of the
Overworld" which doesn't match anything.  So don't singularize "eyes".

(After this fix, wishing for "the Eyes of the Aethiopica" no longer
yields the Eye of same, but I think that's the correct behavior.)

9 years agoput mystery line back but !WIN32
nhmall [Sat, 21 Mar 2015 20:17:17 +0000 (16:17 -0400)]
put mystery line back but !WIN32

Since that line of code is used by a lot of different ports, I decided to
recant its removal and just add #ifdef to ensure it isn't compiled on WIN32.

I think other ports might encounter the same issue where the first pass with
filename set to 'sysconf', is then going to overwrite the hard-coded user
config file name, but I can't fix or test those so for those ports, it
will be now be back the way it was.