MCPcopy Create free account
hub / github.com/NetHack/NetHack / set_playmode

Function set_playmode

src/options.c:10133–10152  ·  view source on GitHub ↗

set up for wizard mode if player or save file has requested it; called from port-specific startup code to handle `nethack -D' or OPTIONS=playmode:debug, or from dorecover()'s restgamestate() if restoring a game which was saved in wizard mode */

Source from the content-addressed store, hash-verified

10131 OPTIONS=playmode:debug, or from dorecover()'s restgamestate() if
10132 restoring a game which was saved in wizard mode */
10133void
10134set_playmode(void)
10135{
10136 if (wizard) {
10137 if (authorize_wizard_mode())
10138 gp.plnamelen = (int) strlen(strcpy(svp.plname, "wizard"));
10139 else
10140 wizard = FALSE; /* not allowed or not available */
10141 /* try explore mode if we didn't make it into wizard mode */
10142 /* if requesting wizard mode when restoring a normal game, this will
10143 set iflags.deferred_X and prompt to activate explore mode after the
10144 save file has already been deleted */
10145 discover = !wizard;
10146 iflags.deferred_X = FALSE;
10147 }
10148 if (discover && !authorize_explore_mode()) {
10149 discover = iflags.deferred_X = FALSE;
10150 }
10151 /* don't need to do anything special for normal play */
10152}
10153
10154staticfn void
10155enhance_menu_text(

Callers 8

mainFunction · 0.85
libnhmain.cFile · 0.85
MAINFunction · 0.85
mainFunction · 0.85
pcmainFunction · 0.85
restgamestateFunction · 0.85
MAINFunction · 0.85
mainFunction · 0.85

Calls 2

authorize_wizard_modeFunction · 0.50
authorize_explore_modeFunction · 0.50

Tested by

no test coverage detected