| 1011 | } |
| 1012 | |
| 1013 | bool dig_now_impl(color_ostream &out, const dig_now_options &options) { |
| 1014 | if (!Maps::IsValid()) { |
| 1015 | out.printerr("Map is not available!\n"); |
| 1016 | return false; |
| 1017 | } |
| 1018 | |
| 1019 | // required for boulder generation |
| 1020 | if (world->units.active.size() == 0) { |
| 1021 | out.printerr("At least one unit must be alive!\n"); |
| 1022 | return false; |
| 1023 | } |
| 1024 | |
| 1025 | // track which positions were modified and where to produce items |
| 1026 | std::vector<DFCoord> dug_coords; |
| 1027 | item_coords_t item_coords; |
| 1028 | |
| 1029 | do_dig(out, dug_coords, item_coords, options); |
| 1030 | create_boulders(out, item_coords, options, world->units.active[0]); |
| 1031 | post_process_dug_tiles(out, dug_coords); |
| 1032 | |
| 1033 | // force the game to recompute its walkability cache |
| 1034 | world->reindex_pathfinding = true; |
| 1035 | |
| 1036 | return true; |
| 1037 | } |
| 1038 | |
| 1039 | command_result dig_now(color_ostream &out, std::vector<std::string> ¶ms) { |
| 1040 | dig_now_options options; |
no test coverage detected