Commit graph

44 commits

Author SHA1 Message Date
John "Elwin" Edwards
d20fe81e22 Update the Visual Studio project files.
These files were produced by Visual Studio 2015 on Windows 8.1.
2015-08-18 13:23:56 -04:00
John "Elwin" Edwards
097b315235 rogue4: don't try to close the scorefile if it isn't open.
The MSVC library uses a debug assertion to prevent closing file
descriptors that are negative.  This is always the case with the
scoreboard file descriptor if the scoreboard has been compiled out.
2015-07-31 20:12:33 -04:00
John "Elwin" Edwards
4bd72ac69f rogue4: rearrange some includes.
Using MSVC with pdcurses, curses.h has to be included after windows.h
and before process.h.  This is apparently because bool is now a
built-in type which pdcurses is not allowed to redefine.  But I don't
entirely understand how the headers are interacting, and I don't think
the MSDN page does either.
2015-07-31 20:01:44 -04:00
John "Elwin" Edwards
5d0e3dd646 Don't swap signal handlers in md_shellescape().
md_shellescape() sets SIGINT and SIGQUIT to be ignored, storing the
previous handlers, and restores them after the shell exits.  But it
mixed up the two handlers.

Since the signals were usually handled by the same function, this fix
doesn't have much effect, but anything that makes signal code less
confusing is a good thing.
2015-06-08 10:01:25 -04:00
John "Elwin" Edwards
6ab6c944fb Only include one copy of the install-sh script. 2015-06-05 18:02:17 -04:00
John "Elwin" Edwards
321e437f47 Fix a typo in configure.ac.
'test' had been misspelled 'text', and the error had propagated to all
seven games.
2015-06-04 14:48:25 -04:00
John "Elwin" Edwards
832d685d60 rogue4: fix restoring saved games on Windows/MinGW. 2014-05-09 07:52:02 -07:00
John "Elwin" Edwards
be61b1a69e rogue4, arogue5: improve portability.
Most changes merely prevent including header files that don't exist.

All games now build and run on MinGW, though bugs remain.
2014-05-07 14:08:38 -07:00
John "Elwin" Edwards
9a8022c683 Makefiles: don't set defaults for CFLAGS.
CFLAGS is now empty by default.  If its value must be set, it should be
done in the command line for make.
2014-03-29 09:45:33 -07:00
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
0f998b01ad rogue4: don't include config.h if it wasn't created. 2013-09-09 07:58:47 -04:00
John "Elwin" Edwards
720d587422 Rename daemon() to start_daemon().
daemon() conflicted with the standard library function, which is
included by default on OS X.
2013-09-07 08:08:00 -04:00
John "Elwin" Edwards
05b8759305 Update some of the documentation. 2013-09-04 09:01:44 -07:00
John "Elwin" Edwards
36769ea3e4 Add config.h to the list of headers in the Makefiles.
Some .o files need to be rebuilt if config.h changes.  Adding it to the
list of headers may still fail to solve the problem, because some of
the Makefiles use implicit rules or do not list dependencies properly.
2013-09-03 14:14:48 -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
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
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
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
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
9ed6e5e369 rogue3, rogue4: fix log message formatting for wins. 2012-08-07 21:17:29 +00:00
John "Elwin" Edwards
75f5abe998 Improve support for keypad 5. 2011-10-28 16:00:05 +00:00
John "Elwin" Edwards
617d9499e9 rogue4: update the installation instructions. 2011-10-14 16:47:52 +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
4e48fad8ba Make sure lock_sc always returns a value. Fixes a weird bug that prevented the scorelist from updating. 2010-12-14 17:15:51 +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
3a3594dad7 rogue4: move the lockfile to somewhere with write permission 2009-11-26 12:50:17 +00:00
John "Elwin" Edwards
9fc2336c2d Fix variable name 2009-11-26 03:07:54 +00:00
John "Elwin" Edwards
4bc7038945 rogue4: add logging all games 2009-11-26 03:02:13 +00:00
John "Elwin" Edwards
f9c589b480 Add a file include 2009-11-24 13:04:43 +00:00
John "Elwin" Edwards
cfa162874e rogue4: make sure score list appears when exiting 2009-11-24 13:02:34 +00:00
John "Elwin" Edwards
3f546ef2eb rogue4: prevent segfault on getpwuid failure 2009-11-24 12:53:15 +00:00
John "Elwin" Edwards
437daf6c31 rogue4: ask about unidentified objects by default 2009-10-31 15:18:51 +00:00
John "Elwin" Edwards
f433b66dc8 rogue4: prevent changing name or save file when using system savedir 2009-10-31 13:20:00 +00:00
John "Elwin" Edwards
18a08fce7e rogue4: add -n option and system savedir 2009-10-31 01:51:52 +00:00
John "Elwin" Edwards
9f62c197cc Import Rogue 5.2 from the Roguelike Restoration Project (r1490) 2009-10-24 16:52:52 +00:00