1 /* NetHack 3.6 sys.c $NHDT-Date: 1448241785 2015/11/23 01:23:05 $ $NHDT-Branch: master $:$NHDT-Revision: 1.35 $ */
2 /* Copyright (c) Kenneth Lorber, Kensington, Maryland, 2008. */
3 /* NetHack may be freely redistributed. See license for details. */
8 /* !SYSCF configurations need '#define DEBUGFILES "foo.c bar.c"'
9 * to enable debugging feedback for source files foo.c and bar.c;
10 * to activate debugpline(), set an appropriate value and uncomment
12 /* # define DEBUGFILES "*" */
14 /* note: DEBUGFILES value here or in sysconf.DEBUGFILES can be overridden
15 at runtime by setting up a value for "DEBUGFILES" in the environment */
23 sysopt
.support
= (char *) 0;
24 sysopt
.recover
= (char *) 0;
26 sysopt
.wizards
= (char *) 0;
28 sysopt
.wizards
= dupstr(WIZARD_NAME
);
30 #if defined(SYSCF) || !defined(DEBUGFILES)
31 sysopt
.debugfiles
= (char *) 0;
33 sysopt
.debugfiles
= dupstr(DEBUGFILES
);
35 sysopt
.env_dbgfl
= 0; /* haven't checked getenv("DEBUGFILES") yet */
36 sysopt
.shellers
= (char *) 0;
37 sysopt
.explorers
= (char *) 0;
38 sysopt
.maxplayers
= 0; /* XXX eventually replace MAX_NR_OF_PLAYERS */
41 sysopt
.persmax
= PERSMAX
;
42 sysopt
.entrymax
= ENTRYMAX
;
43 sysopt
.pointsmin
= POINTSMIN
;
44 sysopt
.pers_is_uid
= PERS_IS_UID
;
45 sysopt
.tt_oname_maxrank
= 10;
54 if (PERS_IS_UID
!= 0 && PERS_IS_UID
!= 1)
55 panic("config error: PERS_IS_UID must be either 0 or 1");
59 sysopt
.gdbpath
= dupstr(GDBPATH
);
60 sysopt
.greppath
= dupstr(GREPPATH
);
62 sysopt
.panictrace_gdb
= 1;
63 #ifdef PANICTRACE_LIBC
64 sysopt
.panictrace_libc
= 2;
67 sysopt
.panictrace_gdb
= 0;
68 #ifdef PANICTRACE_LIBC
69 sysopt
.panictrace_libc
= 0;
74 sysopt
.check_save_uid
= 1;
75 sysopt
.check_plname
= 0;
76 sysopt
.seduce
= 1; /* if it's compiled in, default to on */
77 sysopt_seduce_set(sysopt
.seduce
);
85 free((genericptr_t
) sysopt
.support
), sysopt
.support
= (char *) 0;
87 free((genericptr_t
) sysopt
.recover
), sysopt
.recover
= (char *) 0;
89 free((genericptr_t
) sysopt
.wizards
), sysopt
.wizards
= (char *) 0;
91 free((genericptr_t
) sysopt
.explorers
), sysopt
.explorers
= (char *) 0;
93 free((genericptr_t
) sysopt
.shellers
), sysopt
.shellers
= (char *) 0;
94 if (sysopt
.debugfiles
)
95 free((genericptr_t
) sysopt
.debugfiles
),
96 sysopt
.debugfiles
= (char *) 0;
99 free((genericptr_t
) sysopt
.gdbpath
), sysopt
.gdbpath
= (char *) 0;
101 free((genericptr_t
) sysopt
.greppath
), sysopt
.greppath
= (char *) 0;
103 /* this one's last because it might be used in panic feedback, although
104 none of the preceding ones are likely to trigger a controlled panic */
105 if (sysopt
.fmtd_wizard_list
)
106 free((genericptr_t
) sysopt
.fmtd_wizard_list
),
107 sysopt
.fmtd_wizard_list
= (char *) 0;
111 extern struct attack sa_yes
[NATTK
];
112 extern struct attack sa_no
[NATTK
];
115 sysopt_seduce_set(val
)
118 struct attack
*setval
= val
? sa_yes
: sa_no
;
121 for (x
= 0; x
< NATTK
; x
++) {
122 mons
[PM_INCUBUS
].mattk
[x
] = setval
[x
];
123 mons
[PM_SUCCUBUS
].mattk
[x
] = setval
[x
];