annotate arogue5/acinclude.m4 @ 227:696277507a2e

Rogue V4, V5: disable a cheat granting permanent monster detection. In these two games, a potion of monster detection turns on the player's SEEMONST flag. A fuse is set to call turn_see() to turn the flag back off. But the save and restore functions do not recognize turn_see() and fail to set the fuse up again. When restoring, Rogue V4 merely sets the fuse's function to NULL and leaves it burning. When it goes off, a segfault results. Rogue V5 clears all the fuse's fields, and the player retains the ability to see all monsters on the level. The save and restore code can now handle the fuse. The function used is a new wrapper, turn_see_off(), which should lead to less problems with daemons being multiple incompatible types. Also, Rogue V4 and Super-Rogue now properly clear unrecognized daemon and fuse slots when restoring a saved game.
author John "Elwin" Edwards
date Sat, 05 Mar 2016 12:10:20 -0500
parents dfeed24bb616
children 029c1f5c5588
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
99
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
1 AC_DEFUN([MP_WITH_CURSES],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
2 [AC_ARG_WITH(ncurses, [ --with-ncurses Force the use of ncurses over curses],,)
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
3 mp_save_LIBS="$LIBS"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
4 CURSES_LIB=""
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
5 if test "$with_ncurses" != yes
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
6 then
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
7 AC_CACHE_CHECK([for working curses], mp_cv_curses,
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
8 [LIBS="$LIBS -lcurses"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
9 AC_TRY_LINK(
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
10 [#include <curses.h>],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
11 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
12 mp_cv_curses=yes, mp_cv_curses=no)])
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
13 if test "$mp_cv_curses" = yes
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
14 then
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
15 AC_DEFINE(HAVE_CURSES_H, 1, [Define to 1 if libcurses is requested])
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
16 #AC_DEFINE(HAVE_CURSES_H)
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
17 CURSES_LIB="-lcurses"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
18 fi
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
19 fi
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
20 if test ! "$CURSES_LIB"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
21 then
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
22 AC_CACHE_CHECK([for working ncurses], mp_cv_ncurses,
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
23 [LIBS="$mp_save_LIBS -lncurses"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
24 AC_TRY_LINK(
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
25 [#include <ncurses.h>],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
26 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
27 mp_cv_ncurses=yes, mp_cv_ncurses=no)])
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
28 if test "$mp_cv_ncurses" = yes
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
29 then
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
30 AC_DEFINE(HAVE_NCURSES_H, 1, [Define to 1 if libncurses is requested])
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
31 CURSES_LIB="-lncurses"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
32 fi
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
33 fi
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
34 if test ! "$CURSES_LIB"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
35 then
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
36 AC_CACHE_CHECK([for working pdcurses], mp_cv_pdcurses,
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
37 [LIBS="$mp_save_LIBS -lpdcurses"
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
38 AC_TRY_LINK(
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
39 [#include <curses.h>],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
40 [chtype a; int b=A_STANDOUT, c=KEY_LEFT; initscr(); ],
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
41 mp_cv_pdcurses=yes, mp_cv_pdcurses=no)])
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
42 if test "$mp_cv_pdcurses" = yes
dfeed24bb616 arogue5: port to autoconf.
John "Elwin" Edwards
parents:
diff changeset
43 then