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

Function feature_alert_opts

src/options.c:7557–7585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7555 */
7556
7557staticfn int
7558feature_alert_opts(char *op, const char *optn)
7559{
7560 char buf[BUFSZ];
7561 unsigned long fnv = get_feature_notice_ver(op); /* version.c */
7562
7563 if (fnv == 0L)
7564 return 0;
7565 if (fnv > get_current_feature_ver()) {
7566 if (!go.opt_initial) {
7567 You_cant("disable new feature alerts for future versions.");
7568 } else {
7569 config_error_add(
7570 "%s=%s Invalid reference to a future version ignored",
7571 optn, op);
7572 }
7573 return 0;
7574 }
7575
7576 flags.suppress_alert = fnv;
7577 if (!go.opt_initial) {
7578 Sprintf(buf, "%lu.%lu.%lu", FEATURE_NOTICE_VER_MAJ,
7579 FEATURE_NOTICE_VER_MIN, FEATURE_NOTICE_VER_PATCH);
7580 pline(
7581 "Feature change alerts disabled for NetHack %s features and prior.",
7582 buf);
7583 }
7584 return 1;
7585}
7586
7587/*
7588 * This is used by parse_config_line() in files.c

Callers 1

optfn_suppress_alertFunction · 0.85

Calls 5

get_feature_notice_verFunction · 0.85
get_current_feature_verFunction · 0.85
You_cantFunction · 0.85
config_error_addFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected