void init_opt_struct(void) { options = clone_optlist(const_options); birth_options = clone_optlist(const_birth_options); build_role_spec(); build_race_spec(); /* initialize option definitions */ find_option(options, "comment")->s.maxlen = BUFSZ; find_option(options, "disclose")->e = disclose_spec; find_option(options, "fruit")->s.maxlen = PL_FSIZ; find_option(options, "menustyle")->e = menustyle_spec; find_option(options, "pickup_burden")->e = pickup_burden_spec; find_option(options, "packorder")->s.maxlen = MAXOCLASSES; find_option(options, "runmode")->e = runmode_spec; find_option(options, "autopickup_rules")->a = autopickup_spec; find_option(birth_options, "align")->e = align_spec; find_option(birth_options, "gender")->e = gender_spec; find_option(birth_options, "role")->e = role_spec; find_option(birth_options, "race")->e = race_spec; find_option(birth_options, "pettype")->e = pettype_spec; find_option(birth_options, "catname")->s.maxlen = PL_PSIZ; find_option(birth_options, "dogname")->s.maxlen = PL_PSIZ; find_option(birth_options, "horsename")->s.maxlen = PL_PSIZ; /* If no config file exists, these values will not get set until they have already been used during game startup. (-1) is a much better default, as 0 will always cause a lawful male Archologist to be created */ flags.init_align = flags.init_gend = flags.init_race = flags.init_role = -1; }
void initoptions(void) { int i; iflags.travelcc.x = iflags.travelcc.y = -1; flags.warnlevel = 1; flags.warntype = 0L; /* init flags.inv_order this way, as setting it via the option * requires a preexisting order */ memcpy(flags.inv_order, def_inv_order, sizeof flags.inv_order); /* since this is done before init_objects(), do partial init here */ objects[SLIME_MOLD].oc_name_idx = SLIME_MOLD; strncpy(pl_fruit, OBJ_NAME(objects[SLIME_MOLD]), PL_FSIZ); fruitadd(pl_fruit); /* init from option definitions */ for (i = 0; birth_options[i].name; i++) nh_set_option(birth_options[i].name, birth_options[i].value, FALSE); for (i = 0; options[i].name; i++) nh_set_option(options[i].name, options[i].value, FALSE); /* at this point the user may no longer change their birth options. * active_birth_options will recieve birth option changes made during * log replay, so that we can show the user what birth options the * loaded game was started with */ active_birth_options = clone_optlist(birth_options); }
void init_opt_struct(void) { options = clone_optlist(const_options); birth_options = clone_optlist(const_birth_options); build_role_spec(); build_race_spec(); /* initialize option definitions */ find_option(options, "disclose")->e = disclose_spec; find_option(options, "fruit")->s.maxlen = PL_FSIZ; find_option(options, "hp_notify_format")->s.maxlen = 80; /* min term width */ find_option(options, "menumatch")->e = menumatch_spec; find_option(options, "menustyle")->e = menustyle_spec; find_option(options, "pickup_burden")->e = pickup_burden_spec; find_option(options, "packorder")->s.maxlen = MAXOCLASSES; find_option(options, "pilesize")->i.min = 1; find_option(options, "pilesize")->i.max = 20; find_option(options, "runmode")->e = runmode_spec; find_option(options, "safe_peaceful")->e = safe_peaceful_spec; find_option(options, "sparkle")->i.min = 0; find_option(options, "sparkle")->i.max = 21; /* SHIELD_COUNT in display.h */ find_option(options, "spellorder")->s.maxlen = 78; /* "a-bc-d...Y-Z" */ find_option(options, "autopickup_rules")->a = autopickup_spec; find_option(birth_options, "align")->e = align_spec; find_option(birth_options, "gender")->e = gender_spec; find_option(birth_options, "role")->e = role_spec; find_option(birth_options, "race")->e = race_spec; find_option(birth_options, "pettype")->e = pettype_spec; find_option(birth_options, "catname")->s.maxlen = PL_PSIZ; find_option(birth_options, "dogname")->s.maxlen = PL_PSIZ; find_option(birth_options, "horsename")->s.maxlen = PL_PSIZ; find_option(birth_options, "crocname")->s.maxlen = PL_PSIZ; find_option(birth_options, "monkeyname")->s.maxlen = PL_PSIZ; find_option(birth_options, "wolfname")->s.maxlen = PL_PSIZ; find_option(birth_options, "ratname")->s.maxlen = PL_PSIZ; /* If no config file exists, these values will not get set until they * have already been used during game startup. (-1) is a much better * default, as 0 will always cause a lawful male Archologist to be created */ flags.init_align = flags.init_gend = flags.init_race = flags.init_role = -1; }
void initoptions(void) { int i; iflags.travelcc.x = iflags.travelcc.y = -1; flags.warnlevel = 1; flags.warntype = 0L; /* init flags.inv_order this way, as setting it via the option * requires a preexisting order */ memcpy(flags.inv_order, def_inv_order, sizeof flags.inv_order); fruitadd(obj_descr[SLIME_MOLD].oc_name); strncpy(pl_fruit, obj_descr[SLIME_MOLD].oc_name, PL_FSIZ); /* init from option definitions */ for (i = 0; birth_options[i].name; i++) nh_set_option(birth_options[i].name, birth_options[i].value, FALSE); for (i = 0; options[i].name; i++) nh_set_option(options[i].name, options[i].value, FALSE); if (!active_birth_options) { /* at this point the user may no longer change their birth options. * active_birth_options will recieve birth option changes made during * log replay, so that we can show the user what birth options the * loaded game was started with */ active_birth_options = clone_optlist(birth_options); } else { /* the switch to alternate birth options has already happened, * so make sure those settings are active instead. */ for (i = 0; active_birth_options[i].name; i++) { nh_set_option(active_birth_options[i].name, active_birth_options[i].value, FALSE); } } }