diff --git a/plugins/blueprint.cpp b/plugins/blueprint.cpp index 4653b469c..2bc39df29 100644 --- a/plugins/blueprint.cpp +++ b/plugins/blueprint.cpp @@ -1,6 +1,9 @@ -//Blueprint -//By cdombroski -//Translates a region of tiles specified by the cursor and arguments/prompts into a series of blueprint files suitable for digfort/buildingplan/quickfort +/** + * Translates a region of tiles specified by the cursor and arguments/prompts + * into a series of blueprint files suitable for replay via quickfort. + * + * Written by cdombroski. + */ #include #include @@ -43,7 +46,7 @@ command_result blueprint(color_ostream &out, vector ¶meters); DFhackCExport command_result plugin_init(color_ostream &out, vector &commands) { - commands.push_back(PluginCommand("blueprint", "Convert map tiles into a blueprint", blueprint, false)); + commands.push_back(PluginCommand("blueprint", "Record the structure of a live game map in a quickfort blueprint", blueprint, false)); return CR_OK; } @@ -76,10 +79,9 @@ pair get_building_size(df::building* b) return pair(b->x2 - b->x1 + 1, b->y2 - b->y1 + 1); } -char get_tile_dig(MapExtras::MapCache mc, int32_t x, int32_t y, int32_t z) +char get_tile_dig(int32_t x, int32_t y, int32_t z) { - df::tiletype tt = mc.tiletypeAt(DFCoord(x, y, z)); - df::tiletype_shape ts = tileShape(tt); + df::tiletype_shape ts = tileShape(*Maps::getTileType(x, y , z)); switch (ts) { case tiletype_shape::EMPTY: @@ -102,7 +104,6 @@ char get_tile_dig(MapExtras::MapCache mc, int32_t x, int32_t y, int32_t z) return 'r'; default: return ' '; - } } @@ -629,7 +630,6 @@ command_result do_transform(DFCoord start, DFCoord end, string name, uint32_t ph end.z++; } - MapExtras::MapCache mc; for (int32_t z = start.z; z < end.z; z++) { for (int32_t y = start.y; y < end.y; y++) @@ -644,7 +644,7 @@ command_result do_transform(DFCoord start, DFCoord end, string name, uint32_t ph if (phases & BUILD) build << get_tile_build(x, y, b) << ','; if (phases & DIG) - dig << get_tile_dig(mc, x, y, z) << ','; + dig << get_tile_dig(x, y, z) << ','; } if (phases & QUERY) query << "#" << endl;