Commit graph

40 commits

Author SHA1 Message Date
John "Elwin" Edwards
67ec840c3c Don't truncate player name in savefile name or log message.
The player name is stored in whoami[], which is length 80 in most games
(1024 in rogue5).  Only the first 10 chars were used to create
file_name, because that buffer is the same length.  Increasing the size
of file_name to 256 permits using all of whoami.

The name is also no longer truncated to 20 chars when writing the log.

All games should now be able to handle 79-character names without
collisions.  Anything more would break save compatibility.
2014-03-23 21:27:14 -07:00
John "Elwin" Edwards
082cd54126 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.
2014-01-08 16:44:16 -05:00
John "Elwin" Edwards
05b8759305 Update some of the documentation. 2013-09-04 09:01:44 -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
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
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
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
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
e26d961c7a rogue3: move default locations to /var. 2012-01-24 18:25:21 +00:00
John "Elwin" Edwards
0334219850 rogue3: improve keypad support. 2011-10-28 15:45:12 +00:00
John "Elwin" Edwards
1d8ea533bd Make sure the score list appears in all situations. 2010-12-07 16:46:07 +00:00
John "Elwin" Edwards
8d570c89a5 Fix the playback bug which was caused by CR/LF confusion 2010-02-16 00:03:06 +00:00
John "Elwin" Edwards
8d7895dd3b Added INSTALL.txt files 2010-02-13 16:25:29 +00:00
John "Elwin" Edwards
b24bc2e606 Slightly modify savefile location and prompt 2010-01-01 15:04:30 +00:00
John "Elwin" Edwards
6188fd3be2 rogue3: allow load and user count checks to be compiled out 2009-12-29 12:45:38 +00:00
John "Elwin" Edwards
ab5d57406c Record experience level in the logfile too 2009-11-16 23:54:24 +00:00
John "Elwin" Edwards
777682dba6 rogue3: improve log messages when Amulet is found 2009-11-12 12:53:29 +00:00
John "Elwin" Edwards
ce560d937c rogue3: move file locations from Makefile to machdep.h 2009-11-11 12:28:25 +00:00
John "Elwin" Edwards
bbec0d0514 rogue3: make LOGFILE work with SAVEDIR 2009-11-11 02:41:47 +00:00
John "Elwin" Edwards
acb1a4fce9 More conflict. Change log to writelog. 2009-11-10 23:46:48 +00:00
John "Elwin" Edwards
70a8187173 Change logf to logfi 2009-11-10 22:48:16 +00:00
John "Elwin" Edwards
bd3b2e4e53 rogue3: add the option of logging all games to a text file 2009-11-10 22:38:46 +00:00
John "Elwin" Edwards
bcc2abe517 Allow wizard mode to be compiled out 2009-10-24 14:50:44 +00:00
John "Elwin" Edwards
d480eff297 Further updates to the documentation 2009-10-24 14:21:15 +00:00
John "Elwin" Edwards
4d3813ab4d Update the documentation 2009-10-24 14:12:26 +00:00
John "Elwin" Edwards
9f9abbf368 Make sure all output appears when exiting 2009-10-23 01:38:53 +00:00
John "Elwin" Edwards
67250dfc74 Don't autosave on segfault or after death 2009-10-16 14:40:16 +00:00
John "Elwin" Edwards
2ff3dc0619 Fix segfault on getpwuid failure 2009-10-16 14:30:06 +00:00
John "Elwin" Edwards
c59dd4061d Ask about unidentified objects by default 2009-10-16 14:21:24 +00:00
John "Elwin" Edwards
f2dc426ae7 Change the default binary name to rogue3 2009-10-15 01:26:19 +00:00
John "Elwin" Edwards
de9a05892e Rest on '.' instead of ' ', like all the other roguelikes 2009-10-15 01:22:54 +00:00
John "Elwin" Edwards
5cc5f36a58 Prevent changing name or save file when using system savedir 2009-10-14 11:21:33 +00:00
John "Elwin" Edwards
265ac56d38 Add -n option and system savedir functionality 2009-10-14 01:32:13 +00:00
John "Elwin" Edwards
4662bbf65b Import Rogue 3.6 from the Roguelike Restoration Project (r1490) 2009-10-13 13:33:34 +00:00