Commit graph

44 commits

Author SHA1 Message Date
John "Elwin" Edwards
35c5e434e6 Rearrange some Autoconf files.
Autoconf was failing to detect install-sh at the top level and needed
some explicit directions.  It also wants config.guess and config.sub to
be provided too.

A few other macros have also been updated.
2023-09-05 20:05:24 -04:00
John "Elwin" Edwards
8a4bf37667 Naming items should not use up a turn.
This was fixed by adding "after = FALSE;" to the relevant cases in
command().

Rogue V4 and V5 are not affected.
2021-10-31 21:35:53 -04:00
John "Elwin" Edwards
6a654fbe69 Update the Autoconf files.
These are mostly automatic updates for obsolete macros.
2021-05-11 22:30:03 -04:00
John "Elwin" Edwards
06cad9ee1e Fix one more batch of compiler warnings.
A few of these were potential bugs.
2021-05-04 21:03:47 -04:00
John "Elwin" Edwards
3dfd8fd09b Advanced Rogue family: fix some potential buffer overflows.
Some code for determining the score file location assumed that PATH_MAX
would be less than 1024, which cannot be guaranteed.

Advanced Rogue 5 and 7, and XRogue, have had the buffers for the file
name enlarged.  UltraRogue never called the functions, so the code has
been deleted instead.
2021-05-03 19:05:37 -04:00
John "Elwin" Edwards
d1422feb80 Fix a few more miscellaneous compiler warnings. 2021-05-01 09:51:30 -04:00
John "Elwin" Edwards
6c3cd116ff Fix many compiler warnings.
There should only be two changes in behavior:

arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly
applied to characters who are not monks instead of monks who are not
empty-handed.

urogue/fight.c: fixed an interaction with the "debug" macro that could
cause the wrong message to be displayed.
2021-04-14 18:55:33 -04:00
John "Elwin" Edwards
7d459d7d36 Fix an assortment of compiler warnings.
A few potential bugs were removed in the process.  Much code cleanup
remains to be done.
2019-11-22 21:18:27 -05:00
John "Elwin" Edwards
de95b19cee Fix another pointer bug related to object stacks. 2018-02-11 15:37:33 -05:00
John "Elwin" Edwards
b855903f99 UltraRogue: clear the next_obj field when removing items from the floor.
The next_obj field is a pointer which the top item in a stack uses to
keep a list of the other items.  When removing an item from the stack,
rem_obj() failed to set next_obj to NULL, which can cause items in
monster inventory to point to items earlier in the inventory list.
That causes infinite co-recursion when saving or restoring.
2018-02-08 20:54:34 -05:00
John "Elwin" Edwards
73a6b21141 Ultra-Rogue: add a NULL check. 2018-02-08 18:56:15 -05:00
John "Elwin" Edwards
5e44d8334d UltraRogue: fix inventory collision after save and restore.
Inventory letters are based on "identifiers" stored in objects' o_ident
field.  Identifiers are allocated by get_ident(), which keeps a list of
objects that have them, to avoid giving the same identifier to multiple
objects.

The list is not stored in the savefile, so after restore, get_ident()
was not aware of existing identifiers.  This resulted in picked-up
objects having the same inventory letters as objects restored from the
file.

The restore code now adds all objects with identifiers to the list.
2018-01-15 20:20:35 -05:00
John "Elwin" Edwards
bb37c1c3f7 Improve the documentation build process.
The choice between troff implementations is now made at configure time,
rather than using shell logic in the Makefile to choose while building.
2017-12-30 14:15:52 -05:00
John "Elwin" Edwards
7fac45d848 UltraRogue: fix changing the score option.
Changing the score file now works again, if use_savedir is not set.  If
it is, an error message is shown.
2017-12-29 17:38:08 -05:00
John "Elwin" Edwards
61e05e655c UltraRogue: ask about unidentified magic items by default. 2017-12-29 14:16:24 -05:00
John "Elwin" Edwards
338214459d Fix a portability issue with md_hasclreol().
Some games' implementation of md_hasclreol() poked around in ncurses
internals, which does not work for some ncurses build configuration.
Most games did not actually call md_hasclreol(), so it was removed.
There is a standard terminfo function which can retrieve the value of
the clr_eol capability, so this was used for rogue5.
2017-12-27 10:26:06 -05:00
John "Elwin" Edwards
a489fa501e UltraRogue: fix options menu.
When displaying options, get_restr() did not position the cursor
correctly, resulting in values being duplicated.
2017-11-26 11:34:45 -05:00
John "Elwin" Edwards
5e60293223 UltraRogue: add a sanity check to do_fuses().
The d_id field, which indicates which fuse function to call, is now
checked to make sure it is not out of range.  do_daemons() already
checks.
2017-11-24 16:22:10 -05:00
John "Elwin" Edwards
1e2f3f5803 UltraRogue: compile out the built-in memory checking.
Functions in memory.c tracked and instrumented memory allocation.  This
mechanism logged information to a text file and also added a 16KB guard
area to every allocation.  Neither of these are desirable in a multi-
user environment, so the whole memory tracking subsystem has been
disabled.

