Commit graph

318 commits

Author SHA1 Message Date
John "Elwin" Edwards
8fed78336a ARogue family: don't hide messages caused by moving to a new level.
new_level() redraws the whole screen, including the message line, so if
msg() has just been called, the message will likely not last long
enough to be noticed.  These cases have been changed so that msg() is
called after new_level().

If a fall through a trapdoor is fatal, "You fall into a trap!" is no
longer printed, but the tombstone should make things clear.
2015-06-29 20:37:32 -04:00
John "Elwin" Edwards
419a920e1d arogue7, xrogue: fix uninitialized variables when restoring.
The save and restore code assumed sizeof(long) == 4, which is not the
case on x64.  Reading only 4 bytes from the savefile left the others
uninitialized, which led to problems like billions of experience points
or gold pieces.
2015-06-26 11:42:02 -04:00
John "Elwin" Edwards
c639303acf arogue7: comment out a problematic message.
This line causes a segfault on x64.  I suspect one of the char*
arguments to msg() is being corrupted.  But gdb doesn't make it easy
to debug variadic functions, and the crash doesn't occur when running
under valgrind.  So the message is being removed until I can discover
the root of the problem.
2015-06-26 11:32:37 -04:00
John "Elwin" Edwards
3c792f4898 Move some autotools files to where configure can find them.
rogue5 uses config.guess and config.sub to find the canonical system
names.  The configure script expects them to be in the same directory
as install-sh.  So they have been relocated to the top level.

This is a quick and dirty fix.  The eventual plan is to relocate them
to /dev/null.

I also suspect they should be used to set HOST, not TARGET.  Rogue is
not a cross-compiler.
2015-06-16 11:44:49 -04:00
John "Elwin" Edwards
79a736fd0b arogue7: fix a display bug when viewing inventory after restoring.
The restore() function displayed a status message via wprintw() instead
of using the msg() functions.  If the inventory was then viewed before
a call to msg(), msgw would obscure the first lines of the inventory
list.

There are surely more bugs related to messages.
2015-06-12 12:09:16 -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
3a456017a7 arogue7, xrogue: set CFLAGS empty by default in the Makefiles. 2015-06-05 14:06:11 -04:00
John "Elwin" Edwards
ec3e34544a arogue7, xrogue: fix configure's wizardmode and limitscore options.
WIZARD and LIMITSCORE, when set by options to './configure', are no
longer overridden in mach_dep.h.
2015-06-05 13:57:38 -04:00
John "Elwin" Edwards
cfe8f3c281 arogue7, xrogue: add 'install' targets to Makefiles.
'make install' and 'make uninstall' should now work as expected.
2015-06-04 17:08:40 -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
d3c281122c arogue7, xrogue: begin using autoconf.
File locations can be customized via './configure'.  'make install'
does not work yet.  Options for wizard mode and load checks may not do
what is intended.

Fun fact: there's an enlightening epigraph in the introduction to the
autoconf manual.
2015-06-04 10:41:39 -04:00
John "Elwin" Edwards
97ef6ee2df arogue7, xrogue: fix save/restore of alchemy jugs.
state.c now saves the fuse that refills alchemy jugs, using the method
of numbering objects previously applied to Advanced Rogue 5.  Alchemy
jugs that are empty when the game is saved will continue to function
after it is restored.

Savefile compatibility should not be affected.
2015-05-29 17:34:04 -04:00
John "Elwin" Edwards
3232b9e4ba Mention arogue7 and xrogue in the README. 2015-05-28 15:39:28 -04:00
John "Elwin" Edwards
f5bd700b2d xrogue: escaping to a shell should not cause a move to the left.
This was due to the classic error of forgetting a break statement.
2015-05-28 13:51:01 -04:00
John "Elwin" Edwards
37cc3eeaba arogue7, xrogue: fix command repetition.
In both games, command() loops and calls the action function twice for
each command: once to schedule it by setting player.t_action and
player.t_no_move, and again, to actually do it, once player.t_no_move
has been reduced to 0.  Each loop decremented count, so repeated
commands were only repeated half the number of times the player typed.

count is now decremented only when ch has been set to the repeated
command.
2015-05-28 11:08:03 -04:00
John "Elwin" Edwards
4e5f4c52d3 arogue7, xrogue: rename daemon() to start_daemon().
This prevents conflict with the BSD/OSX daemon() system function.
2015-05-28 10:21:43 -04:00
John "Elwin" Edwards
b369d09125 arogue7: fix the backspace key in prompts.
md_readchar() now translates KEY_BACKSPACE to the erase character.

XRogue seems to work already.
2015-05-28 09:41:29 -04:00
John "Elwin" Edwards
d793ca961f arogue7, xrogue: add support for keypad 5.
Keypad 5 is now equivalent to the '.' key.

