MCPcopy Create free account
hub / github.com/DFHack/dfhack / dig_now_impl

Function dig_now_impl

plugins/dig-now.cpp:1013–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1011}
1012
1013bool 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
1039command_result dig_now(color_ostream &out, std::vector<std::string> &params) {
1040 dig_now_options options;

Callers 2

dig_nowFunction · 0.85
dig_now_tileFunction · 0.85

Calls 4

do_digFunction · 0.85
create_bouldersFunction · 0.85
post_process_dug_tilesFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected