diff --git a/README b/README index 2597748e0..952199fee 100644 --- a/README +++ b/README @@ -12,7 +12,7 @@ of fixes as they are committed. In short -- there are likely to be bugs. Don't treat NetHack-3.7 branch as released code, and if stability is paramount, then the most recent -NetHack 3.6.4 release is safest for you. +NetHack 3.6.5 release is safest for you. We're making the .0 work-in-progress available so that you can observe, test out, and contribute to its development. Constructive suggestions, GitHub pull diff --git a/dat/history b/dat/history index 9e5979862..5d1943614 100644 --- a/dat/history +++ b/dat/history @@ -226,6 +226,9 @@ fixes to NetHack 3.6.2. NetHack 3.6.4 was released on December 18, 2019 containing a security fix and a few bug fixes. +NetHack 3.6.5 was released on January 27, 2020 containing some security fixes +and a small number of bug fixes. + The official NetHack web site is maintained by Ken Lorber at http://www.nethack.org/. diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn index fdaf540f7..3a8db5a84 100644 --- a/doc/Guidebook.mn +++ b/doc/Guidebook.mn @@ -24,7 +24,7 @@ .ds vr "NetHack 3.7 .ds f0 "\*(vr .ds f1 -.ds f2 "January 7, 2020 +.ds f2 "January 27, 2020 . .\" A note on some special characters: .\" \(lq = left double quote @@ -5242,6 +5242,9 @@ fixes to NetHack 3.6.2. NetHack 3.6.4 was released on December 18, 2019 containing a security fix and a few bug fixes. .pg +NetHack 3.6.5 was released on January 27, 2020 containing some security fixes +and a small number of bug fixes. +.pg The official NetHack web site is maintained by \fBKen Lorber\fP at .UR https://www.nethack.org/ . diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex index 0d3771b6c..6647e521b 100644 --- a/doc/Guidebook.tex +++ b/doc/Guidebook.tex @@ -45,7 +45,7 @@ %.au \author{Original version - Eric S. Raymond\\ (Edited and expanded for 3.6 by Mike Stephenson and others)} -\date{January 7, 2020} +\date{January 27, 2020} \maketitle @@ -5854,6 +5854,11 @@ fixes to NetHack 3.6.2. NetHack 3.6.4 was released on December 18, 2019 containing a security fix and a few bug fixes. +%.pg +\medskip +NetHack 3.6.5 was released on January 27, 2020 containing some security fixes +and a small number of bug fixes. + %.pg \medskip \nd The official {\it NetHack\/} web site is maintained by {\it Ken Lorber} at diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt index 4720b5317..1f76abf2a 100644 --- a/doc/Guidebook.txt +++ b/doc/Guidebook.txt @@ -15,7 +15,7 @@ Original version - Eric S. Raymond (Edited and expanded for 3.6 by Mike Stephenson and others) - December 18, 2019 + January 27, 2020 @@ -126,7 +126,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -192,7 +192,7 @@ you have seen on the current dungeon level; as you explore more - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -258,7 +258,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -324,7 +324,7 @@ Intelligence affects your ability to cast spells and read - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -390,7 +390,7 @@ ical attacks. Many dungeons show only your experience level - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -456,7 +456,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -522,7 +522,7 @@ nasty and vicious. Sometimes, however, they can be helpful. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -588,7 +588,7 @@ symbol at the chosen location, conditionally check for "More - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -654,7 +654,7 @@ if you remember a monster there). - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -720,7 +720,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -786,7 +786,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -852,7 +852,7 @@ once you've closed this menu. The available options are - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -918,7 +918,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -984,7 +984,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1050,7 +1050,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1116,7 +1116,7 @@ (R)UNIX is a registered trademark of The Open Group. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1182,7 +1182,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1248,7 +1248,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1314,7 +1314,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1380,7 +1380,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1446,7 +1446,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1512,7 +1512,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1578,7 +1578,7 @@ When picking a target with cursor and the autodescribe - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1644,7 +1644,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1710,7 +1710,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1776,7 +1776,7 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1826,8 +1826,12 @@ areas are only displayed if they are within one space of you. Walls and corridors remain on the map as you explore them. - Secret corridors are hidden. You can find them with the `s' - (search) command. + Secret corridors are hidden and appear to be solid rock. + You can find them with the `s' (search) command when adjacent to + them. Multiple search attempts may be needed. When searching is + successful, secret corridors become ordinary open corridor loca- + tions. Mapping magic reveals secret corridors, so converts them + into ordinary corridors and shows them as such. 5.1. Doorways @@ -1835,14 +1839,10 @@ doors; you can walk right through. Others have doors in them, which may be open, closed, or locked. To open a closed door, use the `o' (open) command; to close it again, use the `c' (close) - command. - - You can get through a locked door by using a tool to pick - the lock with the `a' (apply) command, or by kicking it open with - the `^D' (kick) command. + command. By default the autoopen option is enabled, so simply - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -1852,17 +1852,48 @@ + attempting to walk onto a closed door's location will attempt to + open it without needing `o'. Opening via autoopen will not work + if you are confused or stunned or suffer from the fumbling at- + tribute. + Open doors cannot be entered diagonally; you must approach them straight on, horizontally or vertically. Doorways without - doors are not restricted in this fashion. + doors are not restricted in this fashion except on one particular + level (described by "#overview" as "a primitive area"). - Doors can be useful for shutting out monsters. Most mon- - sters cannot open doors, although a few don't need to (for exam- - ple, ghosts can walk through doors). + Unlocking magic exists but usually won't be available early + on. You can get through a locked door without magic by first us- + ing an unlocking tool with the `a' (apply) command, and then + opening it. By default the autounlock option is also enabled, so + if you attempt to open (via `o' or autoopen) a locked door while + carrying an unlocking tool, you'll be asked whether to use it on + the door's lock. Alternatively, you can break a closed door + (whether locked or not) down by kicking it via the `^D' (kick) + command. Kicking down a door destroys it and makes a lot of + noise which might wake sleeping monsters. - Secret doors are hidden. You can find them with the `s' - (search) command. Once found they are in all ways equivalent to - normal doors. + Some closed doors are booby-trapped and will explode if an + attempt is made to open (when unlocked) or unlock (when locked) + or kick down. Like kicking, an explosion destroys the door and + makes a lot of noise. The "#untrap" command can be used to + search a door for traps but might take multiple attempts to find + one. When one is found, you'll be asked whether to try to disarm + it. If you accede, success will eliminate the trap but failure + will set off the trap's explosion. (If you decline, you effec- + tively forget that a trap was found there.) + + Closed doors can be useful for shutting out monsters. Most + monsters cannot open closed doors, although a few don't need to + (for example, ghosts can walk through doors and fog clouds can + flow under them). Some monsters who can open doors can also use + unlocking tools. And some (giants) can smash doors. + + Secret doors are hidden and appear to be ordinary wall (from + inside a room) or solid rock (from outside). You can find them + with the `s' (search) command but it might take multiple tries. + Once found they are in all ways equivalent to normal doors. Map- + ping magic does not reveal secret doors. 5.2. Traps (`^') @@ -1874,6 +1905,19 @@ mand. Monsters can fall prey to traps, too, which can be a very useful defensive strategy. + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 30 + + + There is a special pre-mapped branch of the dungeon based on the classic computer game "Sokoban." The goal is to push the boulders into the pits or holes. With careful foresight, it is @@ -1906,18 +1950,6 @@ Ordinarily when you climb a set of stairs, you will arrive on the corresponding staircase at your destination. However, - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 30 - - - pets (see below) and some other monsters will follow along if they're close enough when you travel up or down stairs, and occa- sionally one of these creatures will displace you during the @@ -1940,6 +1972,18 @@ You can sell items to a shopkeeper by dropping them to the floor while inside a shop. You will either be offered an amount + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 31 + + + of gold and asked whether you're willing to sell, or you'll be told that the shopkeeper isn't interested (generally, your item needs to be compatible with the type of merchandise carried by @@ -1971,19 +2015,6 @@ * The price of a given item can vary due to a variety of factors. - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 31 - - - * A shopkeeper treats the spot immediately inside the door as if it were outside the shop. @@ -2007,6 +2038,18 @@ about those monsters who are displayed on the screen. The com- mand "#name" (by default bound to `C'), allows you to assign a name to a monster, which may be useful to help distinguish one + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 32 + + + from another when multiple monsters are present. Assigning a name which is just a space will remove any prior name. @@ -2038,18 +2081,6 @@ monster has moved and you don't wish to fight, you can use the `m' command to move without fighting; likewise, if you don't re- member a monster but want to try fighting anyway, you can use the - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 32 - - - `F' command. 6.2. Your pet @@ -2073,6 +2104,18 @@ and may become wild. Similarly, when you trigger certain types of traps which alter your location (for instance, a trap door which drops you to a lower dungeon level), any adjacent pet will + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 33 + + + accompany you and any non-adjacent pet will be left behind. Your pet may trigger such traps itself; you will not be carried along with it even if adjacent at the time. @@ -2104,18 +2147,6 @@ You may encounter the shades and corpses of other adventur- ers (or even former incarnations of yourself!) and their personal - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 33 - - - effects. Ghosts are hard to kill, but easy to avoid, since they're slow and do little damage. You can plunder the deceased adventurer's possessions; however, they are likely to be cursed. @@ -2139,6 +2170,18 @@ spot where the marker's location ordinarily wouldn't be seen any more. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 34 + + + 7. Objects When you find something in the dungeon, it is common to want @@ -2170,18 +2213,6 @@ When you pick up an object, it is assigned an inventory let- ter. Many commands that operate on objects must ask you to find - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 34 - - - out which object you want to use. When NetHack asks you to choose a particular object you are carrying, you are usually pre- sented with a list of inventory letters to choose from (see Com- @@ -2203,6 +2234,20 @@ specifying a space as the value will remove the prior name in- stead of assigning a new one. + + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 35 + + + 7.1. Curses and Blessings Any object that you find may be cursed, even if the object @@ -2236,18 +2281,6 @@ distinguished in your inventory by the presence of the word "cursed", "uncursed" or "blessed" in the description of the item. In some cases "uncursed" will be omitted as being redundant when - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 35 - - - enough other information is displayed. The implicit_uncursed op- tion can be used to control this; toggle it off to have "un- cursed" be displayed even when that can be deduced from other at- @@ -2269,6 +2302,18 @@ first wield a bow, then throw the arrow. Crossbows shoot cross- bow bolts. Slings hurl rocks and (other) stones (like gems). + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 36 + + + Enchanted weapons have a "plus" (or "to hit enhancement" which can be either positive or negative) that adds to your chance to hit and the damage you do to a monster. The only way @@ -2303,17 +2348,6 @@ mand which allows you to unwield the current weapon in addition to taking off other worn items. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 36 - - - Those of you in the audience who are AD&D players, be aware that each weapon which existed in AD&D does roughly the same dam- age to monsters in NetHack. Some of the more obscure weapons @@ -2334,6 +2368,18 @@ for a specific target. The distance something can be thrown de- pends mainly on the type of object and your strength. Arrows can be thrown by hand, but can be thrown much farther and will be + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 37 + + + more likely to hit when thrown while you are wielding a bow. You can simplify the throwing operation by using the `Q' @@ -2365,21 +2411,6 @@ in the same direction; if the first ones kill a monster, the oth- ers can still continue beyond that spot. - - - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 37 - - - 7.2.2. Weapon proficiency You will have varying degrees of skill in the weapons avail- @@ -2403,6 +2434,18 @@ to advance), "unskilled", "basic", "skilled", and "expert". Re- stricted skills simply will not appear in the list shown by "#en- hance". (Divine intervention might unrestrict a particular + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 38 + + + skill, in which case it will start at unskilled and be limited to basic.) Some characters can enhance their barehanded combat or martial arts skill beyond expert to "master" or "grand master". @@ -2434,18 +2477,6 @@ you stop -- or before you begin, for that matter -- wielding two weapons at once. The primary is your wielded weapon and the sec- ondary is just an item in your inventory that's been designated - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 38 - - - as alternate weapon.) If your primary weapon is wielded but your off hand is empty @@ -2468,8 +2499,20 @@ When in two-weapon combat mode, using the `X' command tog- gles back to single-weapon mode. Throwing or dropping either of - the weapons or having one of them be stolen or destroyed will al- - so make you revert to single-weapon combat. + the weapons or having one of them be stolen or destroyed will + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 39 + + + + also make you revert to single-weapon combat. 7.3. Armor (`[') @@ -2500,18 +2543,6 @@ leather jacket 9 no armor 10 - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 39 - - - You can also wear other pieces of armor (for example hel- mets, boots, shields, cloaks) to lower your armor class even fur- ther, but you can only wear one item of each category (one suit @@ -2535,6 +2566,18 @@ The `A' command can also be used to take off armor as well as other worn items. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 40 + + + 7.4. Food (`%') Food is necessary to survive. If you go too long without @@ -2566,18 +2609,6 @@ or "THANX MAUD" backwards). Scrolls disappear after you read them (except for blank ones, without magic spells on them). - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 40 - - - One of the most useful of these is the scroll of identify, which can be used to determine what another object is, whether it is cursed or blessed, and how many uses it has left. Some ob- @@ -2599,6 +2630,20 @@ The command to read a scroll is `r'. + + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 41 + + + 7.6. Potions (`!') Potions are distinguished by the color of the liquid inside @@ -2632,18 +2677,6 @@ In a truly desperate situation, when your back is up against the wall, you might decide to go for broke and break your wand. - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 41 - - - This is not for the faint of heart. Doing so will almost cer- tainly cause a catastrophic release of magical energies. @@ -2665,6 +2698,18 @@ Putting on a ring activates its magic. You can wear only two rings, one on each ring finger. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 42 + + + Most rings also cause you to grow hungry more rapidly, the rate varying with the type of ring. @@ -2698,18 +2743,6 @@ lar to wands. To cast one at yourself, just give a `.' or `s' for the direction. A few spells require you to pick a target lo- cation rather than just specify a particular direction. Other - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 42 - - - spells don't require any direction or target. Just as weapons are divided into groups in which a character @@ -2732,6 +2765,17 @@ estimate of how strongly it is remembered. The `Z' (cast) com- mand casts a spell. + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 43 + + + 7.10. Tools (`(') Tools are miscellaneous objects with various purposes. Some @@ -2763,19 +2807,6 @@ Like rings, amulets have various magical properties, some benefi- cial, some harmful, which are activated by putting them on. - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 43 - - - Only one amulet may be worn at a time, around your neck. The commands to use amulets are the same as for rings, `P' @@ -2799,6 +2830,18 @@ generally heavy. It is rumored that some statues are not what they seem. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 44 + + + Very large humanoids (giants and their ilk) have been known to use boulders as weapons. @@ -2829,19 +2872,6 @@ then once you see or feel that location again you will re-discov- er the object and resume remembering it. - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 44 - - - The situation is the same for a pile of objects, except that only the top item of the pile is displayed. The hilite_pile op- tion can be enabled in order to show an item differently when it @@ -2865,9 +2895,21 @@ The most difficult of these is the foodless challenge. Although creatures can survive long periods of time without food, there is a physiological need for water; thus there is no restriction on - drinking beverages, even if they provide some minor food bene- - fits. Calling upon your god for help with starvation does not - violate any food challenges either. + drinking beverages, even if they provide some minor food + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 45 + + + + benefits. Calling upon your god for help with starvation does + not violate any food challenges either. A strict vegan diet is one which avoids any food derived from animals. The primary source of nutrition is fruits and veg- @@ -2896,18 +2938,6 @@ corpse. Eating leather, dragon hide, or bone items while poly- morphed into a creature that can digest it, or eating monster brains while polymorphed into a mind flayer, is considered eating - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 45 - - - an animal, although wax is only an animal byproduct. Regardless of conduct, there will be some items which are @@ -2932,6 +2962,18 @@ counted against this conduct. You are also not penalized for be- ing spoken to by an angry god, priest(ess), or other religious figure; a true atheist would hear the words but attach no special + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 46 + + + meaning to them. Most players fight with a wielded weapon (or tool intended @@ -2962,18 +3004,6 @@ may respond with the monster type "none" if you want to decline. You can change the form of an item into another item of the same type ("polypiling") or the form of your own body into another - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 46 - - - creature ("polyself") by wand, spell, or potion of polymorph; avoiding these effects are each considered challenges. Polymor- phing monsters, including pets, does not break either of these @@ -2998,6 +3028,18 @@ a configuration file, or in the NETHACKOPTIONS environment vari- able. Some versions of NetHack also have front-end programs that allow you to set options before starting the game or a global + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 47 + + + configuration for system administrators. 9.2. Using a configuration file @@ -3027,20 +3069,8 @@ Any line beginning with `[' and ending in `]' is considered a section marker. The text between the square brackets is the section name. Lines after a section marker belong to that sec- - tion, and are ignored unless a CHOOSE statement was used to - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 47 - - - - select that section. Section names are case insensitive. + tion, and are ignored unless a CHOOSE statement was used to se- + lect that section. Section names are case insensitive. You can use different configuration statements in the file, some of which can be used multiple times. In general, the state- @@ -3065,6 +3095,17 @@ OPTIONS=dogname:Fido OPTIONS=!legacy,autopickup,pickup_types:$"=/!?+ + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 48 + + + HACKDIR Default location of files NetHack needs. On Windows HACKDIR defaults to the location of the NetHack.exe or NetHackw.exe @@ -3094,18 +3135,6 @@ AUTOCOMPLETE Enable or disable an extended command autocompletion. Autocom- pletion has no effect for the X11 windowport. You can specify - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 48 - - - multiple autocompletions. To enable autocompletion, list the extended command. Prefix the command with "!" to disable the autocompletion for that command. @@ -3132,6 +3161,17 @@ Chooses at random one of the comma-separated parameters as an active section name. Lines in other sections are ignored. + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 49 + + + Example: OPTIONS=color @@ -3161,17 +3201,6 @@ Define the directory that contains the sound files. See the "Configuring User Sounds" section. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 49 - - - SYMBOLS Override one or more symbols in the symbol set used for all dungeon levels except for the special rogue level. See the @@ -3196,6 +3225,19 @@ Here is an example of configuration file contents: + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 50 + + + # Set your character's role, race, gender, and alignment. OPTIONS=role:Valkyrie, race:Human, gender:female, align:lawful # @@ -3225,19 +3267,6 @@ equals sign, and then the value of the string. The value is ter- minated by the next comma or the end of string. - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 50 - - - For example, to set up an environment variable so that color is on, legacy is off, character name is set to "Blue Meanie", and named fruit is set to "lime", you would enter the command @@ -3262,8 +3291,20 @@ can be set to the full name of a configuration file you want to use. If that full name doesn't start with a slash, precede it with `@' (at-sign) to let NetHack know that the rest is intended - as a file name. If it does start with `/', the at-sign is op- - tional. + as a file name. If it does start with `/', the at-sign is + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 51 + + + + optional. 9.4. Customization options @@ -3293,24 +3334,13 @@ get a location on the map (default true). The whatis_coord op- tion controls whether the description includes map coordinates. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 51 - - - autodig Automatically dig if you are wielding a digging tool and moving - into a place that can be dug (default false). Persistent. + into a place that can be dug (default false). Persistent. autoopen - Walking into a door attempts to open it (default true). Persis- - tent. + Walking into a closed door attempts to open it (default true). + Persistent. autopickup Automatically pick up things onto which you move (default on). @@ -3327,40 +3357,10 @@ command instead. If no weapon is found or the option is false, the `t' (throw) command is executed instead. Persistent. - blind - Start the character permanently blind (default false). Persis- - tent. - - bones - Allow saving and loading bones files (default true). Persis- - tent. - - boulder - Set the character used to display boulders (default is the - "large rock" class symbol, ``'). - - catname - Name your starting cat (for example "catname:Morris"). Cannot - be set with the `O' command. - - character - Synonym for "role" to pick the type of your character (for ex- - ample "character:Monk"). See role for more details. - - checkpoint - Save game state after each level change, for possible recovery - after program crash (default on). Persistent. - - checkspace - Check free disk space before writing files to disk (default - on). You may have to turn this off if you have more than 2 GB - free space on the partition used for your save and level files - (because too much space might overflow the calculation and end - up looking like insufficient space). Only applies when MFLOPPY - was defined during compilation. - NetHack 3.7 December 18, 2019 + + NetHack 3.7 January 27, 2020 @@ -3370,26 +3370,76 @@ + autounlock + Walking into a locked door or looting a locked container while + carrying an unlocking tool (such as a key) will ask whether to + use that tool to unlock the door or container (default true). + Persistent. + + blind + Start the character permanently blind (default false). Persis- + tent. + + bones + Allow saving and loading bones files (default true). Persis- + tent. + + boulder + Set the character used to display boulders (default is the + "large rock" class symbol, ``'). + + catname + Name your starting cat (for example "catname:Morris"). Cannot + be set with the `O' command. + + character + Synonym for "role" to pick the type of your character (for ex- + ample "character:Monk"). See role for more details. + + checkpoint + Save game state after each level change, for possible recovery + after program crash (default on). Persistent. + + checkspace + Check free disk space before writing files to disk (default + on). You may have to turn this off if you have more than 2 GB + free space on the partition used for your save and level files + (because too much space might overflow the calculation and end + up looking like insufficient space). Only applies when MFLOPPY + was defined during compilation. + clicklook - Allows looking at things on the screen by navigating the mouse + Allows looking at things on the screen by navigating the mouse over them and clicking the right mouse button (default off). cmdassist - Have the game provide some additional command assistance for - new players if it detects some anticipated mistakes (default + Have the game provide some additional command assistance for + new players if it detects some anticipated mistakes (default on). confirm - Have user confirm attacks on pets, shopkeepers, and other + Have user confirm attacks on pets, shopkeepers, and other peaceable creatures (default on). Persistent. dark_room Show out-of-sight areas of lit rooms (default on). Persistent. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 53 + + + disclose - Controls what information the program reveals when the game - ends. Value is a space separated list of prompting/category - pairs (default is "ni na nv ng nc no", prompt with default re- + Controls what information the program reveals when the game + ends. Value is a space separated list of prompting/category + pairs (default is "ni na nv ng nc no", prompt with default re- sponse of `n' for each candidate). Persistent. The possibili- ties are: @@ -3400,8 +3450,8 @@ c - display your conduct; o - display dungeon overview. - Each disclosure possibility can optionally be preceded by a - prefix which lets you refine how it behaves. Here are the + Each disclosure possibility can optionally be preceded by a + prefix which lets you refine how it behaves. Here are the valid prefixes: y - prompt you and default to yes on the prompt; @@ -3409,40 +3459,29 @@ + - disclose it without prompting; - - do not disclose it and do not prompt. - The listing of vanquished monsters can be sorted, so there are + The listing of vanquished monsters can be sorted, so there are two additional choices for `v': ? - prompt you and default to ask on the prompt; # - disclose it without prompting, ask for sort order. Asking refers to picking one of the orderings from a menu. The - `+' disclose without prompting choice, or being prompted and + `+' disclose without prompting choice, or being prompted and answering `y' rather than `a', will default to showing monsters in the traditional order, from high level to low level. Omitted categories are implicitly added with `n' prefix. Spec- ified categories with omitted prefix implicitly use `+' prefix. - Order of the disclosure categories does not matter, program + Order of the disclosure categories does not matter, program display for end-of-game disclosure follows a set sequence. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 53 - - - - (for example "disclose:yi na +v -g o") The example sets inven- + (for example "disclose:yi na +v -g o") The example sets inven- tory to prompt and default to yes, attributes to prompt and de- fault to no, vanquished to disclose without prompting, genocid- ed to not disclose and not prompt, conduct to implicitly prompt and default to no, and overview to disclose without prompting. - Note that the vanquished monsters list includes all monsters + Note that the vanquished monsters list includes all monsters killed by traps and each other as well as by you. And the dun- geon overview shows all levels you had visited but does not re- veal things about them that you hadn't discovered. @@ -3451,48 +3490,9 @@ Name your starting dog (for example "dogname:Fang"). Cannot be set with the `O' command. - extmenu - Changes the extended commands interface to pop-up a menu of - available commands. It is keystroke compatible with the tradi- - tional interface except that it does not require that you hit - Enter. It is implemented for the tty interface (default off). - - For the X11 interface, which always uses a menu for choosing an - extended command, it controls whether the menu shows all avail- - able commands (on) or just the subset of commands which have - traditionally been considered extended ones (off). - - female - An obsolete synonym for "gender:female". Cannot be set with - the `O' command. - - fixinv - An object's inventory letter sticks to it when it's dropped - (default on). If this is off, dropping an object shifts all - the remaining inventory letters. Persistent. - - force_invmenu - Commands asking for an inventory item show a menu instead of a - text query with possible menu letters. Default is off. - - fruit - Name a fruit after something you enjoy eating (for example - "fruit:mango") (default "slime mold"). Basically a nostalgic - whimsy that NetHack uses from time to time. You should set - this to something you find more appetizing than slime mold. - Apples, oranges, pears, bananas, and melons already exist in - NetHack, so don't use those. - - gender - Your starting gender (gender:male or gender:female). You may - specify just the first letter. Although you can still denote - your gender using the "male" and "female" options, the "gender" - option will take precedence. The default is to randomly pick - an appropriate gender. If you prefix the value with `!' or - "no", you will exclude that gender from being picked randomly. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -3502,63 +3502,63 @@ + extmenu + Changes the extended commands interface to pop-up a menu of + available commands. It is keystroke compatible with the tradi- + tional interface except that it does not require that you hit + Enter. It is implemented for the tty interface (default off). + + For the X11 interface, which always uses a menu for choosing an + extended command, it controls whether the menu shows all avail- + able commands (on) or just the subset of commands which have + traditionally been considered extended ones (off). + + female + An obsolete synonym for "gender:female". Cannot be set with + the `O' command. + + fixinv + An object's inventory letter sticks to it when it's dropped + (default on). If this is off, dropping an object shifts all + the remaining inventory letters. Persistent. + + force_invmenu + Commands asking for an inventory item show a menu instead of a + text query with possible menu letters. Default is off. + + fruit + Name a fruit after something you enjoy eating (for example + "fruit:mango") (default "slime mold"). Basically a nostalgic + whimsy that NetHack uses from time to time. You should set + this to something you find more appetizing than slime mold. + Apples, oranges, pears, bananas, and melons already exist in + NetHack, so don't use those. + + gender + Your starting gender (gender:male or gender:female). You may + specify just the first letter. Although you can still denote + your gender using the "male" and "female" options, the "gender" + option will take precedence. The default is to randomly pick + an appropriate gender. If you prefix the value with `!' or + "no", you will exclude that gender from being picked randomly. Cannot be set with the `O' command. Persistent. goldX - When filtering objects based on bless/curse state (BUCX), - whether to treat gold pieces as X (unknown bless/curse state, - when "on") or U (known to be uncursed, when "off", the de- - fault). Gold is never blessed or cursed, but it is not de- + When filtering objects based on bless/curse state (BUCX), + whether to treat gold pieces as X (unknown bless/curse state, + when "on") or U (known to be uncursed, when "off", the de- + fault). Gold is never blessed or cursed, but it is not de- scribed as "uncursed" even when the implicit_uncursed option is "off". help - If more information is available for an object looked at with + If more information is available for an object looked at with the `/' command, ask if you want to see it (default on). Turn- - ing help off makes just looking at things faster, since you - aren't interrupted with the "More info?" prompt, but it also - means that you might miss some interesting and/or important in- - formation. Persistent. - - herecmd_menu - When using a windowport that supports mouse and clicking on - yourself or next to you, show a menu of possible actions for - the location. Same as "#herecmdmenu" and "#therecmdmenu" com- - mands. - - hilite_pet - Visually distinguish pets from similar animals (default off). - The behavior of this option depends on the type of windowing - you use. In text windowing, text highlighting or inverse video - is often used; with tiles, generally displays a heart symbol - near pets. - - With the curses interface, the petattr option controls how to - highlight pets and setting it will turn the hilite_pet option - on or off as warranted. - - hilite_pile - Visually distinguish piles of objects from individual objects - (default off). The behavior of this option depends on the type - of windowing you use. In text windowing, text highlighting or - inverse video is often used; with tiles, generally displays a - small plus-symbol beside the object on the top of the pile. - - hitpointbar - Show a hit point bar graph behind your name and title. Only - available for TTY and Windows GUI, and only when statushilites - is on. - - horsename - Name your starting horse (for example "horsename:Trigger"). - Cannot be set with the `O' command. - - ignintr - Ignore interrupt signals, including breaks (default off). Per- - sistent. + ing help off makes just looking at things faster, since you + aren't interrupted with the "More info?" prompt, but it also - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -3568,31 +3568,87 @@ + means that you might miss some interesting and/or important in- + formation. Persistent. + + herecmd_menu + When using a windowport that supports mouse and clicking on + yourself or next to you, show a menu of possible actions for + the location. Same as "#herecmdmenu" and "#therecmdmenu" com- + mands. + + hilite_pet + Visually distinguish pets from similar animals (default off). + The behavior of this option depends on the type of windowing + you use. In text windowing, text highlighting or inverse video + is often used; with tiles, generally displays a heart symbol + near pets. + + With the curses interface, the petattr option controls how to + highlight pets and setting it will turn the hilite_pet option + on or off as warranted. + + hilite_pile + Visually distinguish piles of objects from individual objects + (default off). The behavior of this option depends on the type + of windowing you use. In text windowing, text highlighting or + inverse video is often used; with tiles, generally displays a + small plus-symbol beside the object on the top of the pile. + + hitpointbar + Show a hit point bar graph behind your name and title. Only + available for TTY and Windows GUI, and only when statushilites + is on. + + horsename + Name your starting horse (for example "horsename:Trigger"). + Cannot be set with the `O' command. + + ignintr + Ignore interrupt signals, including breaks (default off). Per- + sistent. + implicit_uncursed - Omit "uncursed" from inventory lists, if possible (default on). + Omit "uncursed" from object descriptions when it can be deduced + from other aspects of the description (default on). Persis- + tent. + + If you use menu coloring, you may want to turn this off. legacy Display an introductory message when starting the game (default on). Persistent. lit_corridor - Show corridor squares seen by night vision or a light source + Show corridor squares seen by night vision or a light source held by your character as lit (default off). Persistent. + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 56 + + + lootabc - When using a menu to interact with a container, use the old - `a', `b', and `c' keyboard shortcuts rather than the mnemonics + When using a menu to interact with a container, use the old + `a', `b', and `c' keyboard shortcuts rather than the mnemonics `o', `i', and `b' (default off). Persistent. mail Enable mail delivery during the game (default on). Persistent. male - An obsolete synonym for "gender:male". Cannot be set with the + An obsolete synonym for "gender:male". Cannot be set with the `O' command. mention_walls - Give feedback when walking against a wall (default off). + Give feedback when walking against a wall (default off). Per- + sistent. menucolors Enable coloring menu lines (default off). See "Configuring @@ -3623,17 +3679,6 @@ of a menu. Implemented by the Amiga, Gem and tty ports. De- fault `\'. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 56 - - - menu_first_page Menu character accelerator to jump to the first page in a menu. Implemented by the Amiga, Gem and tty ports. Default `^'. @@ -3643,6 +3688,18 @@ are "none", "bold", "dim", "underline", "blink", or "inverse". Not all ports can actually display all types. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 57 + + + menu_invert_all Menu character accelerator to invert all items in a menu. Im- plemented by the Amiga, Gem, X11 and tty ports. Default `@'. @@ -3688,18 +3745,6 @@ monpolycontrol Prompt for new form whenever any monster changes shape (default - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 57 - - - off). Debug mode only. mouse_support @@ -3710,8 +3755,19 @@ 1 - enabled and make OS adjustments to support mouse use 2 - like 1 but does not make any OS adjustments - Omitting a value is the same as specifying 1 and negating - mouse_support is the same as specifying 0. + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 58 + + + + Omitting a value is the same as specifying 1 and negating + mouse_support is the same as specifying 0. msghistory The number of top line messages to keep (and be able to recall @@ -3755,17 +3811,6 @@ Use digit keys instead of letters to move (default 0 or off). Valid settings are: - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 58 - - - 0 - move by letters; "yuhjklbn" 1 - move by numbers; digit `5' acts as `G' movement prefix 2 - like 1 but `5' works as `g' prefix instead of as `G' @@ -3775,6 +3820,18 @@ For backward compatibility, omitting a value is the same as specifying 1 and negating number_pad is the same as specifying + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 59 + + + 0. (Settings 2 and 4 are for compatibility with MS-DOS or old PC Hack; in addition to the different behavior for `5', `Alt-5' acts as `G' and `Alt-0' acts as `I'. Setting -1 is to accommo- @@ -3820,18 +3877,6 @@ Remove - require selection from inventory for `R' and `T' commands even when wearing just one applicable item. - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 59 - - - all - turn on all of the above. By default, the pray choice is enabled, the others disabled. @@ -3840,6 +3885,19 @@ any of the others, include it in the list, such as "para- noid_confirmation:attack pray Remove". + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 60 + + + perm_invent If true, always display your current inventory in a window. This only makes sense for windowing system interfaces that im- @@ -3887,17 +3945,6 @@ or overLoaded), you will be asked if you want to continue. (Default `S'). Persistent. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 60 - - - pickup_thrown If this option is on and autopickup is also on, try to pick up things that you threw, even if they aren't in pickup_types or @@ -3905,6 +3952,18 @@ pickup_types Specify the object types to be picked up when autopickup is on. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 61 + + + Default is all types. You can use autopickup_exception config- uration file lines to further refine autopickup behavior. Per- sistent. @@ -3953,23 +4012,24 @@ Make the space bar a synonym for the `.' (#wait) command (de- fault off). Persistent. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 61 - - - role Pick your type of character (for example "role:Samurai"); syn- onym for "character". See "name" for an alternate method of specifying your role. Normally only the first letter of the value is examined; `r' is an exception with "Rogue", "Ranger", and "random" values. If you prefix the value with `!' or "no", + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 62 + + + you will exclude that role from being picked randomly. Cannot be set with the `O' command. Persistent. @@ -4018,24 +4078,24 @@ Show your accumulated experience points on bottom line (default off). Persistent. - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 62 - - - showrace Display yourself as the glyph for your race, rather than the glyph for your role (default off). Note that this setting af- fects only the appearance of the display, not the way the game treats you. Persistent. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 63 + + + showscore Show your approximate accumulated score on bottom line (default off). Persistent. @@ -4085,21 +4145,23 @@ screen. Use "symset:default" to explicitly select the default symbols. - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 63 - - - time Show the elapsed game time in turns on bottom line (default off). Persistent. + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 64 + + + timed_delay When pausing momentarily for display effect, such as with ex- plosions and moving objects, use a timer rather than sending @@ -4150,22 +4212,22 @@ through next and previous targets, allows filtering the possi- ble targets. - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 64 - - - n - no filtering [default] v - in view only a - in same area only + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 65 + + + The area-filter tries to be slightly predictive -- if you're standing on a doorway, it will consider the area on the side of the door you were last moving towards. @@ -4216,22 +4278,22 @@ ing to suit your preferences, it will attempt to do so. If it can't it will silently ignore it. You can find out if an option is supported by the window port that you are currently using by - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 65 - - - checking to see if it shows up in the Options list. Some options are dynamic and can be specified during the game with the `O' command. + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 66 + + + align_message Where to align or place the message window (top, bottom, left, or right) @@ -4282,22 +4344,22 @@ font_size_message If NetHack can, it should use this size font for the message - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 66 - - - window. font_size_status If NetHack can, it should use this size font for the status + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 67 + + + window. font_size_text @@ -4347,23 +4409,23 @@ games for the player to choose from at game startup, if it can. Not all ports support this option. - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 67 - - - softkeyboard Display an onscreen keyboard. Handhelds are most likely to support this option. + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 68 + + + splash_screen If NetHack can, it should display an opening splash screen when it starts up (default yes). @@ -4415,21 +4477,21 @@ 1 - on, always show borders 2 - auto, on if display is at least (24+2)x(80+2) (default) - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 68 - - - (The 26x82 size threshold for `2' refers to number of rows and columns of the display. A width of at least 110 columns (80+2+26+2) is needed for align_status set to left or right.) + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 69 + + + windowcolors If NetHack can, it should display windows with the specified foreground/background colors. Windows GUI only. The format is @@ -4480,22 +4542,22 @@ abort the count by typing ESC will leave NetHack waiting for another character to complete the two character sequence. Type a second ESC to finish cancelling such a count. At other - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 69 - - - prompts a single ESC suffices. BIOS Use BIOS calls to update the screen display quickly and to read + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 70 + + + the keyboard (allowing the use of arrow keys to move) on ma- chines with an IBM PC compatible BIOS ROM (default off, OS/2, PC, and ST NetHack only). @@ -4531,90 +4593,28 @@ with vga hardware present) will cause the game to display tiles. Cannot be set with the `O' command. + video_height + Set the VGA mode resolution height (MS-DOS only, with + video:vga) + + video_width + Set the VGA mode resolution width (MS-DOS only, with video:vga) + videocolors - Set the color palette for PC systems using NO_TERMS (default - 4-2-6-1-5-3-15-12-10-14-9-13-11, (PC NetHack only). The order - of colors is red, green, brown, blue, magenta, cyan, - bright.white, bright.red, bright.green, yellow, bright.blue, - bright.magenta, and bright.cyan. Cannot be set with the `O' + Set the color palette for PC systems using NO_TERMS (default + 4-2-6-1-5-3-15-12-10-14-9-13-11, (PC NetHack only). The order + of colors is red, green, brown, blue, magenta, cyan, + bright.white, bright.red, bright.green, yellow, bright.blue, + bright.magenta, and bright.cyan. Cannot be set with the `O' command. videoshades Set the intensity level of the three gray scales available (de- fault dark normal light, PC NetHack only). If the game display - is difficult to read, try adjusting these scales; if this does - not correct the problem, try !color. Cannot be set with the - `O' command. + is difficult to read, try adjusting these scales; if this does - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 70 - - - - 9.7. Regular Expressions - - Regular expressions are normally POSIX extended regular ex- - pressions. It is possible to compile NetHack without regular ex- - pression support on a platform where there is no regular expres- - sion library. While this is not true of any modern platform, if - your NetHack was built this way, patterns are instead glob pat- - terns. This applies to Autopickup exceptions, Message types, Menu - colors, and User sounds. - - 9.8. Configuring Autopickup Exceptions - - You can further refine the behavior of the autopickup option - beyond what is available through the pickup_types option. - - By placing autopickup_exception lines in your configuration - file, you can define patterns to be checked when the game is - about to autopickup something. - - autopickup_exception - Sets an exception to the pickup_types option. The autopick- - up_exception option should be followed by a regular expression - to be used as a pattern to match against the singular form of - the description of an object at your location. - - In addition, some characters are treated specially if they oc- - cur as the first character in the pattern, specifically: - - < - always pickup an object that matches rest of pattern; - > - never pickup an object that matches rest of pattern. - - The autopickup_exception rules are processed in the order in - which they appear in your configuration file, thus allowing a - later rule to override an earlier rule. - - Exceptions can be set with the `O' command, but because they - are not included in your configuration file, they won't be in - effect if you save and then restore your game. autopickup_ex- - ception rules and not saved with the game. - - Here are some examples: - - autopickup_exception="<*arrow" - autopickup_exception=">*corpse" - autopickup_exception=">* cursed*" - - The first example above will result in autopickup of any - type of arrow. The second example results in the exclusion of - any corpse from autopickup. The last example results in the ex- - clusion of items known to be cursed from autopickup. - - - - - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -4624,12 +4624,78 @@ + not correct the problem, try !color. Cannot be set with the + `O' command. + + 9.7. Regular Expressions + + Regular expressions are normally POSIX extended regular ex- + pressions. It is possible to compile NetHack without regular ex- + pression support on a platform where there is no regular expres- + sion library. While this is not true of any modern platform, if + your NetHack was built this way, patterns are instead glob pat- + terns. This applies to Autopickup exceptions, Message types, Menu + colors, and User sounds. + + 9.8. Configuring Autopickup Exceptions + + You can further refine the behavior of the autopickup option + beyond what is available through the pickup_types option. + + By placing autopickup_exception lines in your configuration + file, you can define patterns to be checked when the game is + about to autopickup something. + + autopickup_exception + Sets an exception to the pickup_types option. The autopick- + up_exception option should be followed by a regular expression + to be used as a pattern to match against the singular form of + the description of an object at your location. + + In addition, some characters are treated specially if they oc- + cur as the first character in the pattern, specifically: + + < - always pickup an object that matches rest of pattern; + > - never pickup an object that matches rest of pattern. + + The autopickup_exception rules are processed in the order in + which they appear in your configuration file, thus allowing a + later rule to override an earlier rule. + + Exceptions can be set with the `O' command, but because they + are not included in your configuration file, they won't be in + effect if you save and then restore your game. autopickup_ex- + ception rules and not saved with the game. + + Here are some examples: + + autopickup_exception="<*arrow" + autopickup_exception=">*corpse" + autopickup_exception=">* cursed*" + + The first example above will result in autopickup of any + type of arrow. The second example results in the exclusion of + any corpse from autopickup. The last example results in the ex- + clusion of items known to be cursed from autopickup. + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 72 + + + 9.9. Changing Key Bindings - It is possible to change the default key bindings of some - special commands, menu accelerator keys, and extended commands, - by using BIND stanzas in the configuration file. Format is key, - followed by the command to bind to, separated by a colon. The + It is possible to change the default key bindings of some + special commands, menu accelerator keys, and extended commands, + by using BIND stanzas in the configuration file. Format is key, + followed by the command to bind to, separated by a colon. The key can be a single character ("x"), a control key ("^X", "C-x"), a meta key ("M-x"), or a three-digit decimal ASCII code. @@ -4640,25 +4706,25 @@ BIND=v:loot Extended command keys - You can bind multiple keys to the same extended command. Un- - bind a key by using "nothing" as the extended command to bind - to. You can also bind the "", "", and "" + You can bind multiple keys to the same extended command. Un- + bind a key by using "nothing" as the extended command to bind + to. You can also bind the "", "", and "" keys. Menu accelerator keys - The menu control or accelerator keys can also be rebound via - OPTIONS lines in the configuration file. You cannot bind ob- + The menu control or accelerator keys can also be rebound via + OPTIONS lines in the configuration file. You cannot bind ob- ject symbols into menu accelerators. Special command keys - Below are the special commands you can rebind. Some of them - can be bound to same keys with no problems, others are in the - same "context", and if bound to same keys, only one of those - commands will be available. Special command can only be bound + Below are the special commands you can rebind. Some of them + can be bound to same keys with no problems, others are in the + same "context", and if bound to same keys, only one of those + commands will be available. Special command can only be bound to a single key. count - Prefix key to start a count, to repeat a command this many + Prefix key to start a count, to repeat a command this many times. With number_pad only. Default is `n'. doinv @@ -4668,30 +4734,30 @@ Prefix key to force fight a direction. Default is `F'. fight.numpad - Prefix key to force fight a direction. With number_pad only. + Prefix key to force fight a direction. With number_pad only. Default is `-'. getdir.help - When asked for a direction, the key to show the help. Default + When asked for a direction, the key to show the help. Default is `?'. getdir.self - When asked for a direction, the key to target yourself. De- + When asked for a direction, the key to target yourself. De- fault is `.'. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 72 + NetHack Guidebook 73 getdir.self2 - When asked for a direction, the key to target yourself. De- + When asked for a direction, the key to target yourself. De- fault is `s'. getpos.autodescribe @@ -4703,80 +4769,80 @@ esting thing. Default is `a'. getpos.all.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest interesting thing. Default is `A'. getpos.door.next - When asked for a location, the key to go to next closest door + When asked for a location, the key to go to next closest door or doorway. Default is `d'. getpos.door.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest door or doorway. Default is `D'. getpos.help - When asked for a location, the key to show help. Default is + When asked for a location, the key to show help. Default is `?'. getpos.mon.next - When asked for a location, the key to go to next closest mon- + When asked for a location, the key to go to next closest mon- ster. Default is `m'. getpos.mon.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest monster. Default is `M'. getpos.obj.next - When asked for a location, the key to go to next closest ob- + When asked for a location, the key to go to next closest ob- ject. Default is `o'. getpos.obj.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest object. Default is `O'. getpos.menu - When asked for a location, and using one of the next or previ- - ous keys to cycle through targets, toggle showing a menu in- + When asked for a location, and using one of the next or previ- + ous keys to cycle through targets, toggle showing a menu in- stead. Default is `!'. getpos.moveskip - When asked for a location, and using the shifted movement keys - or meta-digit keys to fast-move around, move by skipping the + When asked for a location, and using the shifted movement keys + or meta-digit keys to fast-move around, move by skipping the same glyphs instead of by 8 units. Default is `*'. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 73 + NetHack Guidebook 74 getpos.filter When asked for a location, change the filtering mode when using - one of the next or previous keys to cycle through targets. - Toggles between no filtering, in view only, and in the same + one of the next or previous keys to cycle through targets. + Toggles between no filtering, in view only, and in the same area only. Default is `"'. getpos.pick - When asked for a location, the key to choose the location, and + When asked for a location, the key to choose the location, and possibly ask for more info. Default is `.'. getpos.pick.once - When asked for a location, the key to choose the location, and + When asked for a location, the key to choose the location, and skip asking for more info. Default is `,'. getpos.pick.quick When asked for a location, the key to choose the location, skip - asking for more info, and exit the location asking loop. De- + asking for more info, and exit the location asking loop. De- fault is `;'. getpos.pick.verbose - When asked for a location, the key to choose the location, and + When asked for a location, the key to choose the location, and show more info without asking. Default is `:'. getpos.self @@ -4784,23 +4850,23 @@ fault is `@'. getpos.unexplored.next - When asked for a location, the key to go to next closest unex- + When asked for a location, the key to go to next closest unex- plored location. Default is `x'. getpos.unexplored.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest unexplored location. Default is `X'. getpos.valid - When asked for a location, the key to go to show valid target + When asked for a location, the key to go to show valid target locations. Default is `$'. getpos.valid.next - When asked for a location, the key to go to next closest valid + When asked for a location, the key to go to next closest valid location. Default is `z'. getpos.valid.prev - When asked for a location, the key to go to previous closest + When asked for a location, the key to go to previous closest valid location. Default is `Z'. nopickup @@ -4812,18 +4878,18 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 74 + NetHack Guidebook 75 redraw.numpad - Key to redraw the screen. With number_pad only. Default is + Key to redraw the screen. With number_pad only. Default is `^L'. repeat @@ -4836,11 +4902,11 @@ Prefix key to run towards a direction. Default is `G'. run.nopickup - Prefix key to run towards a direction without picking up items + Prefix key to run towards a direction without picking up items on the way. Default is `M'. run.numpad - Prefix key to run towards a direction. With number_pad only. + Prefix key to run towards a direction. With number_pad only. Default is `5'. rush @@ -4851,7 +4917,7 @@ You can change the way the messages are shown in the message area, when the message matches a user-defined pattern. - In general, the configuration file entries to describe the + In general, the configuration file entries to describe the message types look like this: MSGTYPE=type "pattern" type - how the message should be shown; @@ -4864,87 +4930,21 @@ show - show message normally; hide - never show the message; stop - wait for user with more-prompt; - norep - show the message once, but not again if no other mes- + norep - show the message once, but not again if no other mes- sage is shown in between. - Here's an example of message types using NetHack's internal + Here's an example of message types using NetHack's internal pattern matching facility: MSGTYPE=stop "You feel hungry." MSGTYPE=hide "You displaced *." - specifies that whenever a message "You feel hungry" is shown, - the user is prompted with more-prompt, and a message matching + specifies that whenever a message "You feel hungry" is shown, + the user is prompted with more-prompt, and a message matching "You displaced ." is not shown at all. - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 75 - - - - The order of the defined MSGTYPE lines is important; the last - matching rule is used. Put the general case first, exceptions - below them. - - 9.11. Configuring Menu Colors - - Some platforms allow you to define colors used in menu lines - when the line matches a user-defined pattern. At this time the - tty, curses, win32tty and win32gui interfaces support this. - - In general, the configuration file entries to describe the - menu color mappings look like this: - - MENUCOLOR="pattern"=color&attribute - - pattern - the pattern to match; - color - the color to use for lines matching the pat- - tern; - attribute - the attribute to use for lines matching the - pattern. The attribute is optional, and if - left out, you must also leave out the preced- - ing ampersand. If no attribute is defined, - no attribute is used. - - The pattern should be a regular expression. - - Allowed colors are black, red, green, brown, blue, magenta, - cyan, gray, orange, light-green, yellow, light-blue, light-ma- - genta, light-cyan, and white. And no-color, the default fore- - ground color, which isn't necessarily the same as any of the - other colors. - - Allowed attributes are none, bold, dim, underline, blink, and - inverse. "Normal" is a synonym for "none". Note that the - platform used may interpret the attributes any way it wants. - - Here's an example of menu colors using NetHack's internal pat- - tern matching facility: - - MENUCOLOR="* blessed *"=green - MENUCOLOR="* cursed *"=red - MENUCOLOR="* cursed *(being worn)"=red&underline - - specifies that any menu line with " blessed " contained in it - will be shown in green color, lines with " cursed " will be - shown in red, and lines with " cursed " followed by "(being - worn)" on the same line will be shown in red color and under- - lined. You can have multiple MENUCOLOR entries in your config- - uration file, and the last MENUCOLOR line that matches a menu - line will be used for the line. - - Note that if you intend to have one or more color specifica- - tions match " uncursed ", you will probably want to turn the im- - plicit_uncursed option off so that all items known to be uncursed - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -4954,27 +4954,93 @@ + The order of the defined MSGTYPE lines is important; the last + matching rule is used. Put the general case first, exceptions + below them. + + 9.11. Configuring Menu Colors + + Some platforms allow you to define colors used in menu lines + when the line matches a user-defined pattern. At this time the + tty, curses, win32tty and win32gui interfaces support this. + + In general, the configuration file entries to describe the + menu color mappings look like this: + + MENUCOLOR="pattern"=color&attribute + + pattern - the pattern to match; + color - the color to use for lines matching the pat- + tern; + attribute - the attribute to use for lines matching the + pattern. The attribute is optional, and if + left out, you must also leave out the preced- + ing ampersand. If no attribute is defined, + no attribute is used. + + The pattern should be a regular expression. + + Allowed colors are black, red, green, brown, blue, magenta, + cyan, gray, orange, light-green, yellow, light-blue, light-ma- + genta, light-cyan, and white. And no-color, the default fore- + ground color, which isn't necessarily the same as any of the + other colors. + + Allowed attributes are none, bold, dim, underline, blink, and + inverse. "Normal" is a synonym for "none". Note that the + platform used may interpret the attributes any way it wants. + + Here's an example of menu colors using NetHack's internal pat- + tern matching facility: + + MENUCOLOR="* blessed *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* cursed *(being worn)"=red&underline + + specifies that any menu line with " blessed " contained in it + will be shown in green color, lines with " cursed " will be + shown in red, and lines with " cursed " followed by "(being + worn)" on the same line will be shown in red color and under- + lined. You can have multiple MENUCOLOR entries in your config- + uration file, and the last MENUCOLOR line that matches a menu + line will be used for the line. + + Note that if you intend to have one or more color specifica- + tions match " uncursed ", you will probably want to turn the im- + plicit_uncursed option off so that all items known to be uncursed + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 77 + + + are actually displayed with the "uncursed" description. 9.12. Configuring User Sounds - Some platforms allow you to define sound files to be played - when a message that matches a user-defined pattern is delivered + Some platforms allow you to define sound files to be played + when a message that matches a user-defined pattern is delivered to the message window. At this time the Qt port and the win32tty and win32gui ports support the use of user sounds. - The following configuration file entries are relevant to + The following configuration file entries are relevant to mapping user sounds to messages: SOUNDDIR The directory that houses the sound files to be played. SOUND - An entry that maps a sound file to a user-specified message - pattern. Each SOUND entry is broken down into the following + An entry that maps a sound file to a user-specified message + pattern. Each SOUND entry is broken down into the following parts: - MESG - message window mapping (the only one supported in + MESG - message window mapping (the only one supported in 3.6); pattern - the pattern to match; sound file - the sound file to play; @@ -4985,7 +5051,7 @@ 9.13. Configuring Status Hilites Your copy of NetHack may have been compiled with support for - "Status Hilites". If so, you can customize your game display by + "Status Hilites". If so, you can customize your game display by setting thresholds to change the color or appearance of fields in the status display. @@ -4993,8 +5059,8 @@ OPTION=hilite_status:field-name/behavior/color&attributes - For example, the following line in your configuration file - will cause the hitpoints field to display in the color red if + For example, the following line in your configuration file + will cause the hitpoints field to display in the color red if your hitpoints drop to or below a threshold of 30%: OPTION=hilite_status:hitpoints/<=30%/red/normal @@ -5002,50 +5068,50 @@ (That example is actually specifying red&normal for <=30% and no- color&normal for >30%.) - For another example, the following line in your configura- - tion file will cause wisdom to be displayed red if it drops and + For another example, the following line in your configura- + tion file will cause wisdom to be displayed red if it drops and green if it rises: OPTION=hilite_status:wisdom/down/red/up/green - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 77 + NetHack Guidebook 78 - Allowed colors are black, red, green, brown, blue, magenta, + Allowed colors are black, red, green, brown, blue, magenta, cyan, gray, orange, light-green, yellow, light-blue, light-magen- - ta, light-cyan, and white. And "no-color", the default fore- + ta, light-cyan, and white. And "no-color", the default fore- ground color on the display, which is not necessarily the same as black or white or any of the other colors. - Allowed attributes are none, bold, dim, underline, blink, - and inverse. "Normal" is a synonym for "none"; they should not + Allowed attributes are none, bold, dim, underline, blink, + and inverse. "Normal" is a synonym for "none"; they should not be used in combination with any of the other attributes. To specify both a color and an attribute, use `&' to combine - them. To specify multiple attributes, use `+' to combine those. + them. To specify multiple attributes, use `+' to combine those. For example: "magenta&inverse+dim". - Note that the display may substitute or ignore particular - attributes depending upon its capabilities, and in general may - interpret the attributes any way it wants. For example, on some + Note that the display may substitute or ignore particular + attributes depending upon its capabilities, and in general may + interpret the attributes any way it wants. For example, on some display systems a request for bold might yield blink or vice ver- sa. On others, issuing an attribute request while another is al- - ready set up will replace the earlier attribute rather than com- - bine with it. Since NetHack issues attribute requests sequen- + ready set up will replace the earlier attribute rather than com- + bine with it. Since NetHack issues attribute requests sequen- tially (at least with the tty interface) rather than all at once, the only way a situation like that can be controlled is to speci- fy just one attribute. - You can adjust the appearance of the following status + You can adjust the appearance of the following status fields: title dungeon-level experience-level strength gold experience @@ -5056,16 +5122,16 @@ charisma armor-class condition alignment score - The pseudo-field "characteristics" can be used to set all six - of Str, Dex, Con, Int, Wis, and Cha at once. "HD" is "hit - dice", an approximation of experience level displayed when - polymorphed. "experience", "time", and "score" are condition- + The pseudo-field "characteristics" can be used to set all six + of Str, Dex, Con, Int, Wis, and Cha at once. "HD" is "hit + dice", an approximation of experience level displayed when + polymorphed. "experience", "time", and "score" are condition- ally displayed depending upon your other option settings. - Instead of a behavior, "condition" takes the following condi- - tion flags: stone, slime, strngl, foodpois, termill, blind, - deaf, stun, conf, hallu, lev, fly, and ride. You can use "ma- - jor_troubles" as an alias for stone through termill, "mi- + Instead of a behavior, "condition" takes the following condi- + tion flags: stone, slime, strngl, foodpois, termill, blind, + deaf, stun, conf, hallu, lev, fly, and ride. You can use "ma- + jor_troubles" as an alias for stone through termill, "mi- nor_troubles" for blind through hallu, "movement" for lev, fly, and ride, and "all" for every condition. @@ -5076,73 +5142,7 @@ - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 78 - - - - * "up", "down" set the field attributes for when the field - value changes upwards or downwards. This attribute times - out after statushilites turns. - - * "changed" sets the field attribute for when the field val- - ue changes. This attribute times out after statushilites - turns. (If a field has both a "changed" rule and an "up" - or "down" rule which matches a change in the field's val- - ue, the "up" or "down" one takes precedence.) - - * percentage sets the field attribute when the field value - matches the percentage. It is specified as a number be- - tween 0 and 100, followed by `%' (percent sign). If the - percentage is prefixed with `<=' or `>=', it also matches - when value is below or above the percentage. Use prefix - `<' or `>' to match when strictly below or above. (The - numeric limit is relaxed slightly for those: >-1% and - <101% are allowed.) Only four fields support percentage - rules. Percentages for "hitpoints" and "power" are - straightforward; they're based on the corresponding maxi- - mum field. Percentage highlight rules are also allowed - for "experience level" and "experience points" (valid when - the showexp option is enabled). For those, the percentage - is based on the progress from the start of the current ex- - perience level to the start of the next level. So if lev- - el 2 starts at 20 points and level 3 starts at 40 points, - having 30 points is 50% and 35 points is 75%. 100% is - unattainable for experience because you'll gain a level - and the calculations will be reset for that new level, but - a rule for =100% is allowed and matches the special case - of being exactly 1 experience point short of the next lev- - el. - - * absolute value sets the attribute when the field value - matches that number. The number must be 0 or higher, ex- - cept for "armor-class' which allows negative values, and - may optionally be preceded by `='. If the number is pre- - ceded by `<=' or `>=' instead, it also matches when value - is below or above. If the prefix is `<' or `>', only - match when strictly above or below. - - * text match sets the attribute when the field value matches - the text. Text matches can only be used for "alignment", - "carrying-capacity", "hunger", "dungeon-level", and "ti- - tle". For title, only the role's rank title is tested; - the character's name is ignored. - - The in-game options menu can help you determine the correct - syntax for a configuration file. - - The whole feature can be disabled by setting option sta- - tushilites to 0. - - - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5152,6 +5152,72 @@ + * "up", "down" set the field attributes for when the field + value changes upwards or downwards. This attribute times + out after statushilites turns. + + * "changed" sets the field attribute for when the field val- + ue changes. This attribute times out after statushilites + turns. (If a field has both a "changed" rule and an "up" + or "down" rule which matches a change in the field's val- + ue, the "up" or "down" one takes precedence.) + + * percentage sets the field attribute when the field value + matches the percentage. It is specified as a number be- + tween 0 and 100, followed by `%' (percent sign). If the + percentage is prefixed with `<=' or `>=', it also matches + when value is below or above the percentage. Use prefix + `<' or `>' to match when strictly below or above. (The + numeric limit is relaxed slightly for those: >-1% and + <101% are allowed.) Only four fields support percentage + rules. Percentages for "hitpoints" and "power" are + straightforward; they're based on the corresponding maxi- + mum field. Percentage highlight rules are also allowed + for "experience level" and "experience points" (valid when + the showexp option is enabled). For those, the percentage + is based on the progress from the start of the current ex- + perience level to the start of the next level. So if lev- + el 2 starts at 20 points and level 3 starts at 40 points, + having 30 points is 50% and 35 points is 75%. 100% is + unattainable for experience because you'll gain a level + and the calculations will be reset for that new level, but + a rule for =100% is allowed and matches the special case + of being exactly 1 experience point short of the next lev- + el. + + * absolute value sets the attribute when the field value + matches that number. The number must be 0 or higher, ex- + cept for "armor-class' which allows negative values, and + may optionally be preceded by `='. If the number is pre- + ceded by `<=' or `>=' instead, it also matches when value + is below or above. If the prefix is `<' or `>', only + match when strictly above or below. + + * text match sets the attribute when the field value matches + the text. Text matches can only be used for "alignment", + "carrying-capacity", "hunger", "dungeon-level", and "ti- + tle". For title, only the role's rank title is tested; + the character's name is ignored. + + The in-game options menu can help you determine the correct + syntax for a configuration file. + + The whole feature can be disabled by setting option sta- + tushilites to 0. + + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 80 + + + Example hilites: OPTION=hilite_status: gold/up/yellow/down/brown @@ -5169,23 +5235,23 @@ NetHack can load entire symbol sets from the symbol file. - The options that are used to select a particular symbol set + The options that are used to select a particular symbol set from the symbol file are: symset Set the name of the symbol set that you want to load. roguesymset - Set the name of the symbol set that you want to load for dis- + Set the name of the symbol set that you want to load for dis- play on the rogue level. - You can also override one or more symbols using the SYMBOLS - and ROGUESYMBOLS configuration file options. Symbols are speci- + You can also override one or more symbols using the SYMBOLS + and ROGUESYMBOLS configuration file options. Symbols are speci- fied as name:value pairs. Note that NetHack escape-processes the - value string in conventional C fashion. This means that \ is a - prefix to take the following character literally. Thus \ needs - to be represented as \\. The special prefix form \m switches on - the meta bit in the symbol value, and the ^ prefix causes the + value string in conventional C fashion. This means that \ is a + prefix to take the following character literally. Thus \ needs + to be represented as \\. The special prefix form \m switches on + the meta bit in the symbol value, and the ^ prefix causes the following character to be treated as a control character. NetHack Symbols @@ -5208,13 +5274,13 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 80 + NetHack Guidebook 81 @@ -5274,13 +5340,13 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 81 + NetHack Guidebook 82 @@ -5340,13 +5406,13 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 82 + NetHack Guidebook 83 @@ -5406,13 +5472,13 @@ - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 - NetHack Guidebook 83 + NetHack Guidebook 84 @@ -5424,121 +5490,55 @@ Notes: * Several symbols in this table appear to be blank. They are the - space character, except for S_pet_override and S_hero_override - which don't have any default value and can only be used if en- + space character, except for S_pet_override and S_hero_override + which don't have any default value and can only be used if en- abled in the "sysconf" file. - * S_rock is misleadingly named; rocks and stones use S_gem. - Statues and boulders are the rock being referred to, but since - version 3.6.0, statues are displayed as the monster they de- - pict. So S_rock is only used for boulders and not used at all + * S_rock is misleadingly named; rocks and stones use S_gem. + Statues and boulders are the rock being referred to, but since + version 3.6.0, statues are displayed as the monster they de- + pict. So S_rock is only used for boulders and not used at all if overridden by the more specific S_boulder. 9.15. Configuring NetHack for Play by the Blind - NetHack can be set up to use only standard ASCII characters - for making maps of the dungeons. This makes the MS-DOS versions - of NetHack completely accessible to the blind who use speech - and/or Braille access technologies. Players will require a good - working knowledge of their screen-reader's review features, and - will have to know how to navigate horizontally and vertically - character by character. They will also find the search capabili- - ties of their screen-readers to be quite valuable. Be certain to - examine this Guidebook before playing so you have an idea what - the screen layout is like. You'll also need to be able to locate - the PC cursor. It is always where your character is located. - Merely searching for an @-sign will not always find your charac- + NetHack can be set up to use only standard ASCII characters + for making maps of the dungeons. This makes the MS-DOS versions + of NetHack completely accessible to the blind who use speech + and/or Braille access technologies. Players will require a good + working knowledge of their screen-reader's review features, and + will have to know how to navigate horizontally and vertically + character by character. They will also find the search capabili- + ties of their screen-readers to be quite valuable. Be certain to + examine this Guidebook before playing so you have an idea what + the screen layout is like. You'll also need to be able to locate + the PC cursor. It is always where your character is located. + Merely searching for an @-sign will not always find your charac- ter since there are other humanoids represented by the same sign. - Your screen-reader should also have a function which gives you - the row and column of your review cursor and the PC cursor. - These co-ordinates are often useful in giving players a better + Your screen-reader should also have a function which gives you + the row and column of your review cursor and the PC cursor. + These co-ordinates are often useful in giving players a better sense of the overall location of items on the screen. - NetHack can also be compiled with support for sending the - game messages to an external program, such as a text-to-speech - synthesizer. If the "#version" extended command shows "external - program as a message handler", your NetHack has been compiled + NetHack can also be compiled with support for sending the + game messages to an external program, such as a text-to-speech + synthesizer. If the "#version" extended command shows "external + program as a message handler", your NetHack has been compiled with the capability. When compiling NetHack from source on Linux - and other POSIX systems, define MSGHANDLER to enable it. To use - the capability, set the environment variable NETHACK_MSGHANDLER + and other POSIX systems, define MSGHANDLER to enable it. To use + the capability, set the environment variable NETHACK_MSGHANDLER to an executable, which will be executed with the game message as the program's only parameter. - While it is not difficult for experienced users to edit the - defaults.nh file to accomplish this, novices may find this task + While it is not difficult for experienced users to edit the + defaults.nh file to accomplish this, novices may find this task somewhat daunting. Included within the "symbols" file of all of- ficial distributions of NetHack is a symset called NHAccess. Se- - lecting that symset in your configuration file will cause the - game to run in a manner accessible to the blind. After you have + lecting that symset in your configuration file will cause the + game to run in a manner accessible to the blind. After you have - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 84 - - - - gained some experience with the game and with editing files, you - may want to alter settings via SYMBOLS= and ROGUESYMBOLS= in your - configuration file to better suit your preferences. See the pre- - vious section for the special symbols S_pet_override to force a - consistent symbol for all pets and S_hero_override to force a - unique symbol for the player character if accessibility is en- - abled in the sysconf file. - - The most crucial settings to make the game more accessible - are: - - symset:NHAccess - Load a symbol set appropriate for use by blind players. - - roguesymset:NHAccess - Load a symbol set for the rogue level that is appropriate for - use by blind players. - - menustyle:traditional - This will assist in the interface to speech synthesizers. - - nomenu_overlay - Show menus on a cleared screen and aligned to the left edge. - - number_pad - A lot of speech access programs use the number-pad to review - the screen. If this is the case, disable the number_pad option - and use the traditional Rogue-like commands. - - autodescribe - Automatically describe the terrain under the cursor when tar- - geting. - - mention_walls - Give feedback messages when walking towards a wall or when - travel command was interrupted. - - whatis_coord:compass - When targeting with cursor, describe the cursor position with - coordinates relative to your character. - - whatis_filter:area - When targeting with cursor, filter possible locations so only - those in the same area (eg. same room, or same corridor) are - considered. - - whatis_moveskip - When targeting with cursor and using fast-move, skip the same - glyphs instead of moving 8 units at a time. - - nostatus_updates - Prevent updates to the status lines at the bottom of the - screen, if your screen-reader reads those lines. The same in- - formation can be seen via the "#attributes" command. - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5548,63 +5548,63 @@ - 9.16. Global Configuration for System Administrators + gained some experience with the game and with editing files, you + may want to alter settings via SYMBOLS= and ROGUESYMBOLS= in your + configuration file to better suit your preferences. See the pre- + vious section for the special symbols S_pet_override to force a + consistent symbol for all pets and S_hero_override to force a + unique symbol for the player character if accessibility is en- + abled in the sysconf file. - If NetHack is compiled with the SYSCF option, a system ad- - ministrator should set up a global configuration; this is a file - in the same format as the traditional per-user configuration file - (see above). This file should be named sysconf and placed in the - same directory as the other NetHack support files. The options - recognized in this file are listed below. Any option not set us- - es a compiled-in default (which may not be appropriate for your - system). + The most crucial settings to make the game more accessible + are: - WIZARDS = A space-separated list of user names who are allowed - to play in debug mode (commonly referred to as wizard mode). A - value of a single asterisk (*) allows anyone to start a game in - debug mode. + symset:NHAccess + Load a symbol set appropriate for use by blind players. - SHELLERS = A list of users who are allowed to use the shell es- - cape command (!). The syntax is the same as WIZARDS. + roguesymset:NHAccess + Load a symbol set for the rogue level that is appropriate for + use by blind players. - EXPLORERS = A list of users who are allowed to use the explore - mode. The syntax is the same as WIZARDS. + menustyle:traditional + This will assist in the interface to speech synthesizers. - MAXPLAYERS = Limit the maximum number of games that can be run- - ning at the same time. + nomenu_overlay + Show menus on a cleared screen and aligned to the left edge. - SAVEFORMAT = A list of up to two save file formats separated by - space. The first format in the list will written as well as - read. The second format will be read only if no save file in - the first format exists. Valid choices are "historical" for - binary writing of entire structs, "lendian" for binary writing - of each field in little-endian order, "ascii" for writing the - save file content in ascii text. + number_pad + A lot of speech access programs use the number-pad to review + the screen. If this is the case, disable the number_pad option + and use the traditional Rogue-like commands. - BONESFORMAT = A list of up to two bones file formats separated - by space. The first format in the list will written as well as - read. The second format will be read only if no bones files in - the first format exist. Valid choices are "historical" for bi- - nary writing of entire structs, "lendian" for binary writing of - each field in little-endian order, "ascii" for writing the - bones file content in ascii text. + autodescribe + Automatically describe the terrain under the cursor when tar- + geting. - SUPPORT = A string explaining how to get local support (no de- - fault value). + mention_walls + Give feedback messages when walking towards a wall or when + travel command was interrupted. - RECOVER = A string explaining how to recover a game on this - system (no default value). + whatis_coord:compass + When targeting with cursor, describe the cursor position with + coordinates relative to your character. - SEDUCE = 0 or 1 to disable or enable, respectively, the SEDUCE - option. When disabled, incubi and succubi behave like nymphs. + whatis_filter:area + When targeting with cursor, filter possible locations so only + those in the same area (eg. same room, or same corridor) are + considered. - CHECK_PLNAME = Setting this to 1 will make the EXPLORERS, WIZ- - ARDS, and SHELLERS check for the player name instead of the us- - er's login name. + whatis_moveskip + When targeting with cursor and using fast-move, skip the same + glyphs instead of moving 8 units at a time. + + nostatus_updates + Prevent updates to the status lines at the bottom of the + screen, if your screen-reader reads those lines. The same in- + formation can be seen via the "#attributes" command. - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5614,9 +5614,75 @@ + 9.16. Global Configuration for System Administrators + + If NetHack is compiled with the SYSCF option, a system ad- + ministrator should set up a global configuration; this is a file + in the same format as the traditional per-user configuration file + (see above). This file should be named sysconf and placed in the + same directory as the other NetHack support files. The options + recognized in this file are listed below. Any option not set us- + es a compiled-in default (which may not be appropriate for your + system). + + WIZARDS = A space-separated list of user names who are allowed + to play in debug mode (commonly referred to as wizard mode). A + value of a single asterisk (*) allows anyone to start a game in + debug mode. + + SHELLERS = A list of users who are allowed to use the shell es- + cape command (!). The syntax is the same as WIZARDS. + + EXPLORERS = A list of users who are allowed to use the explore + mode. The syntax is the same as WIZARDS. + + MAXPLAYERS = Limit the maximum number of games that can be run- + ning at the same time. + + SAVEFORMAT = A list of up to two save file formats separated by + space. The first format in the list will written as well as + read. The second format will be read only if no save file in + the first format exists. Valid choices are "historical" for + binary writing of entire structs, "lendian" for binary writing + of each field in little-endian order, "ascii" for writing the + save file content in ascii text. + + BONESFORMAT = A list of up to two bones file formats separated + by space. The first format in the list will written as well as + read. The second format will be read only if no bones files in + the first format exist. Valid choices are "historical" for bi- + nary writing of entire structs, "lendian" for binary writing of + each field in little-endian order, "ascii" for writing the + bones file content in ascii text. + + SUPPORT = A string explaining how to get local support (no de- + fault value). + + RECOVER = A string explaining how to recover a game on this + system (no default value). + + SEDUCE = 0 or 1 to disable or enable, respectively, the SEDUCE + option. When disabled, incubi and succubi behave like nymphs. + + CHECK_PLNAME = Setting this to 1 will make the EXPLORERS, WIZ- + ARDS, and SHELLERS check for the player name instead of the us- + er's login name. + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 87 + + + CHECK_SAVE_UID = 0 or 1 to disable or enable, respectively, the - UID (used identification number) checking for save files (to - verify that the user who is restoring is the same one who + UID (used identification number) checking for save files (to + verify that the user who is restoring is the same one who saved). The following options affect the score file: @@ -5625,26 +5691,26 @@ ENTRYMAX = Maximum number of entries in the score file. - POINTSMIN = Minimum number of points to get an entry in the + POINTSMIN = Minimum number of points to get an entry in the score file. - PERS_IS_UID = 0 or 1 to use user names or numeric userids, re- + PERS_IS_UID = 0 or 1 to use user names or numeric userids, re- spectively, to identify unique people for the score file. - MAX_STATUENAME_RANK = Maximum number of score file entries to + MAX_STATUENAME_RANK = Maximum number of score file entries to use for random statue names (default is 10). - ACCESSIBILITY = 0 or 1 to disable or enable, respectively, the - ability for players to set S_pet_override and S_hero_override + ACCESSIBILITY = 0 or 1 to disable or enable, respectively, the + ability for players to set S_pet_override and S_hero_override symbols in their configuration file. - PORTABLE_DEVICE_PATHS = 0 or 1 Windows OS only, the game will - look for all of its external files, and write to all of its - output files in one place rather than at the standard loca- + PORTABLE_DEVICE_PATHS = 0 or 1 Windows OS only, the game will + look for all of its external files, and write to all of its + output files in one place rather than at the standard loca- tions. DUMPLOGFILE = A filename where the end-of-game dumplog is - saved. Not defining this will prevent dumplog from being cre- + saved. Not defining this will prevent dumplog from being cre- ated. Only available if your game is compiled with DUMPLOG. Al- lows the following placeholders: @@ -5660,83 +5726,17 @@ 10. Scoring - NetHack maintains a list of the top scores or scorers on + NetHack maintains a list of the top scores or scorers on your machine, depending on how it is set up. In the latter case, - each account on the machine can post only one non-winning score - on this list. If you score higher than someone else on this - list, or better your previous score, you will be inserted in the - proper place under your current name. How many scores are kept + each account on the machine can post only one non-winning score + on this list. If you score higher than someone else on this + list, or better your previous score, you will be inserted in the + proper place under your current name. How many scores are kept can also be set up when NetHack is compiled. - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 87 - - - - Your score is chiefly based upon how much experience you - gained, how much loot you accumulated, how deep you explored, and - how the game ended. If you quit the game, you escape with all of - your gold intact. If, however, you get killed in the Mazes of - Menace, the guild will only hear about 90% of your gold when your - corpse is discovered (adventurers have been known to collect - finder's fees). So, consider whether you want to take one last - hit at that monster and possibly live, or quit and stop with - whatever you have. If you quit, you keep all your gold, but if - you swing and live, you might find more. - - If you just want to see what the current top players/games - list is, you can type nethack -s all on most versions. - - 11. Explore mode - - NetHack is an intricate and difficult game. Novices might - falter in fear, aware of their ignorance of the means to survive. - Well, fear not. Your dungeon comes equipped with an "explore" or - "discovery" mode that enables you to keep old save files and - cheat death, at the paltry cost of not getting on the high score - list. - - There are two ways of enabling explore mode. One is to - start the game with the -X command-line switch or with the play- - mode:explore option. The other is to issue the "#exploremode" - extended command while already playing the game. Starting a new - game in explore mode provides your character with a wand of wish- - ing in initial inventory; switching during play does not. The - other benefits of explore mode are left for the trepid reader to - discover. - - 11.1. Debug mode - - Debug mode, also known as wizard mode, is undocumented aside - from this brief description and the various "debug mode only" - commands listed among the command descriptions. It is intended - for tracking down problems within the program rather than to pro- - vide god-like powers to your character, and players who attempt - debugging are expected to figure out how to use it themselves. - It is initiated by starting the game with the -D command-line - switch or with the playmode:debug option. - - For some systems, the player must be logged in under a par- - ticular user name to be allowed to use debug mode; for others, - the hero must be given a particular character name (but may be - any role; there's no connection between "wizard mode" and the - Wizard role). Attempting to start a game in debug mode when not - allowed or not available will result in falling back to explore - mode instead. - - - - - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5746,63 +5746,63 @@ - 12. Credits + Your score is chiefly based upon how much experience you + gained, how much loot you accumulated, how deep you explored, and + how the game ended. If you quit the game, you escape with all of + your gold intact. If, however, you get killed in the Mazes of + Menace, the guild will only hear about 90% of your gold when your + corpse is discovered (adventurers have been known to collect + finder's fees). So, consider whether you want to take one last + hit at that monster and possibly live, or quit and stop with + whatever you have. If you quit, you keep all your gold, but if + you swing and live, you might find more. - The original hack game was modeled on the Berkeley UNIX - rogue game. Large portions of this paper were shamelessly - cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy - and Kenneth C. R. C. Arnold. Small portions were adapted from - Further Exploration of the Dungeons of Doom, by Ken Arromdee. + If you just want to see what the current top players/games + list is, you can type nethack -s all on most versions. - NetHack is the product of literally dozens of people's work. - Main events in the course of the game development are described - below: + 11. Explore mode - Jay Fenlason wrote the original Hack, with help from Kenny - Woodland, Mike Thome and Jon Payne. + NetHack is an intricate and difficult game. Novices might + falter in fear, aware of their ignorance of the means to survive. + Well, fear not. Your dungeon comes equipped with an "explore" or + "discovery" mode that enables you to keep old save files and + cheat death, at the paltry cost of not getting on the high score + list. - Andries Brouwer did a major re-write, transforming Hack into - a very different game, and published (at least) three versions - (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. + There are two ways of enabling explore mode. One is to + start the game with the -X command-line switch or with the play- + mode:explore option. The other is to issue the "#exploremode" + extended command while already playing the game. Starting a new + game in explore mode provides your character with a wand of wish- + ing in initial inventory; switching during play does not. The + other benefits of explore mode are left for the trepid reader to + discover. - Don G. Kneller ported Hack 1.0.3 to Microsoft C and MS-DOS, - producing PC HACK 1.01e, added support for DEC Rainbow graphics - in version 1.03g, and went on to produce at least four more ver- - sions (3.0, 3.2, 3.51, and 3.6). + 11.1. Debug mode - R. Black ported PC HACK 3.51 to Lattice C and the Atari - 520/1040ST, producing ST Hack 1.03. + Debug mode, also known as wizard mode, is undocumented aside + from this brief description and the various "debug mode only" + commands listed among the command descriptions. It is intended + for tracking down problems within the program rather than to pro- + vide god-like powers to your character, and players who attempt + debugging are expected to figure out how to use it themselves. + It is initiated by starting the game with the -D command-line + switch or with the playmode:debug option. - Mike Stephenson merged these various versions back together, - incorporating many of the added features, and produced NetHack - 1.4. He then coordinated a cast of thousands in enhancing and - debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. - - Later, Mike coordinated a major rewrite of the game, heading - a team which included Ken Arromdee, Jean-Christophe Collet, Steve - Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep- - oint, and Janet Walz, to produce NetHack 3.0c. - - NetHack 3.0 was ported to the Atari by Eric R. Smith, to - OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three - of them and Kevin Darcy later joined the main NetHack Development - Team to produce subsequent revisions of 3.0. - - Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm - Meluch, Stephen Spackman and Pierre Martineau designed overlay - code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the - Macintosh. Along with various other Dungeoneers, they continued - to enhance the PC, Macintosh, and Amiga ports through the later - revisions of 3.0. - - Headed by Mike Stephenson and coordinated by Izchak Miller - and Janet Walz, the NetHack Development Team which now included - Ken Arromdee, David Cohrs, Jean-Christophe Collet, Kevin Darcy, - Matt Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, - Eric Raymond, and Eric Smith undertook a radical revision of 3.0. + For some systems, the player must be logged in under a par- + ticular user name to be allowed to use debug mode; for others, + the hero must be given a particular character name (but may be + any role; there's no connection between "wizard mode" and the + Wizard role). Attempting to start a game in debug mode when not + allowed or not available will result in falling back to explore + mode instead. - NetHack 3.7 December 18, 2019 + + + + + NetHack 3.7 January 27, 2020 @@ -5812,63 +5812,63 @@ - They re-structured the game's design, and re-wrote major parts of - the code. They added multiple dungeons, a new display, special - individual character quests, a new endgame and many other new - features, and produced NetHack 3.1. + 12. Credits - Ken Lorber, Gregg Wonderly and Greg Olson, with help from - Richard Addison, Mike Passaretti, and Olaf Seibert, developed - NetHack 3.1 for the Amiga. + The original hack game was modeled on the Berkeley UNIX + rogue game. Large portions of this paper were shamelessly + cribbed from A Guide to the Dungeons of Doom, by Michael C. Toy + and Kenneth C. R. C. Arnold. Small portions were adapted from + Further Exploration of the Dungeons of Doom, by Ken Arromdee. - Norm Meluch and Kevin Smolkowski, with help from Carl Sche- - lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported - NetHack 3.1 to the PC. + NetHack is the product of literally dozens of people's work. + Main events in the course of the game development are described + below: - Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike - Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny - Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack - 3.1 for the Macintosh, porting it for MPW. Building on their de- - velopment, Bart House added a Think C port. + Jay Fenlason wrote the original Hack, with help from Kenny + Woodland, Mike Thome and Jon Payne. - Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port- - ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua - Delahunty, was responsible for the VMS version of NetHack 3.1. - Michael Allison ported NetHack 3.1 to Windows NT. + Andries Brouwer did a major re-write, transforming Hack into + a very different game, and published (at least) three versions + (1.0.1, 1.0.2, and 1.0.3) for UNIX machines to the Usenet. - Dean Luick, with help from David Cohrs, developed NetHack - 3.1 for X11. Warwick Allison wrote a tiled version of NetHack - for the Atari; he later contributed the tiles to the NetHack De- - velopment Team and tile support was then added to other plat- - forms. + Don G. Kneller ported Hack 1.0.3 to Microsoft C and MS-DOS, + producing PC HACK 1.01e, added support for DEC Rainbow graphics + in version 1.03g, and went on to produce at least four more ver- + sions (3.0, 3.2, 3.51, and 3.6). - The 3.2 NetHack Development Team, comprised of Michael Alli- - son, Ken Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin - Darcy, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Er- - ic Smith, Mike Stephenson, Janet Walz, and Paul Winner, released - version 3.2 in April of 1996. + R. Black ported PC HACK 3.51 to Lattice C and the Atari + 520/1040ST, producing ST Hack 1.03. - Version 3.2 marked the tenth anniversary of the formation of - the development team. In a testament to their dedication to the - game, all thirteen members of the original NetHack Development - Team remained on the team at the start of work on that release. - During the interval between the release of 3.1.3 and 3.2, one of - the founding members of the NetHack Development Team, Dr. Izchak - Miller, was diagnosed with cancer and passed away. That release - of the game was dedicated to him by the development and porting - teams. + Mike Stephenson merged these various versions back together, + incorporating many of the added features, and produced NetHack + 1.4. He then coordinated a cast of thousands in enhancing and + debugging NetHack 1.4 and released NetHack versions 2.2 and 2.3. - During the lifespan of NetHack 3.1 and 3.2, several enthusi- - asts of the game added their own modifications to the game and - made these "variants" publicly available: + Later, Mike coordinated a major rewrite of the game, heading + a team which included Ken Arromdee, Jean-Christophe Collet, Steve + Creps, Eric Hendrickson, Izchak Miller, John Rupley, Mike Threep- + oint, and Janet Walz, to produce NetHack 3.0c. - Tom Proudfoot and Yuval Oren created NetHack++, which was - quickly renamed NetHack--. Working independently, Stephen White - wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and - his own NetHack-- to produce SLASH. Larry Stewart-Zerba and + NetHack 3.0 was ported to the Atari by Eric R. Smith, to + OS/2 by Timo Hakulinen, and to VMS by David Gentzel. The three + of them and Kevin Darcy later joined the main NetHack Development + Team to produce subsequent revisions of 3.0. + + Olaf Seibert ported NetHack 2.3 and 3.0 to the Amiga. Norm + Meluch, Stephen Spackman and Pierre Martineau designed overlay + code for PC NetHack 3.0. Johnny Lee ported NetHack 3.0 to the + Macintosh. Along with various other Dungeoneers, they continued + to enhance the PC, Macintosh, and Amiga ports through the later + revisions of 3.0. + + Headed by Mike Stephenson and coordinated by Izchak Miller + and Janet Walz, the NetHack Development Team which now included + Ken Arromdee, David Cohrs, Jean-Christophe Collet, Kevin Darcy, + Matt Day, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, + Eric Raymond, and Eric Smith undertook a radical revision of 3.0. - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5878,63 +5878,63 @@ - Warwick Allison improved the spell casting system with the Wizard - Patch. Warwick Allison also ported NetHack to use the Qt inter- - face. + They re-structured the game's design, and re-wrote major parts of + the code. They added multiple dungeons, a new display, special + individual character quests, a new endgame and many other new + features, and produced NetHack 3.1. - Warren Cheung combined SLASH with the Wizard Patch to pro- - duce Slash'EM, and with the help of Kevin Hugo, added more fea- - tures. Kevin later joined the NetHack Development Team and in- - corporated the best of these ideas in NetHack 3.3. + Ken Lorber, Gregg Wonderly and Greg Olson, with help from + Richard Addison, Mike Passaretti, and Olaf Seibert, developed + NetHack 3.1 for the Amiga. - The final update to 3.2 was the bug fix release 3.2.3, which - was released simultaneously with 3.3.0 in December 1999 just in - time for the Year 2000. + Norm Meluch and Kevin Smolkowski, with help from Carl Sche- + lin, Stephen Spackman, Steve VanDevender, and Paul Winner, ported + NetHack 3.1 to the PC. - The 3.3 NetHack Development Team, consisting of Michael Al- - lison, Ken Arromdee, David Cohrs, Jessie Collet, Steve Creps, - Kevin Darcy, Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lor- - ber, Dean Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet - Walz, and Paul Winner, released 3.3.0 in December 1999 and 3.3.1 - in August of 2000. + Jon W{tte and Hao-yang Wang, with help from Ross Brown, Mike + Engber, David Hairston, Michael Hamel, Jonathan Handler, Johnny + Lee, Tim Lennan, Rob Menke, and Andy Swanson, developed NetHack + 3.1 for the Macintosh, porting it for MPW. Building on their de- + velopment, Bart House added a Think C port. - Version 3.3 offered many firsts. It was the first version to - separate race and profession. The Elf class was removed in pref- - erence to an elf race, and the races of dwarves, gnomes, and orcs - made their first appearance in the game alongside the familiar - human race. Monk and Ranger roles joined Archeologists, Barbar- - ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, - Tourists, Valkyries and of course, Wizards. It was also the - first version to allow you to ride a steed, and was the first - version to have a publicly available web-site listing all the - bugs that had been discovered. Despite that constantly growing - bug list, 3.3 proved stable enough to last for more than a year - and a half. + Timo Hakulinen ported NetHack 3.1 to OS/2. Eric Smith port- + ed NetHack 3.1 to the Atari. Pat Rankin, with help from Joshua + Delahunty, was responsible for the VMS version of NetHack 3.1. + Michael Allison ported NetHack 3.1 to Windows NT. - The 3.4 NetHack Development Team initially consisted of - Michael Allison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin - Hugo, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet - Walz, and Paul Winner, with Warwick Allison joining just before - the release of NetHack 3.4.0 in March 2002. + Dean Luick, with help from David Cohrs, developed NetHack + 3.1 for X11. Warwick Allison wrote a tiled version of NetHack + for the Atari; he later contributed the tiles to the NetHack De- + velopment Team and tile support was then added to other plat- + forms. - As with version 3.3, various people contributed to the game - as a whole as well as supporting ports on the different platforms - that NetHack runs on: + The 3.2 NetHack Development Team, comprised of Michael Alli- + son, Ken Arromdee, David Cohrs, Jessie Collet, Steve Creps, Kevin + Darcy, Timo Hakulinen, Steve Linhart, Dean Luick, Pat Rankin, Er- + ic Smith, Mike Stephenson, Janet Walz, and Paul Winner, released + version 3.2 in April of 1996. - Pat Rankin maintained 3.4 for VMS. + Version 3.2 marked the tenth anniversary of the formation of + the development team. In a testament to their dedication to the + game, all thirteen members of the original NetHack Development + Team remained on the team at the start of work on that release. + During the interval between the release of 3.1.3 and 3.2, one of + the founding members of the NetHack Development Team, Dr. Izchak + Miller, was diagnosed with cancer and passed away. That release + of the game was dedicated to him by the development and porting + teams. - Michael Allison maintained NetHack 3.4 for the MS-DOS plat- - form. Paul Winner and Yitzhak Sapir provided encouragement. + During the lifespan of NetHack 3.1 and 3.2, several enthusi- + asts of the game added their own modifications to the game and + made these "variants" publicly available: - Dean Luick, Mark Modrall, and Kevin Hugo maintained and en- - hanced the Macintosh port of 3.4. - - Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, - and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft - Windows platform. Alex Kompel contributed a new graphical + Tom Proudfoot and Yuval Oren created NetHack++, which was + quickly renamed NetHack--. Working independently, Stephen White + wrote NetHack Plus. Tom Proudfoot later merged NetHack Plus and + his own NetHack-- to produce SLASH. Larry Stewart-Zerba and - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -5944,63 +5944,63 @@ - interface for the Windows port. Alex Kompel also contributed a - Windows CE port for 3.4.1. + Warwick Allison improved the spell casting system with the Wizard + Patch. Warwick Allison also ported NetHack to use the Qt inter- + face. - Ron Van Iwaarden was the sole maintainer of NetHack for OS/2 - the past several releases. Unfortunately Ron's last OS/2 machine - stopped working in early 2006. A great many thanks to Ron for - keeping NetHack alive on OS/2 all these years. + Warren Cheung combined SLASH with the Wizard Patch to pro- + duce Slash'EM, and with the help of Kevin Hugo, added more fea- + tures. Kevin later joined the NetHack Development Team and in- + corporated the best of these ideas in NetHack 3.3. - Janne Salmijarvi and Teemu Suikki maintained and enhanced - the Amiga port of 3.4 after Janne Salmijarvi resurrected it for - 3.3.1. + The final update to 3.2 was the bug fix release 3.2.3, which + was released simultaneously with 3.3.0 in December 1999 just in + time for the Year 2000. - Christian "Marvin" Bressler maintained 3.4 for the Atari af- - ter he resurrected it for 3.3.1. + The 3.3 NetHack Development Team, consisting of Michael Al- + lison, Ken Arromdee, David Cohrs, Jessie Collet, Steve Creps, + Kevin Darcy, Timo Hakulinen, Kevin Hugo, Steve Linhart, Ken Lor- + ber, Dean Luick, Pat Rankin, Eric Smith, Mike Stephenson, Janet + Walz, and Paul Winner, released 3.3.0 in December 1999 and 3.3.1 + in August of 2000. - The release of NetHack 3.4.3 in December 2003 marked the be- - ginning of a long release hiatus. 3.4.3 proved to be a remarkably - stable version that provided continued enjoyment by the community - for more than a decade. The NetHack Development Team slowly and - quietly continued to work on the game behind the scenes during - the tenure of 3.4.3. It was during that same period that several - new variants emerged within the NetHack community. Notably - sporkhack by Derek S. Ray, unnethack by Patric Mueller, nitrohack - and its successors originally by Daniel Thaler and then by Alex - Smith, and Dynahack by Tung Nguyen. Some of those variants con- - tinue to be developed, maintained, and enjoyed by the community - to this day. + Version 3.3 offered many firsts. It was the first version to + separate race and profession. The Elf class was removed in pref- + erence to an elf race, and the races of dwarves, gnomes, and orcs + made their first appearance in the game alongside the familiar + human race. Monk and Ranger roles joined Archeologists, Barbar- + ians, Cavemen, Healers, Knights, Priests, Rogues, Samurai, + Tourists, Valkyries and of course, Wizards. It was also the + first version to allow you to ride a steed, and was the first + version to have a publicly available web-site listing all the + bugs that had been discovered. Despite that constantly growing + bug list, 3.3 proved stable enough to last for more than a year + and a half. - In September 2014, an interim snapshot of the code under de- - velopment was released publicly by other parties. Since that code - was a work-in-progress and had not gone through the process of - debugging it as a suitable release, it was decided that the ver- - sion numbers present on that code snapshot would be retired and - never used in an official NetHack release. An announcement was - posted on the NetHack Development Team's official nethack.org - website to that effect, stating that there would never be a - 3.4.4, 3.5, or 3.5.0 official release version. + The 3.4 NetHack Development Team initially consisted of + Michael Allison, Ken Arromdee, David Cohrs, Jessie Collet, Kevin + Hugo, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephenson, Janet + Walz, and Paul Winner, with Warwick Allison joining just before + the release of NetHack 3.4.0 in March 2002. - In January 2015, preparation began for the release of - NetHack 3.6. + As with version 3.3, various people contributed to the game + as a whole as well as supporting ports on the different platforms + that NetHack runs on: - At the beginning of development for what would eventually - get released as 3.6.0, the NetHack Development Team consisted of - Warwick Allison, Michael Allison, Ken Arromdee, David Cohrs, - Jessie Collet, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephen- - son, Janet Walz, and Paul Winner. In early 2015, ahead of the - release of 3.6.0, new members Sean Hunt, Pasi Kallinen, and Derek - S. Ray joined the NetHack Development Team. + Pat Rankin maintained 3.4 for VMS. - Near the end of the development of 3.6.0, one of the signif- - icant inspirations for many of the humorous and fun features - found in the game, author Terry Pratchett, passed away. NetHack - 3.6.0 introduced a tribute to him. + Michael Allison maintained NetHack 3.4 for the MS-DOS plat- + form. Paul Winner and Yitzhak Sapir provided encouragement. + + Dean Luick, Mark Modrall, and Kevin Hugo maintained and en- + hanced the Macintosh port of 3.4. + + Michael Allison, David Cohrs, Alex Kompel, Dion Nicolaas, + and Yitzhak Sapir maintained and enhanced 3.4 for the Microsoft + Windows platform. Alex Kompel contributed a new graphical - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 @@ -6010,63 +6010,63 @@ - 3.6.0 was released in December 2015, and merged work done by - the development team since the release of 3.4.3 with some of the - beloved community patches. Many bugs were fixed and some code was - restructured. + interface for the Windows port. Alex Kompel also contributed a + Windows CE port for 3.4.1. - The NetHack Development Team, as well as Steve VanDevender - and Kevin Smolkowski, ensured that NetHack 3.6 continued to oper- - ate on various UNIX flavors and maintained the X11 interface. + Ron Van Iwaarden was the sole maintainer of NetHack for OS/2 + the past several releases. Unfortunately Ron's last OS/2 machine + stopped working in early 2006. A great many thanks to Ron for + keeping NetHack alive on OS/2 all these years. - Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main- - tained the port of NetHack 3.6 for Mac OSX. + Janne Salmijarvi and Teemu Suikki maintained and enhanced + the Amiga port of 3.4 after Janne Salmijarvi resurrected it for + 3.3.1. - Michael Allison, David Cohrs, Bart House, Pasi Kallinen, - Alex Kompel, Dion Nicolaas, Derek S. Ray and Yitzhak Sapir main- - tained the port of NetHack 3.6 for Microsoft Windows. + Christian "Marvin" Bressler maintained 3.4 for the Atari af- + ter he resurrected it for 3.3.1. - Pat Rankin attempted to keep the VMS port running for - NetHack 3.6, hindered by limited access. Kevin Smolkowski has up- - dated and tested it for the most recent version of OpenVMS (V8.4 - as of this writing) on Alpha and Integrity (aka Itanium aka IA64) - but not VAX. + The release of NetHack 3.4.3 in December 2003 marked the be- + ginning of a long release hiatus. 3.4.3 proved to be a remarkably + stable version that provided continued enjoyment by the community + for more than a decade. The NetHack Development Team slowly and + quietly continued to work on the game behind the scenes during + the tenure of 3.4.3. It was during that same period that several + new variants emerged within the NetHack community. Notably + sporkhack by Derek S. Ray, unnethack by Patric Mueller, nitrohack + and its successors originally by Daniel Thaler and then by Alex + Smith, and Dynahack by Tung Nguyen. Some of those variants con- + tinue to be developed, maintained, and enjoyed by the community + to this day. - Ray Chason resurrected the msdos port for 3.6 and contrib- - uted the necessary updates to the community at large. + In September 2014, an interim snapshot of the code under de- + velopment was released publicly by other parties. Since that code + was a work-in-progress and had not gone through the process of + debugging it as a suitable release, it was decided that the ver- + sion numbers present on that code snapshot would be retired and + never used in an official NetHack release. An announcement was + posted on the NetHack Development Team's official nethack.org + website to that effect, stating that there would never be a + 3.4.4, 3.5, or 3.5.0 official release version. - In late April 2018, several hundred bug fixes for 3.6.0 and - some new features were assembled and released as NetHack 3.6.1. - The NetHack Development Team at the time of release of 3.6.1 con- - sisted of Warwick Allison, Michael Allison, Ken Arromdee, David - Cohrs, Jessie Collet, Pasi Kallinen, Ken Lorber, Dean Luick, - Patric Mueller, Pat Rankin, Derek S. Ray, Alex Smith, Mike - Stephenson, Janet Walz, and Paul Winner. + In January 2015, preparation began for the release of + NetHack 3.6. - In early May 2019, another 320 bug fixes along with some en- - hancements and the adopted curses window port, were released as - 3.6.2. + At the beginning of development for what would eventually + get released as 3.6.0, the NetHack Development Team consisted of + Warwick Allison, Michael Allison, Ken Arromdee, David Cohrs, + Jessie Collet, Ken Lorber, Dean Luick, Pat Rankin, Mike Stephen- + son, Janet Walz, and Paul Winner. In early 2015, ahead of the + release of 3.6.0, new members Sean Hunt, Pasi Kallinen, and Derek + S. Ray joined the NetHack Development Team. - Bart House, who had contributed to the game as a porting - team participant for decades, joined the NetHack Development Team - in late May 2019. - - NetHack 3.6.3 was released on December 5, 2019 containing - over 190 bug fixes to NetHack 3.6.2. - - NetHack 3.6.4 was released on December 18, 2019 containing a - security fix and a few bug fixes. - - The official NetHack web site is maintained by Ken Lorber at - https://www.nethack.org/. - - 12.1. SPECIAL THANKS - - On behalf of the NetHack community, thank you very much once - again to M. Drew Streib and Pasi Kallinen for providing a public + Near the end of the development of 3.6.0, one of the signif- + icant inspirations for many of the humorous and fun features + found in the game, author Terry Pratchett, passed away. NetHack + 3.6.0 introduced a tribute to him. - NetHack 3.7 December 18, 2019 + + NetHack 3.7 January 27, 2020 @@ -6076,6 +6076,76 @@ + 3.6.0 was released in December 2015, and merged work done by + the development team since the release of 3.4.3 with some of the + beloved community patches. Many bugs were fixed and some code was + restructured. + + The NetHack Development Team, as well as Steve VanDevender + and Kevin Smolkowski, ensured that NetHack 3.6 continued to oper- + ate on various UNIX flavors and maintained the X11 interface. + + Ken Lorber, Haoyang Wang, Pat Rankin, and Dean Luick main- + tained the port of NetHack 3.6 for Mac OSX. + + Michael Allison, David Cohrs, Bart House, Pasi Kallinen, + Alex Kompel, Dion Nicolaas, Derek S. Ray and Yitzhak Sapir main- + tained the port of NetHack 3.6 for Microsoft Windows. + + Pat Rankin attempted to keep the VMS port running for + NetHack 3.6, hindered by limited access. Kevin Smolkowski has up- + dated and tested it for the most recent version of OpenVMS (V8.4 + as of this writing) on Alpha and Integrity (aka Itanium aka IA64) + but not VAX. + + Ray Chason resurrected the msdos port for 3.6 and contrib- + uted the necessary updates to the community at large. + + In late April 2018, several hundred bug fixes for 3.6.0 and + some new features were assembled and released as NetHack 3.6.1. + The NetHack Development Team at the time of release of 3.6.1 con- + sisted of Warwick Allison, Michael Allison, Ken Arromdee, David + Cohrs, Jessie Collet, Pasi Kallinen, Ken Lorber, Dean Luick, + Patric Mueller, Pat Rankin, Derek S. Ray, Alex Smith, Mike + Stephenson, Janet Walz, and Paul Winner. + + In early May 2019, another 320 bug fixes along with some en- + hancements and the adopted curses window port, were released as + 3.6.2. + + Bart House, who had contributed to the game as a porting + team participant for decades, joined the NetHack Development Team + in late May 2019. + + NetHack 3.6.3 was released on December 5, 2019 containing + over 190 bug fixes to NetHack 3.6.2. + + NetHack 3.6.4 was released on December 18, 2019 containing a + security fix and a few bug fixes. + + NetHack 3.6.5 was released on January 27, 2020 containing + some security fixes and a small number of bug fixes. + + The official NetHack web site is maintained by Ken Lorber at + https://www.nethack.org/. + + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 94 + + + + 12.1. SPECIAL THANKS + + On behalf of the NetHack community, thank you very much once + again to M. Drew Streib and Pasi Kallinen for providing a public NetHack server at nethack.alt.org. Thanks to Keith Simpson and Andy Thomson for hardfought.org. Thanks to all those unnamed dun- geoneers who invest their time and effort into annual NetHack @@ -6125,23 +6195,23 @@ Frederick Roeber Merlyn LeRoy Tim Lennan Gil Neiger Michael Allison Timo Hakulinen Greg Laskin Michael Feir Tom Almy + + + + NetHack 3.7 January 27, 2020 + + + + + + NetHack Guidebook 95 + + + Greg Olson Michael Hamel Tom West Gregg Wonderly Michael Sokolov Warren Cheung Hao-yang Wang Mike Engber Warwick Allison Helge Hafting Mike Gallop Yitzhak Sapir - - - - NetHack 3.7 December 18, 2019 - - - - - - NetHack Guidebook 94 - - - Irina Rempt-Drijfhout Mike Passaretti Izchak Miller Mike Stephenson @@ -6194,11 +6264,7 @@ - - - - - NetHack 3.7 December 18, 2019 + NetHack 3.7 January 27, 2020 diff --git a/doc/fixes36.4 b/doc/fixes36.4 index c199560c4..a4b8991c4 100644 --- a/doc/fixes36.4 +++ b/doc/fixes36.4 @@ -1,7 +1,7 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.12 $ $NHDT-Date: 1576638499 2019/12/18 03:08:19 $ +$NHDT-Branch: Nethack-3.6 $:$NHDT-Revision: 1.14 $ $NHDT-Date: 1576976556 2019/12/22 01:02:36 $ fixes36.4 contains a terse summary of changes made to 3.6.3 in order to -produce 3.6.4. +produce 3.6.4 as well as any post-release fixes in binaries. General Fixes and Modified Features @@ -35,4 +35,3 @@ General New Features -------------------- none - diff --git a/doc/fixes36.5 b/doc/fixes36.5 index d3e45ff39..0422a69ff 100644 --- a/doc/fixes36.5 +++ b/doc/fixes36.5 @@ -1,12 +1,21 @@ -$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.0 $ $NHDT-Date: 1576705788 2019/12/18 21:49:48 $ +$NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.3 $ $NHDT-Date: 1578996303 2020/01/14 10:05:03 $ + +fixes36.5 contains a terse summary of changes made to 3.6.4 in order to +produce 3.6.5 as well as any post-release fixes in binaries. -This fixes36.5 file is here to capture information about updates in the 3.6.x -lineage following the release of 3.6.4 in December 2019. Please note, however, -that another 3.6.x release is not anticipated, and most developer -focus will shift to the next major release. General Fixes and Modified Features ----------------------------------- +fix accessing mons[-1] when trying to gate in a non-valid demon +fix accessing mons[-1] when monster figures out if a tin cures stoning +have string_for_opt() return empty_optstr on failure +ensure existing callers of string_for_opt() check return value before using it +fix potential buffer overflow in add_menu_coloring() +fix potential buffer overflow in sym_val() +fix potential buffer overflow in pline(), raw_printf(), and config_error_add() + via bad config file values or command line arguments +fix potential buffer overflow in choose_windows() +use vsnprintf instead of vsprintf in pline.c where possible Fixes to Post-3.6.4 Problems that Were Exposed Via git Repository @@ -15,16 +24,10 @@ Fixes to Post-3.6.4 Problems that Were Exposed Via git Repository Platform- and/or Interface-Specific Fixes or Features ----------------------------------------------------- - +Windows OPTIONS=map_mode:fit_to_screen could cause a game start failure +Windows users with C-locale unmappable names could get game start failure General New Features -------------------- - - -NetHack Community Patches (or Variation) Included -------------------------------------------------- - - -Code Cleanup and Reorganization -------------------------------- +none diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ade1e9fd9..513f78178 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -11,7 +11,6 @@ fix internal self-recover to work with recent fields added to checkpoint file improvements to pronoun usage when hallucinating function calls made from mapglyph based on dungeon level are now called once per level -fix accessing mons[-1] when trying to gate in a non-valid demon fast hero could have random clairvoyance happen more than once on same turn using 'Q' on wielded weapon would offer to split stack; make using 'w' on a quivered stack behave similarly @@ -23,7 +22,6 @@ change crysknife from mineral to bone and worm tooth from unspecified to bone worn meat ring shouldn't cause increased hunger; neither should fake Amulet worn +0 ring of protection should cause increased hunger if it is the only source of extrinsic Protection -fix accessing mons[-1] when monster figures out if a tin cures stoning monster wielding Stormbringer or healer's Staff against another monster would heal the hero instead of the wielding monster when draining life change twoweapon feedback from "not a weapon" to "not a suitable weapon" diff --git a/doc/makedefs.txt b/doc/makedefs.txt index 08ca2c9ef..8d6c85bc1 100644 --- a/doc/makedefs.txt +++ b/doc/makedefs.txt @@ -30,13 +30,17 @@ SHORT COMMANDS through the same logic as that used by the --grep command; see the MDGREP FUNCTIONS section below for details. - -m Generate date.h and options file. It will read dat/gitinfo.txt, + -c Generate date.h and options file. It will read dat/gitinfo.txt, + only if it is present, to obtain githash= and gitbranch= + info and include related preprocessor #defines in date.h file. only if it is present, to obtain githash= and gitbranch= info and include related preprocessor #defines in date.h file. -p Generate pm.h - -q Generate the rumors file. + -r Generate the rumors file. + + -s Generate the bogusmon , engrave and epitaphfiles. -s Generate the bogusmon , engrave and epitaphfiles. @@ -144,4 +148,5 @@ COPYRIGHT + NETHACK 1 Jan 2020 MAKEDEFS(6) diff --git a/include/patchlevel.h b/include/patchlevel.h index f9196a31f..7a18a4699 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -44,6 +44,22 @@ /****************************************************************************/ /* Version 3.6.x */ +/* Patch 5, January 27, 2020 + * + * fix accessing mons[-1] when trying to gate in a non-valid demon + * fix accessing mons[-1] when monster figures out if a tin cures stoning + * have string_for_opt() return empty_optstr on failure + * ensure existing callers of string_for_opt() check return value before using it + * fix potential buffer overflow in add_menu_coloring()0 + * fix potential buffer overflow in sym_val() + * fix potential buffer overflow in pline(), raw_printf(), and config_error_add() + * fix potential buffer overflow in choose_windows() + * use vsnprintf instead of vsprintf in pline.c where possible + * Windows: incldues a fix from a 3.6.4 post-release update where + * OPTIONS=map_mode:fit_to_screen could cause a game start failure + * Windows: users with C-locale unmappable names could get game start failure + */ + /* Patch 4, December 18, 2019 * * fix potential buffer overflow when parsing run-time configuration file diff --git a/include/vmsconf.h b/include/vmsconf.h index 9f061563b..4fc219c2e 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -168,6 +168,11 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then #define FCMASK 0660 /* file creation mask */ +/* + * + */ +#define NO_VSNPRINTF /* Avoid vsnprintf, use less-safe vsprintf instead. */ + /* * The remainder of the file should not need to be changed. */ diff --git a/src/.gitignore b/src/.gitignore index dfe1014db..6cdb6269a 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -11,5 +11,5 @@ tiles.bmp graphicschk nhdat o -nhdat370 +nhdat* diff --git a/src/end.c b/src/end.c index 74d1bdf53..0f601cc99 100644 --- a/src/end.c +++ b/src/end.c @@ -610,7 +610,11 @@ VA_DECL(const char *, str) { char buf[BUFSZ]; +#if !defined(NO_VSNPRINTF) + (void) vsnprintf(buf, sizeof buf, str, VA_ARGS); +#else Vsprintf(buf, str, VA_ARGS); +#endif raw_print(buf); paniclog("panic", buf); } diff --git a/src/options.c b/src/options.c index fb839b540..1af0e9d2b 100644 --- a/src/options.c +++ b/src/options.c @@ -42,6 +42,8 @@ enum window_option_types { #define PILE_LIMIT_DFLT 5 +static char empty_optstr[] = { '\0' }; + /* * NOTE: If you add (or delete) an option, please update the short * options help (option_help()), the long options help (dat/opthelp), @@ -927,8 +929,8 @@ int maxlen; */ static void escapes(cp, tp) -const char *cp; -char *tp; +const char *cp; /* might be 'tp', updating in place */ +char *tp; /* result is never longer than 'cp' */ { static NEARDATA const char oct[] = "01234567", dec[] = "0123456789", hex[] = "00112233445566778899aAbBcCdDeEfF"; @@ -1044,7 +1046,7 @@ boolean val_optional; if (!colon || !*++colon) { if (!val_optional) config_error_add("Missing parameter for '%s'", opts); - return (char *) 0; + return empty_optstr; } return colon; } @@ -1057,7 +1059,7 @@ boolean val_optional; { if (!g.opt_initial) { rejectoption(optname); - return (char *) 0; + return empty_optstr; } return string_for_opt(opts, val_optional); } @@ -1136,7 +1138,7 @@ const char *optype; uchar translate[WARNCOUNT]; int length, i; - if (!(opts = string_for_env_opt(optype, opts, FALSE))) + if ((opts = string_for_env_opt(optype, opts, FALSE)) == empty_optstr) return FALSE; escapes(opts, opts); @@ -1806,15 +1808,16 @@ int c, a; /* parse '"regex_string"=color&attr' and add it to menucoloring */ boolean add_menu_coloring(tmpstr) -char *tmpstr; +char *tmpstr; /* never Null but could be empty */ { int c = NO_COLOR, a = ATR_NONE; char *tmps, *cs, *amp; char str[BUFSZ]; - Sprintf(str, "%s", tmpstr); + (void) strncpy(str, tmpstr, sizeof str - 1); + str[sizeof str - 1] = '\0'; - if (!tmpstr || (cs = index(str, '=')) == 0) { + if ((cs = index(str, '=')) == 0) { config_error_add("Malformed MENUCOLOR"); return FALSE; } @@ -1928,7 +1931,8 @@ char **opp; if (negated) { bad_negation(fullname, FALSE); - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { boolean val_negated = FALSE; while ((*op == '!') || !strncmpi(op, "no", 2)) { @@ -2125,7 +2129,8 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, 3, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if ((op = string_for_env_opt(fullname, opts, negated)) != 0) { + if ((op = string_for_env_opt(fullname, opts, negated)) + != empty_optstr) { if (negated) { bad_negation(fullname, TRUE); return FALSE; @@ -2167,7 +2172,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { nmcpy(g.catname, op, PL_PSIZ); } else return FALSE; @@ -2182,7 +2188,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { nmcpy(g.dogname, op, PL_PSIZ); } else return FALSE; @@ -2197,7 +2204,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { nmcpy(g.horsename, op, PL_PSIZ); } else return FALSE; @@ -2212,7 +2220,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, (compat || !g.opt_initial)); - if (!op) { + if (op == empty_optstr) { if (compat || negated || g.opt_initial) { /* for backwards compatibility, "mouse_support" without a value is a synonym for mouse_support:1 */ @@ -2241,7 +2249,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, (compat || !g.opt_initial)); - if (!op) { + if (op == empty_optstr) { if (compat || negated || g.opt_initial) { /* for backwards compatibility, "number_pad" without a value is a synonym for number_pad:1 */ @@ -2284,7 +2292,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_opt(opts, FALSE)) != 0) { + } else if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { g.symset[ROGUESET].name = dupstr(op); if (!read_sym_file(ROGUESET)) { clear_symsetentry(ROGUESET, TRUE); @@ -2309,7 +2317,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_opt(opts, FALSE)) != 0) { + } else if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { g.symset[PRIMARY].name = dupstr(op); if (!read_sym_file(PRIMARY)) { clear_symsetentry(PRIMARY, TRUE); @@ -2332,7 +2340,7 @@ boolean tinitial, tfrom_file; complain_about_duplicate(opts, 1); if (negated) { flags.runmode = RUN_TPORT; - } else if ((op = string_for_opt(opts, FALSE)) != 0) { + } else if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { if (!strncmpi(op, "teleport", strlen(op))) flags.runmode = RUN_TPORT; else if (!strncmpi(op, "run", strlen(op))) @@ -2356,7 +2364,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { if (!add_menu_coloring(op)) return FALSE; } else @@ -2387,7 +2396,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_env_opt(fullname, opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.msg_history = negated ? 0 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -2405,7 +2415,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); - if (!(op = string_for_opt(opts, TRUE))) { + if ((op = string_for_opt(opts, TRUE)) == empty_optstr) { tmp = negated ? 's' : 'f'; } else { if (negated) { @@ -2474,7 +2484,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); if (opttype > 0 && !negated - && (op = string_for_opt(opts, FALSE)) != 0) { + && (op = string_for_opt(opts, FALSE)) != empty_optstr) { switch (opttype) { case MAP_OPTION: iflags.wc_fontsiz_map = atoi(op); @@ -2498,7 +2508,8 @@ boolean tinitial, tfrom_file; config_error_add("Unknown %s parameter '%s'", fullname, opts); return FALSE; } - if (opttype > 0 && (op = string_for_opt(opts, FALSE)) != 0) { + if (opttype > 0 + && (op = string_for_opt(opts, FALSE)) != empty_optstr) { wc_set_font_name(opttype, op); #ifdef MAC set_font_name(opttype, op); @@ -2543,12 +2554,12 @@ boolean tinitial, tfrom_file; } #ifdef WIN32 op = string_for_opt(opts, TRUE); - if (!alternative_palette(op)) { + if (op == empty_optstr || !alternative_palette(op)) { config_error_add("Error in palette parameter '%s'", op); return FALSE; } #else - if ((op = string_for_opt(opts, FALSE)) != (char *) 0) { + if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { char *pt = op; int cnt, tmp, reverse; long rgb; @@ -2598,22 +2609,21 @@ boolean tinitial, tfrom_file; if (match_optname(opts, "fruit", 2, TRUE)) { struct fruit *forig = 0; - char empty_str = '\0'; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated || !g.opt_initial); if (negated) { - if (op) { + if (op != empty_optstr) { bad_negation("fruit", TRUE); return FALSE; } - op = &empty_str; + op = empty_optstr; goto goodfruit; } - if (!op) + if (op == empty_optstr) return FALSE; - /* stripped leading and trailing spaces, condensed internal ones in 3.6.2 */ + /* strip leading/trailing spaces, condense internal ones (3.6.2) */ mungspaces(op); if (!g.opt_initial) { struct fruit *f; @@ -2662,7 +2672,8 @@ boolean tinitial, tfrom_file; if (negated) { iflags.getpos_coords = GPCOORDS_NONE; return retval; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { static char gpcoords[] = { GPCOORDS_NONE, GPCOORDS_COMPASS, GPCOORDS_COMFULL, GPCOORDS_MAP, GPCOORDS_SCREEN, '\0' }; @@ -2686,7 +2697,8 @@ boolean tinitial, tfrom_file; if (negated) { iflags.getloc_filter = GFILTER_NONE; return retval; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { char c = lowc(*op); switch (c) { @@ -2732,9 +2744,10 @@ boolean tinitial, tfrom_file; bad_negation(fullname, FALSE); return FALSE; } - /* if (!(opts = string_for_env_opt(fullname, opts, FALSE))) + /* if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) */ - if (!(opts = string_for_opt(opts, FALSE))) + if ((opts = string_for_opt(opts, FALSE)) == empty_optstr) return FALSE; escapes(opts, opts); /* note: dummy monclass #0 has symbol value '\0'; we allow that-- @@ -2783,7 +2796,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { nmcpy(g.plname, op, PL_NSIZ); } else return FALSE; @@ -2798,7 +2812,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_opt(opts, negated)) != 0) { + } else if ((op = string_for_opt(opts, negated)) != empty_optstr) { #if defined(WIN32) && defined(TTY_GRAPHICS) set_altkeyhandler(op); #endif @@ -2812,7 +2826,7 @@ boolean tinitial, tfrom_file; fullname = "align_status"; if (match_optname(opts, fullname, sizeof "align_status" - 1, TRUE)) { op = string_for_opt(opts, negated); - if (op && !negated) { + if ((op != empty_optstr) && !negated) { if (!strncmpi(op, "left", sizeof "left" - 1)) iflags.wc_align_status = ALIGN_LEFT; else if (!strncmpi(op, "top", sizeof "top" - 1)) @@ -2839,7 +2853,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if (op && !negated) { + if ((op != empty_optstr) && !negated) { if (!strncmpi(op, "left", sizeof "left" - 1)) iflags.wc_align_message = ALIGN_LEFT; else if (!strncmpi(op, "top", sizeof "top" - 1)) @@ -2867,7 +2881,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (!(op = string_for_opt(opts, FALSE))) + } else if ((op = string_for_opt(opts, FALSE)) == empty_optstr) return FALSE; if (!change_inv_order(op)) @@ -2886,7 +2900,7 @@ boolean tinitial, tfrom_file; flags.paranoia_bits = 0; /* clear all */ if (negated) { flags.paranoia_bits = 0; /* [now redundant...] */ - } else if ((op = string_for_opt(opts, TRUE)) != 0) { + } else if ((op = string_for_opt(opts, TRUE)) != empty_optstr) { char *pp, buf[BUFSZ]; strncpy(buf, op, sizeof buf - 1); @@ -2952,7 +2966,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { switch (lowc(*op)) { case 'u': /* Unencumbered */ flags.pickup_burden = UNENCUMBERED; @@ -2995,7 +3010,7 @@ boolean tinitial, tfrom_file; oc_to_str(flags.pickup_types, tbuf); flags.pickup_types[0] = '\0'; /* all */ op = string_for_opt(opts, (compat || !g.opt_initial)); - if (!op) { + if (op == empty_optstr) { if (compat || negated || g.opt_initial) { /* for backwards compatibility, "pickup" without a value is a synonym for autopickup of all types @@ -3067,12 +3082,13 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) flags.pile_limit = negated ? 0 : atoi(op); else if (negated) { bad_negation(fullname, TRUE); return FALSE; - } else /* !op */ + } else /* op == empty_optstr */ flags.pile_limit = PILE_LIMIT_DFLT; /* sanity check */ if (flags.pile_limit < 0) @@ -3090,7 +3106,7 @@ boolean tinitial, tfrom_file; if (duplicate || negated) return FALSE; op = string_for_opt(opts, FALSE); - if (!op) + if (op == empty_optstr) return FALSE; if (!strncmpi(op, "normal", 6) || !strcmpi(op, "play")) { wizard = discover = FALSE; @@ -3113,7 +3129,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if (op && !negated) { + if (op != empty_optstr && !negated) { if (!strncmpi(op, "dialog", sizeof "dialog" - 1)) { iflags.wc_player_selection = VIA_DIALOG; } else if (!strncmpi(op, "prompt", sizeof "prompt" - 1)) { @@ -3160,14 +3176,15 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, TRUE); - if (op && negated) { + if (op != empty_optstr && negated) { bad_negation(fullname, TRUE); return FALSE; } /* "disclose" without a value means "all with prompting" and negated means "none without prompting" */ - if (!op || !strcmpi(op, "all") || !strcmpi(op, "none")) { - if (op && !strcmpi(op, "none")) + if (op == empty_optstr + || !strcmpi(op, "all") || !strcmpi(op, "none")) { + if (op != empty_optstr && !strcmpi(op, "none")) negated = TRUE; for (num = 0; num < NUM_DISCLOSURE_OPTIONS; num++) flags.end_disclose[num] = negated @@ -3232,7 +3249,7 @@ boolean tinitial, tfrom_file; bad_negation(fullname, FALSE); return FALSE; } - if (!(op = string_for_opt(opts, FALSE))) + if ((op = string_for_opt(opts, FALSE)) == empty_optstr) return FALSE; while (*op) { @@ -3281,7 +3298,7 @@ boolean tinitial, tfrom_file; fullname = "sortloot"; if (match_optname(opts, fullname, 4, TRUE)) { op = string_for_env_opt(fullname, opts, FALSE); - if (op) { + if (op != empty_optstr) { char c = lowc(*op); switch (c) { @@ -3307,7 +3324,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (op) + } else if (op != empty_optstr) (void) feature_alert_opts(op, fullname); return retval; } @@ -3322,7 +3339,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { + } else if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) { return FALSE; } if (!assign_videocolors(opts)) { @@ -3339,7 +3357,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { + } else if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) { return FALSE; } if (!assign_videoshades(opts)) { @@ -3383,7 +3402,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { + } else if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) { return FALSE; } if (!assign_video(opts)) { @@ -3393,6 +3413,11 @@ boolean tinitial, tfrom_file; return retval; } #endif /* NO_TERMS */ + } else if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) { + return FALSE; + } + } #endif /* MSDOS */ /* WINCAP @@ -3406,7 +3431,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if (op && !negated) { + if (op != empty_optstr && !negated) { if (!strcmpi(op, "tiles")) iflags.wc_map_mode = MAP_MODE_TILES; else if (!strncmpi(op, "ascii4x6", sizeof "ascii4x6" - 1)) @@ -3454,7 +3479,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.wc_scroll_amount = negated ? 1 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -3470,7 +3496,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.wc_scroll_margin = negated ? 5 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -3488,7 +3515,7 @@ boolean tinitial, tfrom_file; #if defined(WIN32) } else { op = string_for_opt(opts, 0); - if (!op) + if (op == empty_optstr) return FALSE; #ifdef TTY_GRAPHICS map_subkeyvalue(op); @@ -3505,7 +3532,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.wc_tile_width = negated ? 0 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -3519,7 +3547,7 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, sizeof "tile_file" - 1, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if ((op = string_for_opt(opts, FALSE)) != 0) { + if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { if (iflags.wc_tile_file) free(iflags.wc_tile_file); iflags.wc_tile_file = dupstr(op); @@ -3534,7 +3562,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.wc_tile_height = negated ? 0 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -3550,7 +3579,8 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, negated); - if ((negated && !op) || (!negated && op)) { + if ((negated && op == empty_optstr) + || (!negated && op != empty_optstr)) { iflags.wc_vary_msgcount = negated ? 0 : atoi(op); } else if (negated) { bad_negation(fullname, TRUE); @@ -3581,7 +3611,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { if (!iflags.windowtype_deferred) { char buf[WINTYPELEN]; @@ -3601,7 +3632,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) { + } else if ((op = string_for_env_opt(fullname, opts, FALSE)) + != empty_optstr) { char buf[WINTYPELEN]; nmcpy(buf, op, WINTYPELEN); @@ -3620,7 +3652,7 @@ boolean tinitial, tfrom_file; if (match_optname(opts, fullname, 7, TRUE)) { if (duplicate) complain_about_duplicate(opts, 1); - if ((op = string_for_opt(opts, FALSE)) != 0) { + if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { if (!wc_set_window_colors(op)) { config_error_add("Could not set %s '%s'", fullname, op); return FALSE; @@ -3643,22 +3675,23 @@ boolean tinitial, tfrom_file; || (fullname = "term_rows", match_optname(opts, fullname, 8, TRUE))) { long ltmp; - op = string_for_opt(opts, negated); - ltmp = atol(op); - if (negated) { - bad_negation(fullname, FALSE); - retval = FALSE; + if ((op = string_for_opt(opts, negated)) != empty_optstr) { + ltmp = atol(op); + if (negated) { + bad_negation(fullname, FALSE); + retval = FALSE; - /* this just checks atol() sanity, not logical window size sanity */ - } else if (ltmp <= 0L || ltmp >= (long) LARGEST_INT) { - config_error_add("Invalid %s: %ld", fullname, ltmp); - retval = FALSE; + /* just checks atol() sanity, not logical window size sanity */ + } else if (ltmp <= 0L || ltmp >= (long) LARGEST_INT) { + config_error_add("Invalid %s: %ld", fullname, ltmp); + retval = FALSE; - } else { - if (!strcmp(fullname, "term_rows")) - iflags.wc2_term_rows = (int) ltmp; - else /* !strcmp(fullname, "term_cols") */ - iflags.wc2_term_cols = (int) ltmp; + } else { + if (!strcmp(fullname, "term_rows")) + iflags.wc2_term_rows = (int) ltmp; + else /* !strcmp(fullname, "term_cols") */ + iflags.wc2_term_cols = (int) ltmp; + } } return retval; } @@ -3668,10 +3701,10 @@ boolean tinitial, tfrom_file; fullname = "petattr"; if (match_optname(opts, fullname, sizeof "petattr" - 1, TRUE)) { op = string_for_opt(opts, negated); - if (op && negated) { + if (op != empty_optstr && negated) { bad_negation(fullname, TRUE); retval = FALSE; - } else if (op) { + } else if (op != empty_optstr) { #ifdef CURSES_GRAPHICS int itmp = curses_read_attrs(op); @@ -3702,7 +3735,7 @@ boolean tinitial, tfrom_file; fullname = "windowborders"; if (match_optname(opts, fullname, 10, TRUE)) { op = string_for_opt(opts, negated); - if (negated && op) { + if (negated && op != empty_optstr) { bad_negation(fullname, TRUE); retval = FALSE; } else { @@ -3710,7 +3743,7 @@ boolean tinitial, tfrom_file; if (negated) itmp = 0; /* Off */ - else if (!op) + else if (op == empty_optstr) itmp = 1; /* On */ else /* Value supplied; expect 0 (off), 1 (on), or 2 (auto) */ itmp = atoi(op); @@ -3738,7 +3771,7 @@ boolean tinitial, tfrom_file; bad_negation(fullname, TRUE); itmp = 2; retval = FALSE; - } else if (op) { + } else if (op != empty_optstr) { itmp = atoi(op); } if (itmp < 2 || itmp > 3) { @@ -3760,7 +3793,7 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); - if (!(op = string_for_opt(opts, !val_required))) { + if ((op = string_for_opt(opts, !val_required)) == empty_optstr) { if (val_required) return FALSE; /* string_for_opt gave feedback */ tmp = negated ? 'n' : 'f'; @@ -3801,7 +3834,8 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if (!(opts = string_for_env_opt(fullname, opts, FALSE))) { + } else if ((opts = string_for_env_opt(fullname, opts, FALSE)) + == empty_optstr) { return FALSE; } tmpattr = match_str2attr(opts, TRUE); @@ -3821,7 +3855,7 @@ boolean tinitial, tfrom_file; if (negated) { bad_negation(fullname, FALSE); return FALSE; - } else if ((op = string_for_opt(opts, FALSE)) != 0) { + } else if ((op = string_for_opt(opts, FALSE)) != empty_optstr) { char c, op_buf[BUFSZ]; escapes(op, op_buf); @@ -3843,10 +3877,10 @@ boolean tinitial, tfrom_file; if (duplicate) complain_about_duplicate(opts, 1); op = string_for_opt(opts, TRUE); - if (op && negated) { + if (op != empty_optstr && negated) { clear_status_hilites(); return retval; - } else if (!op) { + } else if (op == empty_optstr) { config_error_add("Value is mandatory for hilite_status"); return FALSE; } @@ -3867,7 +3901,7 @@ boolean tinitial, tfrom_file; iflags.hilite_delta = 0L; } else { op = string_for_opt(opts, TRUE); - iflags.hilite_delta = (!op || !*op) ? 3L : atol(op); + iflags.hilite_delta = (op == empty_optstr || !*op) ? 3L : atol(op); if (iflags.hilite_delta < 0L) iflags.hilite_delta = 1L; } @@ -4015,7 +4049,7 @@ boolean tinitial, tfrom_file; } op = string_for_opt(opts, TRUE); - if (op) { + if (op != empty_optstr) { if (negated) { config_error_add( "Negated boolean '%s' should not have a parameter", @@ -6129,9 +6163,9 @@ char *buf; int sym_val(strval) -const char *strval; +const char *strval; /* up to 4*BUFSZ-1 long; only first few chars matter */ { - char buf[QBUFSZ]; + char buf[QBUFSZ], tmp[QBUFSZ]; /* to hold trucated copy of 'strval' */ buf[0] = '\0'; if (!strval[0] || !strval[1]) { /* empty, or single character */ @@ -6152,8 +6186,9 @@ const char *strval; /* not simple quote or basic backslash; strip closing quote and let escapes() deal with it */ } else { - char *p, tmp[QBUFSZ]; + char *p; + /* +1: skip opening single quote */ (void) strncpy(tmp, strval + 1, sizeof tmp - 1); tmp[sizeof tmp - 1] = '\0'; if ((p = rindex(tmp, '\'')) != 0) { @@ -6161,8 +6196,11 @@ const char *strval; escapes(tmp, buf); } /* else buf[0] stays '\0' */ } - } else /* not lone char nor single quote */ - escapes(strval, buf); + } else { /* not lone char nor single quote */ + (void) strncpy(tmp, strval, sizeof tmp - 1); + tmp[sizeof tmp - 1] = '\0'; + escapes(tmp, buf); + } return (int) *buf; } diff --git a/src/pline.c b/src/pline.c index 7eee2585f..28d5dd4be 100644 --- a/src/pline.c +++ b/src/pline.c @@ -6,6 +6,10 @@ #define NEED_VARARGS /* Uses ... */ /* comment line for pre-compiled headers */ #include "hack.h" +#define BIGBUFSZ (5 * BUFSZ) /* big enough to format a 4*BUFSZ string (from + * config file parsing) with modest decoration; + * result will then be truncated to BUFSZ-1 */ + static void FDECL(putmesg, (const char *)); static char *FDECL(You_buf, (int)); #if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__)) @@ -114,9 +118,12 @@ VA_DECL(const char *, line) #endif /* USE_STDARG | USE_VARARG */ { /* start of vpline() or of nested block in USE_OLDARG's pline() */ static int in_pline = 0; - char pbuf[3 * BUFSZ]; + char pbuf[BIGBUFSZ]; /* will get chopped down to BUFSZ-1 if longer */ int ln; int msgtyp; +#if !defined(NO_VSNPRINTF) + int vlen = 0; +#endif boolean no_repeat; /* Do NOT use VA_START and VA_END in here... see above */ @@ -130,7 +137,16 @@ VA_DECL(const char *, line) return; if (index(line, '%')) { +#if !defined(NO_VSNPRINTF) + vlen = vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS); +#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG) + if (vlen >= (int) sizeof pbuf) + panic("%s: truncation of buffer at %zu of %d bytes", + "pline", sizeof pbuf, vlen); +#endif +#else Vsprintf(pbuf, line, VA_ARGS); +#endif line = pbuf; } if ((ln = (int) strlen(line)) > BUFSZ - 1) { @@ -435,15 +451,18 @@ void raw_printf VA_DECL(const char *, line) #endif { - char pbuf[3 * BUFSZ]; - int ln; + char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */ /* Do NOT use VA_START and VA_END in here... see above */ if (index(line, '%')) { +#if !defined(NO_VSNPRINTF) + (void) vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS); +#else Vsprintf(pbuf, line, VA_ARGS); +#endif line = pbuf; } - if ((ln = (int) strlen(line)) > BUFSZ - 1) { + if ((int) strlen(line) > BUFSZ - 1) { if (line != pbuf) line = strncpy(pbuf, line, BUFSZ - 1); /* unlike pline, we don't futz around to keep last few chars */ @@ -462,7 +481,7 @@ VA_DECL(const char *, line) void impossible VA_DECL(const char *, s) { - char pbuf[2 * BUFSZ]; + char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */ VA_START(s); VA_INIT(s, const char *); @@ -470,7 +489,11 @@ VA_DECL(const char *, s) panic("impossible called impossible"); g.program_state.in_impossible = 1; +#if !defined(NO_VSNPRINTF) + (void) vsnprintf(pbuf, sizeof pbuf, s, VA_ARGS); +#else Vsprintf(pbuf, s, VA_ARGS); +#endif pbuf[BUFSZ - 1] = '\0'; /* sanity */ paniclog("impossible", pbuf); if (iflags.debug_fuzzer) @@ -567,9 +590,21 @@ config_error_add VA_DECL(const char *, str) #endif /* ?(USE_STDARG || USE_VARARG) */ { /* start of vconf...() or of nested block in USE_OLDARG's conf...() */ - char buf[2 * BUFSZ]; +#if !defined(NO_VSNPRINTF) + int vlen = 0; +#endif + char buf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */ +#if !defined(NO_VSNPRINTF) + vlen = vsnprintf(buf, sizeof buf, str, VA_ARGS); +#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG) + if (vlen >= (int) sizeof buf) + panic("%s: truncation of buffer at %zu of %d bytes", + "config_error_add", sizeof buf, vlen); +#endif +#else Vsprintf(buf, str, VA_ARGS); +#endif buf[BUFSZ - 1] = '\0'; config_erradd(buf); diff --git a/src/topten.c b/src/topten.c index 53545429f..b2c163d69 100644 --- a/src/topten.c +++ b/src/topten.c @@ -1036,6 +1036,7 @@ int uid; * print selected parts of score list. * argc >= 2, with argv[0] untrustworthy (directory names, et al.), * and argv[1] starting with "-s". + * caveat: some shells might allow argv elements to be arbitrarily long. */ void prscore(argc, argv) diff --git a/src/windows.c b/src/windows.c index ba7fb966e..89d1cd7fa 100644 --- a/src/windows.c +++ b/src/windows.c @@ -241,7 +241,8 @@ void choose_windows(s) const char *s; { - register int i; + int i; + char *tmps = 0; for (i = 0; winchoices[i].procs; i++) { if ('+' == winchoices[i].procs->name[0]) @@ -267,9 +268,22 @@ const char *s; windowprocs.win_wait_synch = def_wait_synch; if (!winchoices[0].procs) { - raw_printf("No window types?"); + raw_printf("No window types supported?"); nh_terminate(EXIT_FAILURE); } + /* 50: arbitrary, no real window_type names are anywhere near that long; + used to prevent potential raw_printf() overflow if user supplies a + very long string (on the order of 1200 chars) on the command line + (config file options can't get that big; they're truncated at 1023) */ +#define WINDOW_TYPE_MAXLEN 50 + if (strlen(s) >= WINDOW_TYPE_MAXLEN) { + tmps = (char *) alloc(WINDOW_TYPE_MAXLEN); + (void) strncpy(tmps, s, WINDOW_TYPE_MAXLEN - 1); + tmps[WINDOW_TYPE_MAXLEN - 1] = '\0'; + s = tmps; + } +#undef WINDOW_TYPE_MAXLEN + if (!winchoices[1].procs) { config_error_add( "Window type %s not recognized. The only choice is: %s", @@ -291,6 +305,8 @@ const char *s; config_error_add("Window type %s not recognized. Choices are: %s", s, buf); } + if (tmps) + free((genericptr_t) tmps) /*, tmps = 0*/ ; if (windowprocs.win_raw_print == def_raw_print || WINDOWPORT("safe-startup")) @@ -1154,7 +1170,7 @@ boolean fullsubs; /* True -> full substitution for file name, False -> else Strcpy(tmpbuf, "{current date+time}"); break; - case 'v': /* version, eg. "3.6.4-0" */ + case 'v': /* version, eg. "3.6.5-0" */ Sprintf(tmpbuf, "%s", version_string(verbuf)); break; case 'u': /* UID */ diff --git a/sys/amiga/.gitattributes b/sys/amiga/.gitattributes index f969b5ebc..446704d25 100644 --- a/sys/amiga/.gitattributes +++ b/sys/amiga/.gitattributes @@ -1,2 +1,2 @@ *.p NHSUBST -* NH_filestag=(file%s_for_Amiga_versions_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_Amiga_versions_-_untested_for_3.6.5) diff --git a/sys/atari/.gitattributes b/sys/atari/.gitattributes index ff75d0637..1e69c8203 100644 --- a/sys/atari/.gitattributes +++ b/sys/atari/.gitattributes @@ -1 +1 @@ -* NH_filestag=(file%s_for_Atari_version_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_Atari_version_-_untested_for_3.6.5) diff --git a/sys/be/.gitattributes b/sys/be/.gitattributes index 76b400189..cfd3b0752 100644 --- a/sys/be/.gitattributes +++ b/sys/be/.gitattributes @@ -1 +1 @@ -* NH_filestag=(file%s_for_BeOS_version_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_BeOS_version_-_untested_for_3.6.5) diff --git a/sys/msdos/.gitattributes b/sys/msdos/.gitattributes index a0b35794c..6495a95ad 100644 --- a/sys/msdos/.gitattributes +++ b/sys/msdos/.gitattributes @@ -4,6 +4,6 @@ Makefile.* NHSUBST Install.* NHSUBST moveinit.pat NH_header=no vesa.h NH_header=no -* NH_filestag=(file%s_for_MSDOS_version_-_tested_for_3.6.4_via_partial_cross-compile_only) +* NH_filestag=(file%s_for_MSDOS_version) nhico.uu NH_filestag=(file%s_for_running_MSDOS_binary_under_Windows) nhpif.uu NH_filestag=>nhico.uu diff --git a/sys/os2/.gitattributes b/sys/os2/.gitattributes index d3d1c307d..79916bd77 100644 --- a/sys/os2/.gitattributes +++ b/sys/os2/.gitattributes @@ -1,2 +1,2 @@ Makefile.* NHSUBST -* NH_filestag=(file%s_for_OS/2_version_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_OS/2_version_-_untested_for_3.6.5) diff --git a/sys/share/.gitattributes b/sys/share/.gitattributes index 271c3c59f..6a04d25b3 100644 --- a/sys/share/.gitattributes +++ b/sys/share/.gitattributes @@ -5,16 +5,16 @@ dgn_comp.h NH_header=no lev_comp.h NH_header=no Makefile.lib NH_header=no -Makefile.lib NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.4) -#termcap.uu NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.4) +Makefile.lib NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.5) +#termcap.uu NH_filestag=(file%s_for_MSDOS_and_OS/2_versions_-_untested_for_3.6.5) termcap.uu NH_filestag=>Makefile.lib -pcmain.c NH_filestag=(file_for_MSDOS,_OS/2,_Amiga,_and_Atari_versions_-_untested_for_3.6.4) +pcmain.c NH_filestag=(file_for_MSDOS,_OS/2,_Amiga,_and_Atari_versions_-_untested_for_3.6.5) -pcsys.c NH_filestag=(file%s_for_MSDOS,_OS/2_and_Atari_versions_-_tested_on_MSDOS_for_3.6.4_via_partial_cross-compile_only) +pcsys.c NH_filestag=(file%s_for_MSDOS,_OS/2_and_Atari_versions_-_tested_on_MSDOS_for_3.6.5_via_partial_cross-compile_only) pcunix.c NH_filestag=>pcsys.c -NetHack.cnf NH_filestag=(file_for_MSDOS,_OS/2,_and_Atari_versions_-_untested_for_3.6.4) +NetHack.cnf NH_filestag=(file_for_MSDOS,_OS/2,_and_Atari_versions_-_untested_for_3.6.5) pctty.c NH_filestag=>NetHack.cnf ioctl.c NH_filestag=(file%s_for_UNIX_and_Be_versions) diff --git a/sys/unix/Makefile.dat b/sys/unix/Makefile.dat index e60e2fd06..0508974e9 100644 --- a/sys/unix/Makefile.dat +++ b/sys/unix/Makefile.dat @@ -123,8 +123,11 @@ spec_levs: quest_levs: touch quest_levs -spotless: - -rm -f spec_levs quest_levs *.lev $(VARDAT) +# gitinfo.txt is optionally made by src/Makefile when creating date.h +clean: + -rm -f gitinfo.txt + +spotless: clean -rm -f nhdat x11tiles beostiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm -rm -f rip.img GEM_RSC.RSC title.img nh16.img NetHack.ad -rm -f nhsplash.xpm nhtiles.bmp diff --git a/sys/unix/Makefile.top b/sys/unix/Makefile.top index dc7c2bc0b..364d1b3d9 100644 --- a/sys/unix/Makefile.top +++ b/sys/unix/Makefile.top @@ -308,6 +308,7 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs clean: ( cd src ; $(MAKE) clean ) ( cd util ; $(MAKE) clean ) + ( cd dat ; $(MAKE) clean ) ( cd doc ; $(MAKE) clean ) ( cd lib/lua-$(LUA_VERSION)/src && $(MAKE) clean ) diff --git a/sys/unix/NetHack.xcodeproj/project.pbxproj b/sys/unix/NetHack.xcodeproj/project.pbxproj index c09de805f..e075f9b96 100644 --- a/sys/unix/NetHack.xcodeproj/project.pbxproj +++ b/sys/unix/NetHack.xcodeproj/project.pbxproj @@ -151,6 +151,14 @@ 54FCE8292223261F00F393C8 /* isaac64.c in Sources */ = {isa = PBXBuildFile; fileRef = 54FCE8282223261F00F393C8 /* isaac64.c */; }; /* End PBXBuildFile section */ + inputFiles = ( + ); + inputFiles = ( + ); + inputFiles = ( + ); + inputFiles = ( + ); /* Begin PBXContainerItemProxy section */ 316B91CA21A3BD7C00EC3E81 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; @@ -976,7 +984,7 @@ 3189576921A1FCC100FB2ABE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1120; + LastUpgradeCheck = 1130; ORGANIZATIONNAME = "Bart House"; TargetAttributes = { 3189577021A1FCC100FB2ABE = { @@ -1837,6 +1845,10 @@ }; name = Release; }; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "-"; + CODE_SIGN_IDENTITY = "-"; 31B8A44F21A26A4B0055BD01 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { diff --git a/sys/unix/NetHack.xcodeproj/xcshareddata/xcschemes/NetHack.xcscheme b/sys/unix/NetHack.xcodeproj/xcshareddata/xcschemes/NetHack.xcscheme index c67695cf6..7abc16af5 100644 --- a/sys/unix/NetHack.xcodeproj/xcshareddata/xcschemes/NetHack.xcscheme +++ b/sys/unix/NetHack.xcodeproj/xcshareddata/xcschemes/NetHack.xcscheme @@ -1,6 +1,6 @@ +10. Many NetHack commands can be aborted by sending it the character when it wants input. This is displayed as ESC inside the game. Digital VK201 keyboards (used by VT2xx and VT3xx and older VAXstations) and VK401 keyboards (used by VT4xx, newer VAXstations, @@ -382,7 +394,7 @@ Notes: be sure to remember to eventually reattach to the NetHack subprocess; otherwise the game in progress won't get saved when you logout. -9. NetHack optionally maintains a logfile which receives one line appended +11. NetHack optionally maintains a logfile which receives one line appended to it whenever a game ends. This can be disabled entirely by adding an "#undef LOGFILE" directive to vmsconf.h prior to building the program, or it can be disabled later by removing the file(s) LOGFILE.;* @@ -393,7 +405,7 @@ Notes: more elaborate log file named XLOGFILE containing more information is handled similarly. -10. Some attempt at support for VMS versions earlier than V4.6 has been +12. Some attempt at support for VMS versions earlier than V4.6 has been included, but no such obsolete system was available for testing it. vmsbuild.com detects the need for the extra support routines and arranges automatically for them to be compiled. The reason that @@ -404,7 +416,7 @@ Notes: [That was written many years ago and the chance of it still working is very small.] -11. vmsbuild.com collects almost all of the object files (xxx.OBJ) into +13. vmsbuild.com collects almost all of the object files (xxx.OBJ) into an object library (NETHACK.OLB) as it compiles the source files. This should prevent the quota-exceeded problems from the linker that some sites have reported for prior versions. Note that if you @@ -416,7 +428,7 @@ Notes: If you forget to replace the library entry, your newly compiled code will not be included in the new executable image. -12. To access "wizard mode"--intended for debugging purposes, not to +14. To access "wizard mode"--intended for debugging purposes, not to spoil the game with unlimited wishes--you must be running from the username compiled into the game via Local_WIZARD in vmsconf.h, and you must specify "-D" on the command line when invoking NetHack. @@ -427,10 +439,10 @@ Notes: Any character name you specify will be ignored in favor of "wizard". [More out of date information. Rather than compile-time Local_WIZARD, - uses(s) allowed to entre wizard mode are now controlled by the entry + users(s) allowed to entre wizard mode are now controlled by the entry WIZARDS in the file SYSCONF.] -13. At program startup time, NetHack uses the empty file PERM to prevent +15. At program startup time, NetHack uses the empty file PERM to prevent two different processes from using the same character name (under the same UIC ownership) at the same time. It does this by temporarily giving that file a second directory entry named PERM.LOCK, then @@ -472,7 +484,7 @@ Notes: is accomplished using temporary entry RECORD.LOCK and LOGFILE using entry LOGFILE.LOCK. -14. Unless you have both Motif and the Athena Widget set from MIT, you +16. Unless you have both Motif and the Athena Widget set from MIT, you will not be able to use the X11 interface on VMS. Even if you do have both those things, such a configuration has not been tested and there are no provisions for it in vmsbuild.com. Makefile.src does @@ -498,7 +510,7 @@ Notes: window manager in order for any changes to take effect; it's easiest to just make the session manager quit and then log in again. -15. If necessary, send problem reports via e-mail to +17. If necessary, send problem reports via e-mail to Always include version information for NetHack, the operating system, and the C compiler used. @@ -506,6 +518,7 @@ Notes: 20-OCT-2003 minimally updated 9-NOV-2015... and again 5-MAY-2019... +and yet again 26-JAN-2020... # NetHack 3.7 Install.vms $NHDT-Date: 1575245132 2019/12/02 00:05:32 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.16 $ # Copyright (c) 2003 by Robert Patrick Rankin diff --git a/sys/wince/.gitattributes b/sys/wince/.gitattributes index 70924b994..5939c3e4c 100644 --- a/sys/wince/.gitattributes +++ b/sys/wince/.gitattributes @@ -1,4 +1,4 @@ *.ce NHSUBST *.mak NHSUBST *.bat NHSUBST -* NH_filestag=(file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.6.5) diff --git a/sys/wince/ceinc/.gitattributes b/sys/wince/ceinc/.gitattributes index e95fe9840..e22da34ef 100644 --- a/sys/wince/ceinc/.gitattributes +++ b/sys/wince/ceinc/.gitattributes @@ -1 +1 @@ -* NH_filestag=(header_file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.6.4) +* NH_filestag=(header_file%s_for_Windows_CE_and_PocketPC_-_untested_for_3.6.5) diff --git a/sys/wince/winhack.rc b/sys/wince/winhack.rc index b928c3b04..a844d5b2c 100644 --- a/sys/wince/winhack.rc +++ b/sys/wince/winhack.rc @@ -284,8 +284,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,6,4,0 - PRODUCTVERSION 3,6,4,0 + FILEVERSION 3,6,5,0 + PRODUCTVERSION 3,6,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x9L @@ -300,17 +300,17 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "NetHack 3.6.4 for Windows CE\0" + VALUE "Comments", "NetHack 3.6.5 for Windows CE\0" VALUE "CompanyName", " \0" VALUE "FileDescription", "nethackm\0" - VALUE "FileVersion", "3, 6, 4, 0\0" + VALUE "FileVersion", "3, 6, 5, 0\0" VALUE "InternalName", "nethackm\0" - VALUE "LegalCopyright", "Copyright © 1985-2019\0" + VALUE "LegalCopyright", "Copyright © 1985-2020\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "nethackm.exe\0" VALUE "PrivateBuild", "090914\0" VALUE "ProductName", "NetHack\0" - VALUE "ProductVersion", "3, 6, 4, 0\0" + VALUE "ProductVersion", "3, 6, 5, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/sys/wince/winhcksp.rc b/sys/wince/winhcksp.rc index 3e5373a2f..377c8e6da 100644 --- a/sys/wince/winhcksp.rc +++ b/sys/wince/winhcksp.rc @@ -260,8 +260,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,6,4,0 - PRODUCTVERSION 3,6,4,0 + FILEVERSION 3,6,5,0 + PRODUCTVERSION 3,6,5,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x9L @@ -276,17 +276,17 @@ BEGIN BEGIN BLOCK "040904b0" BEGIN - VALUE "Comments", "NetHack 3.6.4 for Smartphone 2002\0" + VALUE "Comments", "NetHack 3.6.5 for Smartphone 2002\0" VALUE "CompanyName", " \0" VALUE "FileDescription", "nethackm\0" - VALUE "FileVersion", "3, 6, 4, 0\0" + VALUE "FileVersion", "3, 6, 5, 0\0" VALUE "InternalName", "nethackm\0" - VALUE "LegalCopyright", "Copyright © 1985-2019\0" + VALUE "LegalCopyright", "Copyright © 1985-2020\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "nethackm.exe\0" VALUE "PrivateBuild", "090914\0" VALUE "ProductName", "NetHack For Smartphone\0" - VALUE "ProductVersion", "3, 6, 4, 0\0" + VALUE "ProductVersion", "3, 6, 5, 0\0" VALUE "SpecialBuild", "\0" END END diff --git a/sys/winnt/Install.nt b/sys/winnt/Install.nt index 7ef199034..2c50a4ed2 100644 --- a/sys/winnt/Install.nt +++ b/sys/winnt/Install.nt @@ -16,7 +16,7 @@ contributed the port. Alex Kompel, Dion Nicolaas, Yitzhak Sapir, Derek S. Ray, Michael Allison, Pasi Kallinen, Bart House, and Janet Walz contributed to the maintainance -of the tty and graphical windows versions of NetHack 3.6.4. +of the tty and graphical windows versions of NetHack 3.6.5. You can build a TTY version of NetHack and a Windows Graphical version. You can use one of the following build environments: @@ -151,7 +151,7 @@ a 32-bit x86 version, or a 64-bit x64 version. The default Makefile is set up for a 32-bit x86 version, but that's only because it will run on the most number of existing Windows environments. -NetHack's save files and bones files in the 3.6.4 release have not yet +NetHack's save files and bones files in the 3.6.5 release have not yet evolved enough to allow them to interchange between the 32-bit version and the 64-bit version (or between different platforms). Hopefully that will change in an upcoming release. @@ -164,7 +164,7 @@ I. Dispelling the Myths: We have provided a Makefile for each of the following compilers: - o Microsoft Visual Studio 2015 or 2017 C++ Compiler + o Microsoft Visual Studio 2017 or 2019 C++ Compiler The Community Editions are fine and available at no cost o MinGW 2.0 (with GCC 3.2) diff --git a/sys/winnt/nethack.def b/sys/winnt/nethack.def index 67f372a46..91adc4ec0 100644 --- a/sys/winnt/nethack.def +++ b/sys/winnt/nethack.def @@ -1,5 +1,5 @@ NAME NETHACK -DESCRIPTION 'NetHack 3.6.4 for Windows' +DESCRIPTION 'NetHack 3.6.5 for Windows' EXETYPE WINDOWS STUB 'WINSTUB.EXE' CODE PRELOAD MOVEABLE DISCARDABLE diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 43c106e85..f9e223cf0 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1162,7 +1162,7 @@ VA_DECL(const char *, s) if (iflags.window_inited) end_screen(); buf[0] = '\n'; - (void) vsprintf(&buf[1], s, VA_ARGS); + (void) vsnprintf(&buf[1], sizeof buf - 1, s, VA_ARGS); msmsg(buf); really_move_cursor(); VA_END(); @@ -1980,7 +1980,7 @@ VA_DECL(const char *, fmt) char buf[ROWNO * COLNO]; /* worst case scenario */ VA_START(fmt); VA_INIT(fmt, const char *); - Vsprintf(buf, fmt, VA_ARGS); + (void) vsnprintf(buf, sizeof buf, fmt, VA_ARGS); if (redirect_stdout) fprintf(stdout, "%s", buf); else { diff --git a/sys/winnt/windmain.c b/sys/winnt/windmain.c index 908b0de88..1c547adca 100644 --- a/sys/winnt/windmain.c +++ b/sys/winnt/windmain.c @@ -78,24 +78,34 @@ static struct stat hbuf; extern char orgdir[]; -void +int get_known_folder_path( const KNOWNFOLDERID * folder_id, char * path , size_t path_size) { PWSTR wide_path; - if (FAILED(SHGetKnownFolderPath(folder_id, 0, NULL, &wide_path))) + if (FAILED(SHGetKnownFolderPath(folder_id, 0, NULL, &wide_path))) { error("Unable to get known folder path"); + return FALSE; + } size_t converted; errno_t err; - err = wcstombs_s(&converted, path, path_size, wide_path, path_size - 1); + err = wcstombs_s(&converted, path, path_size, wide_path, _TRUNCATE); CoTaskMemFree(wide_path); - if (err != 0) error("Failed folder path string conversion"); + if (err == STRUNCATE || err == EILSEQ) { + // silently handle this problem + return FALSE; + } else if (err != 0) { + error("Failed folder (%u) path string conversion, unexpected err = %d", folder_id->Data1, err); + return FALSE; + } + + return TRUE; } void @@ -107,14 +117,16 @@ create_directory(const char * path) error("Unable to create directory '%s'", path); } -void +int build_known_folder_path( const KNOWNFOLDERID * folder_id, char * path, size_t path_size, boolean versioned) { - get_known_folder_path(folder_id, path, path_size); + if(!get_known_folder_path(folder_id, path, path_size)) + return FALSE; + strcat(path, "\\NetHack\\"); create_directory(path); if (versioned) { @@ -122,6 +134,7 @@ build_known_folder_path( VERSION_MAJOR, VERSION_MINOR); create_directory(path); } + return TRUE; } void @@ -249,17 +262,22 @@ set_default_prefix_locations(const char *programPath) g.fqn_prefix[TROUBLEPREFIX] = portable_device_path; g.fqn_prefix[DATAPREFIX] = executable_path; } else { - build_known_folder_path(&FOLDERID_Profile, profile_path, - sizeof(profile_path), FALSE); + if(!build_known_folder_path(&FOLDERID_Profile, profile_path, + sizeof(profile_path), FALSE)) + strcpy(profile_path, executable_path); - build_known_folder_path(&FOLDERID_Profile, versioned_profile_path, - sizeof(profile_path), TRUE); + if(!build_known_folder_path(&FOLDERID_Profile, versioned_profile_path, + sizeof(profile_path), TRUE)) + strcpy(versioned_profile_path, executable_path); - build_known_folder_path(&FOLDERID_LocalAppData, - versioned_user_data_path, sizeof(versioned_user_data_path), TRUE); + if(!build_known_folder_path(&FOLDERID_LocalAppData, + versioned_user_data_path, sizeof(versioned_user_data_path), TRUE)) + strcpy(versioned_user_data_path, executable_path); + + if(!build_known_folder_path(&FOLDERID_ProgramData, + versioned_global_data_path, sizeof(versioned_global_data_path), TRUE)) + strcpy(versioned_global_data_path, executable_path); - build_known_folder_path(&FOLDERID_ProgramData, - versioned_global_data_path, sizeof(versioned_global_data_path), TRUE); g.fqn_prefix[SYSCONFPREFIX] = versioned_global_data_path; g.fqn_prefix[CONFIGPREFIX] = profile_path; g.fqn_prefix[HACKPREFIX] = versioned_profile_path; diff --git a/sys/winnt/winnt.c b/sys/winnt/winnt.c index af1944678..bd0d2cf48 100644 --- a/sys/winnt/winnt.c +++ b/sys/winnt/winnt.c @@ -241,11 +241,11 @@ VA_DECL(const char *, s) end_screen(); if (WINDOWPORT("tty")) { buf[0] = '\n'; - (void) vsprintf(&buf[1], s, VA_ARGS); + (void) vsnprintf(&buf[1], sizeof buf - (1 + sizeof "\n"), s, VA_ARGS); Strcat(buf, "\n"); msmsg(buf); } else { - (void) vsprintf(buf, s, VA_ARGS); + (void) vsnprintf(buf, sizeof buf - sizeof "\n", s, VA_ARGS); Strcat(buf, "\n"); raw_printf(buf); } diff --git a/util/makedefs.c b/util/makedefs.c index d7c309cc3..664cf6c62 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -53,7 +53,7 @@ #endif #if defined(UNIX) && !defined(LINT) && !defined(GCC_WARN) -static const char SCCS_Id[] UNUSED = "@(#)makedefs.c\t3.7\t2019/12/17"; +static const char SCCS_Id[] UNUSED = "@(#)makedefs.c\t3.7\t2020/01/18"; #endif /* names of files to be generated */ diff --git a/win/gem/.gitattributes b/win/gem/.gitattributes index 3c4d1eef1..f39d64117 100644 --- a/win/gem/.gitattributes +++ b/win/gem/.gitattributes @@ -1 +1 @@ -* NH_filestag=(file%s_for_GEM_versions_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_GEM_versions_-_untested_for_3.6.5) diff --git a/win/gnome/.gitattributes b/win/gnome/.gitattributes index 6f8e9f364..11c09ee8a 100644 --- a/win/gnome/.gitattributes +++ b/win/gnome/.gitattributes @@ -1 +1 @@ -* NH_filestag=(file%s_for_GNOME_versions_-_untested_for_3.6.4) +* NH_filestag=(file%s_for_GNOME_versions_-_untested_for_3.6.5) diff --git a/win/win32/NetHackW.rc b/win/win32/NetHackW.rc index ee9cbb398..10c67ae28 100644 --- a/win/win32/NetHackW.rc +++ b/win/win32/NetHackW.rc @@ -339,7 +339,7 @@ BEGIN VALUE "FileDescription", "NetHack for Windows - Graphical Interface" VALUE "FileVersion", "3.7.0" VALUE "InternalName", "NetHackW" - VALUE "LegalCopyright", "Copyright (C) 1985 - 2019. By Stichting Mathematisch Centrum and M. Stephenson. See license for details." + VALUE "LegalCopyright", "Copyright (C) 1985 - 2020. By Stichting Mathematisch Centrum and M. Stephenson. See license for details." VALUE "OriginalFilename", "NetHackW.exe" VALUE "PrivateBuild", "140606" VALUE "ProductName", "NetHack" diff --git a/win/win32/mhmap.c b/win/win32/mhmap.c index 7569314a8..51220a041 100644 --- a/win/win32/mhmap.c +++ b/win/win32/mhmap.c @@ -305,9 +305,14 @@ mswin_map_stretch(HWND hWnd, LPSIZE map_size, BOOL redraw) } + /* TODO: Should we round instead of clamping? */ data->xFrontTile = (int) ((double) data->xBackTile * data->frontScale); data->yFrontTile = (int) ((double) data->yBackTile * data->frontScale); + /* ensure tile is at least one pixel in size */ + if (data->xFrontTile < 1) data->xFrontTile = 1; + if (data->yFrontTile < 1) data->yFrontTile = 1; + /* ensure front tile is non-zero in size */ data->xFrontTile = max(data->xFrontTile, 1); data->yFrontTile = max(data->yFrontTile, 1); diff --git a/win/win32/mswproc.c b/win/win32/mswproc.c index 6da8f82c0..2c2153735 100644 --- a/win/win32/mswproc.c +++ b/win/win32/mswproc.c @@ -2318,7 +2318,7 @@ logDebug(const char *fmt, ...) /* Reading and writing settings from the registry. */ #define CATEGORYKEY "Software" #define COMPANYKEY "NetHack" -#define PRODUCTKEY "NetHack 3.6.4" +#define PRODUCTKEY "NetHack 3.6.5" #define SETTINGSKEY "Settings" #define MAINSHOWSTATEKEY "MainShowState" #define MAINMINXKEY "MainMinX" diff --git a/win/win32/nethack.rc b/win/win32/nethack.rc index 0ea2c9d5e..7b3911a08 100644 --- a/win/win32/nethack.rc +++ b/win/win32/nethack.rc @@ -79,7 +79,7 @@ BEGIN VALUE "FileDescription", "NetHack for Windows - TTY Interface" VALUE "FileVersion", "3.7.0" VALUE "InternalName", "NetHack" - VALUE "LegalCopyright", "Copyright (C) 1985 - 2019. By Stichting Mathematisch Centrum and M. Stephenson. See license for details." + VALUE "LegalCopyright", "Copyright (C) 1985 - 2020. By Stichting Mathematisch Centrum and M. Stephenson. See license for details." VALUE "OriginalFilename", "NetHack.exe" VALUE "ProductName", "NetHack" VALUE "ProductVersion", "3.7.0" diff --git a/win/win32/vs2017/NetHackPackage.appxmanifest b/win/win32/vs2017/NetHackPackage.appxmanifest index 8eebc3cc4..12b8d3ad1 100644 --- a/win/win32/vs2017/NetHackPackage.appxmanifest +++ b/win/win32/vs2017/NetHackPackage.appxmanifest @@ -1,6 +1,6 @@  - + NetHack 3.6 NetHack DevTeam diff --git a/win/win32/vs2017/afterdlb.proj b/win/win32/vs2017/afterdlb.proj index fd78ff29f..807fdf7c7 100644 --- a/win/win32/vs2017/afterdlb.proj +++ b/win/win32/vs2017/afterdlb.proj @@ -7,7 +7,7 @@ - + diff --git a/win/win32/vs2017/aftermakedefs.proj b/win/win32/vs2017/aftermakedefs.proj index 52af2a8be..af5fd489c 100644 --- a/win/win32/vs2017/aftermakedefs.proj +++ b/win/win32/vs2017/aftermakedefs.proj @@ -4,14 +4,14 @@ - - - - - - - - + + + + + + + + diff --git a/win/win32/vs2017/aftertile2bmp.proj b/win/win32/vs2017/aftertile2bmp.proj index 44e031223..5fd6d13b0 100644 --- a/win/win32/vs2017/aftertile2bmp.proj +++ b/win/win32/vs2017/aftertile2bmp.proj @@ -4,7 +4,7 @@ - + diff --git a/win/win32/vs2017/aftertilemap.proj b/win/win32/vs2017/aftertilemap.proj index d68eabab9..e576f8b89 100644 --- a/win/win32/vs2017/aftertilemap.proj +++ b/win/win32/vs2017/aftertilemap.proj @@ -4,7 +4,7 @@ - + diff --git a/win/win32/vs2017/afteruudecode.proj b/win/win32/vs2017/afteruudecode.proj index fd0370be4..7f81188ae 100644 --- a/win/win32/vs2017/afteruudecode.proj +++ b/win/win32/vs2017/afteruudecode.proj @@ -4,15 +4,15 @@ - - - - - - - - - + + + + + + + + +