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

Function saveoptvals

src/options.c:800–819  ·  view source on GitHub ↗

put roleoptvals[][] into save file; will be needed if #saveoptions takes place after restore */

Source from the content-addressed store, hash-verified

798/* put roleoptvals[][] into save file; will be needed if #saveoptions
799 takes place after restore */
800void
801saveoptvals(NHFILE *nhfp)
802{
803 if (update_file(nhfp)) {
804 char *val;
805 unsigned len;
806 int i, j;
807
808 for (i = 0; i < 4; ++i)
809 for (j = 0; j < num_opt_phases; ++j) {
810 val = roleoptvals[i][j];
811 len = val ? Strlen(val) + 1 : 0;
812 Sfo_unsigned(nhfp, &len, "optvals-len");
813 if (val)
814 Sfo_char(nhfp, val, "optvals-val", len);
815 }
816 }
817 if (release_data(nhfp))
818 freeroleoptvals();
819}
820
821/* get roleoptvals[][] from save file */
822void

Callers

nothing calls this directly

Calls 2

update_fileFunction · 0.85
freeroleoptvalsFunction · 0.85

Tested by

no test coverage detected