Commit graph

199 commits

Author SHA1 Message Date
John "Elwin" Edwards
9d5cb81410 srogue: fix backspace key.
Once the full mdport.c is added to srogue, erasechar() will be replaced
with md_erasechar().
2013-08-28 18:54:35 -07:00
John "Elwin" Edwards
6b4b35ba1e arogue5: fix backspace key. 2013-08-28 08:37:56 -07:00
John "Elwin" Edwards
9506edfdc4 Fix some 'test' failures when running 'make install'.
When shell variables are unexpectedly empty, 'test' gets the wrong
number of arguments and becomes unhappy.  Logical AND should not be
done with 'test EXPR1 -a EXPR2' in such cases, because 'test' logic
does not short-circuit.  Replace with 'test EXPR1 && test EXPR2'.
Shell logic does short-circuit, and if the first test invocation
fails, the second will never occur, and will never encounter missing
arguments.
2013-08-27 22:54:28 -07:00
John "Elwin" Edwards
1f1ae55a26 Make sure file_name contains '/' between SAVEDIR and the file name.
Duplicated slashes are not a problem.  Missing slashes are.
2013-08-27 22:25:40 -07:00
John "Elwin" Edwards
5a25cd89da rogue[345]: fix backspace key in prompts.
md_readchar() mapped KEY_BACKSPACE to CTRL-H, but get_str(), which
handles prompts for strings, only backs up when it receives the erase
character.  The key should be mapped to md_erasechar().

This fixes Red Hat Bugzilla #847852.
2013-08-27 09:25:30 -07:00
John "Elwin" Edwards
fef5939ab1 Don't set DESTDIR via configure.
DESTDIR ought to be set via option passed to 'make install'.
2013-08-26 19:58:44 -07:00
John "Elwin" Edwards
4e5449535a rogue3: set missing Makefile variables.
Some variables had been overlooked, which caused the documentation to
be installed in the wrong places.
2013-08-25 21:31:22 -07:00
John "Elwin" Edwards
41aaefc7b9 rogue3: add install and uninstall targets to Makefile. 2013-08-25 19:52:23 -07:00
John "Elwin" Edwards
bd7cb16026 rogue3: update the installation instructions. 2013-08-24 14:07:16 -07:00
John "Elwin" Edwards
60b7a0d98e rogue3: short bows should not be called int bows.
I thought I fixed this already.
2013-08-24 13:50:15 -07:00
John "Elwin" Edwards
7f1fc97497 rogue3: begin porting to autoconf.
Rogue V3 can now be built with './configure && make'.  This is
preliminary: 'make install' does not work yet.
2013-08-24 13:36:13 -07:00
John "Elwin" Edwards
0e8809de2b Don't set the player's ISRUN flag.
rogue4 and rogue5 set the player's ISRUN flag upon exit from sleep or
holding.  This is apparently supposed to indicate that the player can
move again.  What it actually does is make it harder for monsters to
hit the player, until the flag is reset.

As this behavior makes little sense and seems like a cheat, it has
been deemed a bug and removed.
2013-08-13 09:19:56 -07:00
John "Elwin" Edwards
4aa582dfb6 srogue: add arrow-key support.
This is a first attempt which may not be completely portable.
2013-08-10 17:43:58 -07:00
John "Elwin" Edwards
2d117230ed Refuse to restore if the character is dead.
This prevents recovering from death by killing the game between death
and exit, producing an automatic save.
2013-08-09 09:34:07 -07:00
John "Elwin" Edwards
5a47554e45 rogue4: don't delete the savefile if the terminal is too small.
Let the user resize the terminal and try again.
2013-08-08 14:30:12 -07:00
John "Elwin" Edwards
e375c8bd05 Properly handle invalid room references in savefiles.
In all games, rs_write_room_reference() stored -1 for a nonexistent
room, but rs_read_room_reference() did not check for out-of-bounds
values, leading to pointers to rooms[-1], which sometimes caused
crashes.  rs_read_room_reference() has now been modified to use NULL
instead.

Some of the games required further changes to replace NULL with the
pointer to the actual room.  Others are capable of handling NULL for
objects not in any room.
2013-08-08 12:41:35 -07:00
John "Elwin" Edwards
a210387f8d srogue: don't store machine-dependent metadata in the savefile.
Super-Rogue, like Rogue V4, stored data of machine-dependent length in
the savefile, to prevent cheating.  This made saved games non-portable.
Also deleted was a check that used this data, and prevented restoring
savefiles from backup.

This change BREAKS SAVEFILE COMPATIBILITY, but old files can be
converted by removing the block at offset 0x1e with length
sizeof(ino_t) + sizeof(dev_t) + 2 * sizeof(time_t).  That seems to be
0x14 on i686 and 0x20 on x86_64.
2013-08-06 19:02:58 -07:00
John "Elwin" Edwards
fdc346deb1 rogue4: don't put savefile metadata into the savefile.
The save_file() function in save.c stored the savefile's device number,
inode number, creation time, and modification time in the file.  The
restore() function read them back, and apparently used to compare them
to protect against cheaters.

Unfortunately, the types and sizes of these numbers differ from system
to system, which ruins the Roguelike Restoration Project's fine
portability work.  So they have been removed from the savefile.

