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

Function dosave

src/save.c:42–70  ·  view source on GitHub ↗

the #save command */

Source from the content-addressed store, hash-verified

40
41/* the #save command */
42int
43dosave(void)
44{
45 clear_nhwindow(WIN_MESSAGE);
46 if (y_n("Really save?") == 'n') {
47 clear_nhwindow(WIN_MESSAGE);
48 if (gm.multi > 0)
49 nomul(0);
50 } else {
51 clear_nhwindow(WIN_MESSAGE);
52 pline("Saving...");
53#if defined(HANGUPHANDLING)
54 program_state.done_hup = 0;
55#endif
56 if (dosave0()) {
57 program_state.savefile_completed++;
58 u.uhp = -1; /* universal game's over indicator */
59 if (soundprocs.sound_exit_nhsound)
60 (*soundprocs.sound_exit_nhsound)("dosave");
61
62 /* make sure they see the Saving message */
63 display_nhwindow(WIN_MESSAGE, TRUE);
64 exit_nhwindows("Be seeing you...");
65 nh_terminate(EXIT_SUCCESS);
66 } else
67 docrt();
68 }
69 return ECMD_OK;
70}
71
72/* returns 1 if save successful */
73int

Callers 3

MainWndProcFunction · 0.85
onWMCommandFunction · 0.85
onWMCommandFunction · 0.85

Calls 5

nomulFunction · 0.85
dosave0Function · 0.85
docrtFunction · 0.85
plineFunction · 0.70
nh_terminateFunction · 0.70

Tested by

no test coverage detected