XRogue does not include md_readchar() and its ability to work around
deficiencies in the terminfo entry. So the key will not be recognized
in screen/tmux or anywhere else without the kb2 capability.  Adding
md_readchar() would be more complex than it was for Super-Rogue, since
XRogue already does KEY_* interpretation in command().
2015-05-27 17:29:32 -04:00
John "Elwin" Edwards
94b05cac99 arogue7: ask about unidentified objects by default.
The 'askme' option is on in some games and off in others, probably due
to authorial preference.  I am going to be consistent and turn it on in
all of them.
2015-05-21 09:02:15 -04:00
John "Elwin" Edwards
053a248658 arogue7, xrogue: put newlines at the end of startup messages. 2015-05-20 15:15:29 -04:00
John "Elwin" Edwards
faa24df096 xrogue: add an exit prompt.
This gives the player a chance to see the high score list when playing
via dgamelaunch.
2015-05-20 12:51:16 -04:00
John "Elwin" Edwards
e3620a3781 Advanced Rogue family: fix the "score" option.
Changing the score file (when permitted) now works again, closing the
old score file and opening the new one.
2015-05-20 08:42:17 -04:00
John "Elwin" Edwards
ea4244de91 arogue7, xrogue: prevent potential NULL dereferencing.
It is possible for getpwuid() to fail and return NULL.  Various md_get*
functions now check for this.
2015-05-18 10:53:22 -04:00
John "Elwin" Edwards
3554339257 Advanced Rogue family: overhaul privilege handling.
Advanced Rogue 5 and 7, and XRogue, now open the scorefile and logfile
at startup and then drop any set[ug]id privileges if the savedir is not
being used.
2015-05-16 13:39:26 -04:00
John "Elwin" Edwards
1a5e14ad9b Merge arogue7 and xrogue trees. 2015-05-12 21:39:39 -04:00
John "Elwin" Edwards
3bcf8ac2c1 arogue7: prevent segfaults when backstabbing while empty-handed.
The calculation of the backstabbing multiplier checked the current
weapon's properties without making sure the current weapon pointer was
not NULL.
2015-05-12 18:57:30 -04:00
John "Elwin" Edwards
e8f5429554 arogue7: call nonl() during initialization. 2015-05-12 10:28:05 -04:00
John "Elwin" Edwards
e4d23af7c5 arogue7: record completed games in a logfile. 2015-05-12 09:55:05 -04:00
John "Elwin" Edwards
b6ab08176a arogue7: prevent changing protected options.
When using the savedir, whoami, file_name, and score_file cannot be
changed.
2015-05-11 19:41:46 -04:00
John "Elwin" Edwards
7824f79164 arogue7: implement the -n option. 2015-05-11 16:46:00 -04:00
John "Elwin" Edwards
7da765d616 arogue7: make the scorefile location configurable. 2015-05-11 13:36:36 -04:00
John "Elwin" Edwards
3095366864 arogue7: add missing header includes. 2015-05-08 16:45:41 -04:00
John "Elwin" Edwards
cf121ade21 Import Advanced Rogue 7.7 from the Roguelike Restoration Project (r1490) 2015-05-08 15:24:40 -04:00
John "Elwin" Edwards
fe8a158d6a xrogue: call nonl() during initialization.
This prevents some confusion between CR and LF characters.
2015-05-05 20:54:33 -04:00
John "Elwin" Edwards
fb870fdb4e xrogue: don't segfault when backstabbing while empty-handed.
The code for backstabbing checked the weapon's properties without
making sure it was not NULL.
2015-05-05 12:12:20 -04:00
John "Elwin" Edwards
85a0b26fa3 xrogue: compile out wizard mode by default. 2015-05-05 12:07:12 -04:00
John "Elwin" Edwards
9c0cafd74d xrogue: record the result of each game in a logfile. 2015-05-05 11:24:02 -04:00
John "Elwin" Edwards
283506baf9 xrogue: restrict changes to the save file location.
When using the -n option, disallow changing file_name or whoami via
options or dialogs.
2015-05-02 07:31:14 -04:00
John "Elwin" Edwards
e35502804b xrogue: initial support for the -n option.
The scorefile location is also configurable now.
2015-04-22 16:03:00 -04:00
John "Elwin" Edwards
dec970210b xrogue: add missing includes.
This prevents some warnings.
2015-04-21 10:34:01 -04:00
John "Elwin" Edwards
02cec53f85 xrogue: fix definition of struct delayed_action.
Arrays of struct delayed_action were declared before the definition.
Also, daemon.c and state.c defined it differently.  The state.c
definition, in which d_arg is a union, is now used everywhere.

This is the least bad option, but fuses and daemons are still a
disheartening morass that undoubtedly shelters more bugs.
2015-04-21 10:11:02 -04:00
John "Elwin" Edwards
034d8d6484 Import XRogue 8.0 from the Roguelike Restoration Project (r1490) 2015-04-21 08:55:20 -04:00
John "Elwin" Edwards
6af92da76a rogue5: ignore the file name stored in the save file.
state.c had put file_name into the save file.  The saved value was used
to overwrite file_name on restore.  If the save file had been renamed,
unlink(file_name) would then fail, because file_name held the old name.

To avoid breaking savefile compatibility, file_name is still saved, but
it is read back into a temporary buffer and then ignored.

I thought I fixed this already.
2015-01-16 13:42:30 -05: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
120beada5a srogue: more compatibility improvements.
Randomness now uses mdport, and xcrypt.c has been replaced with the
rogue5 version.

Super-Rogue now builds on MinGW.
2014-05-03 10:31:30 -07:00
John "Elwin" Edwards
b9cc9cf3a7 srogue: add and use more md_* portable functions.
Privileges and memory usage checks are now more portable.
2014-05-02 15:06:23 -07:00
John "Elwin" Edwards
791df4324f srogue: use functions from mdport.c.
Shell escape, passwd entries, terminal settings, and most signal
handling is now done with the more portable md_* functions.
2014-04-30 14:46:30 -07:00
John "Elwin" Edwards
de1e0f2759 srogue: add a complete mdport.c.
srogue/mdport.c is copied from rogue5/mdport.c, with slight changes.
2014-04-27 08:29:14 -07:00