This BREAKS SAVEFILE COMPATIBILITY, but old files can be converted by
excising the chunk starting at offset 0x22 with length sizeof(ino_t) +
sizeof(dev_t) + 2 * sizeof(time_t).  That's 0x14 on i686 and 0x20 on
x86_64, at least with current versions of Linux and glibc.
2013-08-05 20:49:41 -07:00
John "Elwin" Edwards
7f094a6b77 Add a top-level README.txt. 2013-07-01 07:58:55 -07:00
John "Elwin" Edwards
b6bcf2e3f4 arogue5: make some prayer-related messages appear properly. 2012-09-09 17:58:38 -07:00
John "Elwin" Edwards
ad5245c5f8 arogue5: fix some more drawing to the wrong window.
The spell-choosing and prayer-choosing routines, when the one-line
inventory option is set, displayed to cw instead of msgw.  This caused
permanent corruption of the message line.
2012-09-09 15:55:51 -07:00
John "Elwin" Edwards
cd74a20cc9 arogue5: fix "More" prompt appearing in the wrong place.
The magic and monster detection routines printed "--More--" to cw
instead of msgw, making it appear at the @-sign instead of on the top
line.
2012-09-09 08:55:11 -07:00
John "Elwin" Edwards
8b252e70a9 arogue5: fix player's typed responses getting put at the wrong place.
Some sections of code that prompt the user for a string of input were
calling get_str() with cw (the player-visible screen containing the
map), which caused whatever the player typed to get printed starting at
cw's idea of the cursor position, which was usually the Rogue's @-sign.
This corrupted the map.

The problem has been fixed by passing msgw (the message line at the top
of the screen) to get_str(), so the player's typing appears where msgw
thinks the cursor should be, which is in the sensible place right after
the prompt.  Some other get_str() invocations which used hw or stdscr
have been left unmodified.
2012-09-08 22:05:05 -07:00
John "Elwin" Edwards
5fe41fbc3a arogue5: fix the crash when checking prices in shops.
A buffer called curpurch, which stores a description of an item in a
trading post which the player might be interested in, was only 15
bytes.  It was overflowing into oldrp, a room pointer, leading to
segfaults.  The size of curpurch has been increased to LINELEN*2,
which matches the size of prbuf, which is returned by inv_name and
then strcpy()'d to curpurch.  As long as nothing overflows prbuf it
should be safe now.

NOTE that this breaks savefile compatibility.
2012-09-05 10:14:34 -07:00
John "Elwin" Edwards
f56c5bd801 rogue4: fix "You found you found" bug.
Both search() and tr_name() printed "you found" when a trap was
discovered.  It has been removed from search().
2012-08-20 20:30:19 -07:00
John "Elwin" Edwards
e59194b5ce arogue5: fix support for keypad 5. 2012-08-12 14:45:58 +00:00
John "Elwin" Edwards
355fb33eb7 arogue5: avoid segfaulting if getpwuid() fails. 2012-08-11 23:45:34 +00:00
John "Elwin" Edwards
6e2b154419 arogue5: compile out wizard mode by default. 2012-08-11 21:58:20 +00:00
John "Elwin" Edwards
77dd2bd3b6 arogue5: change default program name and options. 2012-08-11 21:53:49 +00:00
John "Elwin" Edwards
4d11069d9c arogue5: update the score list before prompting to exit. 2012-08-11 20:58:24 +00:00
John "Elwin" Edwards
8c27cf1402 arogue5: add nonl() to prevent CR/LF confusion. 2012-08-11 18:56:32 +00:00
John "Elwin" Edwards
f0527564ea arogue5: add missing header files. 2012-08-11 17:19:03 +00:00
John "Elwin" Edwards
5ce56875ec arogue5: close security holes.
Prevent whoami (player name), file_name, and score_file from being
changed if the systemwide save location is being used.
2012-08-11 16:27:20 +00:00
John "Elwin" Edwards
4c16144c6b arogue5: implement logging. 2012-08-10 21:17:14 +00:00
John "Elwin" Edwards
38a8534eb5 arogue5: add the savedir feature. 2012-08-10 05:16:08 +00:00
John "Elwin" Edwards
14fad3b319 Import Advanced Rogue 5.8 from the Roguelike Restoration Project (r1490) 2012-08-09 22:58:48 +00:00
John "Elwin" Edwards
9ed6e5e369 rogue3, rogue4: fix log message formatting for wins. 2012-08-07 21:17:29 +00:00
John "Elwin" Edwards
6badae1890 rogue3, srogue: showing the version should not take a turn. 2012-05-24 05:10:38 +00:00
John "Elwin" Edwards
5114a73d41 srogue: include missing headers. 2012-01-27 17:29:30 +00:00
John "Elwin" Edwards
0195eba9bb srogue: move default locations to /var. 2012-01-24 18:30:17 +00:00
John "Elwin" Edwards
e26d961c7a rogue3: move default locations to /var. 2012-01-24 18:25:21 +00:00
John "Elwin" Edwards
f0a6e6d37c srogue: don't display a room when a monster steps on a teleport trap. 2011-11-09 18:41:21 +00:00
John "Elwin" Edwards
75f5abe998 Improve support for keypad 5. 2011-10-28 16:00:05 +00:00
John "Elwin" Edwards
0334219850 rogue3: improve keypad support. 2011-10-28 15:45:12 +00:00
John "Elwin" Edwards
617d9499e9 rogue4: update the installation instructions. 2011-10-14 16:47:52 +00:00
John "Elwin" Edwards
955892f163 rogue5: improve defaults for SAVEDIR. 2011-10-14 16:31:58 +00:00
John "Elwin" Edwards
cec13006cf rogue4: improve defaults for SAVEDIR. 2011-10-13 17:44:29 +00:00
John "Elwin" Edwards
1a3828c466 rogue4: ported to autoconf. 2011-10-11 15:20:40 +00:00
John "Elwin" Edwards
a59d5df42b rogue5: make sure SAVEDIR is a directory. 2011-10-10 20:57:51 +00:00
John "Elwin" Edwards
a54b3789c4 rogue5: SAVEDIR off by default, remove generated files from version control. 2011-10-10 15:11:07 +00:00