yet more wizard mode handling (trunk only)
Reorganize the recent wizard mode control: move set_playmode() from
xxxmain.c to the core, and have it call new authorize_wizard_mode() to do
the port-specific part. If the set_playmode() call during startup doesn't
result in running in wizard mode (either because not allowed or user
didn't request it), it will be called again during restore if the save
file is from a wizard mode game.
For ports which check character name for authorization, players will
have to use `nethack -u whatever -D' (or options for name and playmode) to
restore a wizard mode save file if WIZARD has been changed from "wizard".
plname[] from a wizard mode saved game will always have that value, so if
it's not the right one players will need to get authorized by the startup
code before loading the save file.
This commit is contained in:
@@ -988,6 +988,10 @@ E int FDECL(macwrite, (int,void *,unsigned));
|
||||
E long FDECL(macseek, (int,long,short));
|
||||
E int FDECL(macunlink, (const char *));
|
||||
|
||||
/* ### macmain.c ### */
|
||||
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
|
||||
/* ### macsnd.c ### */
|
||||
|
||||
E void FDECL(mac_speaker, (struct obj *,char *));
|
||||
@@ -1574,6 +1578,7 @@ E int FDECL(load_symset, (const char *,int));
|
||||
E void FDECL(parsesymbols, (char *));
|
||||
E struct symparse *FDECL(match_sym, (char *));
|
||||
#endif
|
||||
E void NDECL(set_playmode);
|
||||
|
||||
/* ### pager.c ### */
|
||||
|
||||
@@ -1592,6 +1597,7 @@ E int FDECL(do_look, (int, coord *));
|
||||
# ifdef CHDIR
|
||||
E void FDECL(chdirx, (char *,BOOLEAN_P));
|
||||
# endif /* CHDIR */
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
#endif /* MICRO || WIN32 */
|
||||
|
||||
/* ### pcsys.c ### */
|
||||
@@ -2280,9 +2286,9 @@ E int FDECL(flash_hits_mon, (struct monst *,struct obj *));
|
||||
E void NDECL(port_help);
|
||||
# endif
|
||||
E void FDECL(sethanguphandler, (void (*)(int)));
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
#endif /* UNIX */
|
||||
|
||||
|
||||
/* ### unixtty.c ### */
|
||||
|
||||
#if defined(UNIX) || defined(__BEOS__)
|
||||
@@ -2409,6 +2415,7 @@ E int FDECL(main, (int, char **));
|
||||
E void FDECL(chdirx, (const char *,BOOLEAN_P));
|
||||
# endif /* CHDIR */
|
||||
E void FDECL(sethanguphandler, (void (*)(int)));
|
||||
E boolean NDECL(authorize_wizard_mode);
|
||||
|
||||
/* ### vmsmisc.c ### */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user