toggle any (settable in-game) boolean option by name */
| 9275 | |
| 9276 | /* toggle any (settable in-game) boolean option by name */ |
| 9277 | int |
| 9278 | toggle_bool_option(const char *p) |
| 9279 | { |
| 9280 | int i; |
| 9281 | int ret = ECMD_FAIL; |
| 9282 | |
| 9283 | for (i = 0; i < OPTCOUNT; i++) |
| 9284 | if (!strncmpi(allopt[i].name, p, strlen(p)) |
| 9285 | && allopt[i].opttyp == BoolOpt |
| 9286 | && allopt[i].setwhere == set_in_game |
| 9287 | && allopt[i].addr != 0) { |
| 9288 | char buf[BUFSZ]; |
| 9289 | |
| 9290 | Sprintf(buf, "%s%s", *allopt[i].addr ? "!" : "", allopt[i].name); |
| 9291 | if (parseoptions(buf, FALSE, FALSE)) |
| 9292 | ret = ECMD_OK; |
| 9293 | |
| 9294 | reset_needed_visuals(); |
| 9295 | } |
| 9296 | return ret; |
| 9297 | } |
| 9298 | |
| 9299 | int |
| 9300 | add_autopickup_exception(const char *mapping) |
no test coverage detected