| 509 | } |
| 510 | |
| 511 | static bool ConLoadHeightmap(std::span<std::string_view> argv) |
| 512 | { |
| 513 | if (argv.empty()) { |
| 514 | IConsolePrint(CC_HELP, "Load a heightmap by name or index. Usage: 'load_heightmap <file | number>'."); |
| 515 | return true; |
| 516 | } |
| 517 | |
| 518 | if (argv.size() != 2) return false; |
| 519 | |
| 520 | std::string_view file = argv[1]; |
| 521 | _console_file_list_heightmap.ValidateFileList(); |
| 522 | const FiosItem *item = _console_file_list_heightmap.FindItem(file); |
| 523 | if (item != nullptr) { |
| 524 | if (item->type.abstract == FT_HEIGHTMAP) { |
| 525 | _switch_mode = SM_START_HEIGHTMAP; |
| 526 | _file_to_saveload.Set(*item); |
| 527 | } else { |
| 528 | IConsolePrint(CC_ERROR, "'{}' is not a heightmap.", file); |
| 529 | } |
| 530 | } else { |
| 531 | IConsolePrint(CC_ERROR, "'{}' cannot be found.", file); |
| 532 | } |
| 533 | |
| 534 | return true; |
| 535 | } |
| 536 | |
| 537 | static bool ConRemove(std::span<std::string_view> argv) |
| 538 | { |
nothing calls this directly
no test coverage detected