The behavior can be enabled with a configure flag, but it would be a
better idea to use Valgrind to deal with memory bugs.
2017-11-24 13:22:26 -05:00
John "Elwin" Edwards
359d0987a4 Remove version numbers from docdir paths.
Most Unix systems prefer to omit the versions.
2017-10-16 19:53:38 -04:00
John "Elwin" Edwards
79765ae3b2 UltraRogue: don't swap signal handlers.
In md_shellescape(), signal handlers for SIGINT and SIGQUIT were saved
and restored, but exchanged in the process.  This was fixed in the
other games by commit 600873555ec0.

Deleting md_shellescape() might have been a better fix.  It is
apparently unused.
2017-09-29 21:21:50 -04:00
John "Elwin" Edwards
614dcfffd2 Fix more header-related warnings.
This fixes all current default warnings with GCC7 on Linux.  That does
not mean the code is anywhere close to clean.
2017-09-22 16:24:40 -04:00
John "Elwin" Edwards
90d5708d84 Fix a few more compiler warnings. 2017-09-18 19:36:14 -04:00
John "Elwin" Edwards
0936c8f216 Excise md_putchar().
The function wrapped the standard putchar(), doing nothing beside
discarding the return value.  That could cause problems with tputs(),
which expects an int to be returned.
2017-09-18 19:11:57 -04:00
John "Elwin" Edwards
034331e23c UltraRogue: fix Y2K bug on tombstone.
Years were being displayed as "191XX" instead of "20XX".
2017-09-11 17:46:42 -04:00
John "Elwin" Edwards
6164897cfc UltraRogue: prevent bad array accesses in call().
Marking non-magic items caused segfaults because item_color was set to
NULL.  item_type could also be used as an out-of-bounds index.  These
problems have been fixed by only using these variables when the mark
argument is false, in which case they are properly initialized.

A fall-through case statement was also fixed.
2017-09-10 21:04:22 -04:00
John "Elwin" Edwards
b521be16e8 UltraRogue: build and install documentation in the Makefile. 2017-09-09 07:25:23 -04:00
John "Elwin" Edwards
3a9054acbf UltraRogue: add install and uninstall targets to the Makefile. 2017-09-05 21:03:26 -04:00
John "Elwin" Edwards
e3c596c443 UltraRogue: begin autoconfiscation.
Build options can now be set with configure.
2017-09-04 21:08:09 -04:00
John "Elwin" Edwards
6c46840eab UltraRogue: add the autosave feature.
UltraRogue now automatically saves the game when SIGHUP or SIGTERM is
received.
2017-09-03 19:58:22 -04:00
John "Elwin" Edwards
8c77aafa62 UltraRogue: compile out wizard mode by default.
Define WIZARD to enable it.  There will be a configure option for this,
once there is a configure script.
2017-03-05 20:14:11 -05:00
John "Elwin" Edwards
9a9c016bae UltraRogue: check the return value from getpwuid().
It is possible for getpwuid() to return NULL.  Such a failure will no
longer cause a segfault.  However, the call to getpwuid() may normally
not be reachable.
2017-03-01 20:40:18 -05:00
John "Elwin" Edwards
ee3408932f UltraRogue: fix the arrow keys.
The startup sequence now calls keypad() to turn on curses recognition
of special keys.
2017-02-28 21:14:53 -05:00
John "Elwin" Edwards
8eebfc0c85 UltraRogue: add logging.
The log file's name is temporarily defined in main.c.
2017-02-26 16:51:29 -05:00
John "Elwin" Edwards
92d1275f42 UltraRogue: flush output when exiting. 2017-02-26 14:58:49 -05:00
John "Elwin" Edwards
8690ea40f3 UltraRogue: add location for character files.
When using the -n option, UltraRogue will look for character files in a
single location, similar to save files.

The location is chosen by defining CHRDIR in getplay.c, at least until
UltraRogue gets integrated with the build systems.
2017-02-19 19:47:09 -05:00
John "Elwin" Edwards
d309fcdd46 UltraRogue: make scorefile location configurable. 2017-02-15 20:38:12 -05:00
John "Elwin" Edwards
a8a6e1ce7a UltraRogue: fix a segfault related to restoring monsters.
The functions for restoring saved games failed to properly correct the
t_chasee pointer of monsters chasing the player.  Such monsters would
attempt to chase NULL instead, with predictable results.
2017-02-14 20:42:33 -05:00
John "Elwin" Edwards
fc0b18d304 UltraRogue: restrict changing name and save file.
When the -n option is in use, player name and save file location cannot
be changed.  The score file is also restricted.
2017-02-12 20:16:57 -05:00
John "Elwin" Edwards
7b42d453f0 UltraRogue: don't overwrite the savefile name when restoring. 2017-02-09 20:13:25 -05:00
John "Elwin" Edwards
403d9ec171 UltraRogue: add the -n option. 2017-02-09 16:29:45 -05:00
John "Elwin" Edwards
ed27d7a24f UltraRogue: fix crash when restoring.
The r_flags field in struct room was being written as an int and read
as a short.  This caused the restore functions to receive the wrong
data, usually an impossible string length, and abort.

This breaks save compatibility, though the save files had problems
anyway: the r_fires field should have been used, instead of reading and
writing r_flags twice.
2017-02-08 19:50:36 -05:00
John "Elwin" Edwards
b100b40846 UltraRogue: fix various build failures. 2017-01-31 20:33:49 -05:00
John "Elwin" Edwards
11c74c273d Import UltraRogue from the Roguelike Restoration Project (r1490) 2017-01-31 19:56:04 -05:00