annotate rogue3/rogue.6.in @ 111:7f8f43943b1f

Fix some terribly depressing corruption during restore. In rogue5/state.c, rs_read_daemons() zeroes out the argument and delay if the daemon slot is empty. Unfortunately that code ended up on the wrong side of the brace that closes the for loop, so instead of running after each daemon, it got run once after the loop exited, when the index was of course out of bounds. This tended to manifest, when compiled with -O2, by overwriting hw and setting it to NULL. When inventory() next ran, hw would be passed to wgetch(), which returns ERR when it gets a NULL argument. This made md_readchar() think something was wrong and autosave the game. Upon investigation, rogue3 was found to commit the same mistake. rogue4 and srogue don't zero the data. arogue5 already does it properly. Someday I am going to run all this through Valgrind. Someday when I am a kinder person who will not be driven to invoke hordes of trolls and centaurs upon the original authors.
author John "Elwin" Edwards
date Wed, 08 Jan 2014 16:44:16 -0500
parents c191a735f811
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
1 .TH ROGUE 6
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
2 .UC
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
3 .SH NAME
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
4 rogue \- Exploring The Dungeons of Doom
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
5 .SH SYNOPSIS
88
07c4d4883ef2 rogue3: begin porting to autoconf.
John "Elwin" Edwards
parents: 9
diff changeset
6 .B @PROGRAM@
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
7 [ -s ]
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
8 [
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
9 .I save_file
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
10 ]
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
11 [ -n
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
12 .I playername
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
13 ]
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
14 .SH DESCRIPTION
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
15 .PP
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
16 .I Rogue
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
17 is a computer fantasy game with a new twist. It is crt oriented and the
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
18 object of the game is to survive the attacks of various monsters and get
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
19 a lot of gold, rather than the puzzle solving orientation of most computer
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
20 fantasy games.
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
21 .PP
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
22 To get started you really only need to know two commands. The command
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
23 .B ?
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
24 will give you a list of the available commands and the command
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
25 .B /
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
26 will identify the things you see on the screen.
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
27 .PP
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
28 To win the game (as opposed to merely playing to beat other people's high
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
29 scores) you must locate the Amulet of Yendor which is somewhere below
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
30 the 20th level of the dungeon and get it out. Nobody has achieved this
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
31 yet and if somebody does, they will probably go down in history as a hero
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
32 among heros.
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
33 .PP
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
34 When the game ends, either by your death, when you quit, or if you (by
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
35 some miracle) manage to win,
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
36 .I rogue
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
37 will give you a list of the top-ten scorers. The scoring is based entirely
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
38 upon how much gold you get. There is a 10% penalty for getting yourself
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
39 killed.
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
40 .PP
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
41 For more detailed directions, read the document
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
42 .I "A Guide to the Dungeons of Doom."
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
43 .SH OPTIONS
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
44 .PP
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
45 If a
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
46 .I save_file
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
47 argument is given,
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
48 .I rogue
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
49 will attempt to load a previously saved game from that file.
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
50 .PP
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
51 With the
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
52 .B -n
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
53 option,
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
54 .I rogue
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
55 will load a game with the name
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
56 .I playername
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
57 from a location defined at compile time. If no such game exists, it will
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
58 start one.
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
59 .PP
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
60 The
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
61 .B -s
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
62 option prints the top-ten scores list and exits.
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
63
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
64 .SH FILES
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
65 .ta 2i
88
07c4d4883ef2 rogue3: begin porting to autoconf.
John "Elwin" Edwards
parents: 9
diff changeset
66 @SCOREFILE@ Score file
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
67 .br
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
68 ~/rogue3.save Default save file
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
69 .br
106
c191a735f811 Update some of the documentation.
John "Elwin" Edwards
parents: 88
diff changeset
70 @SAVEDIR@ System savefiles
0
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
71 .DT
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
72 .SH SEE ALSO
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
73 Michael C. Toy,
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
74 .I "A Guide to the Dungeons of Doom"
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
75 .SH BUGS
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
76 .PP
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
77 Probably infinite. Currently known bugs are: Sometimes you are still hungry
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
78 even after you eat food and sometimes you get a monster on the screen in
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
79 reverse video which may or may not cause a core dump.
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
80 .SH COPYRIGHT
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
81 Rogue: Exploring the Dungeons of Doom
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
82 .br
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
83 Copyright (C) 1980, 1981 Michael Toy, Ken Arnold and Glenn Wichman
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
84 .br
527e2150eaf0 Import Rogue 3.6 from the Roguelike Restoration Project (r1490)
edwarj4
parents:
diff changeset
85 All rights reserved.
9
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
86 .br
38acf3eb27e6 Update the documentation
edwarj4
parents: 0
diff changeset
87 License: 3-clause BSD, see LICENSE.txt for details.