From 07e29bdc3ac75def23dbc191cd2c6b80578531a6 Mon Sep 17 00:00:00 2001 From: myk002 Date: Sat, 15 May 2021 12:05:32 -0700 Subject: [PATCH] use new getCursorCoord call and move suspender up --- plugins/blueprint.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/blueprint.cpp b/plugins/blueprint.cpp index 723e3f1a2..fc8ac5fa2 100644 --- a/plugins/blueprint.cpp +++ b/plugins/blueprint.cpp @@ -722,6 +722,8 @@ static void print_help() command_result blueprint(color_ostream &out, vector ¶meters) { + CoreSuspender suspend; + if (parameters.size() >= 1 && parameters[0] == "gui") { std::ostringstream command; @@ -744,7 +746,6 @@ command_result blueprint(color_ostream &out, vector ¶meters) return options.help ? CR_OK : CR_FAILURE; } - CoreSuspender suspend; if (!Maps::IsValid()) { out.printerr("Map is not available!\n"); @@ -755,16 +756,12 @@ command_result blueprint(color_ostream &out, vector ¶meters) DFCoord start(options.start); if (options.start.x == -30000) { - int32_t x, y, z; - if (!Gui::getCursorCoords(x, y, z)) + if (!Gui::getCursorCoords(options.start)) { out.printerr("Can't get cursor coords! Make sure you specify the" " --cursor parameter or have an active cursor in DF.\n"); return CR_FAILURE; } - start.x = x; - start.y = y; - start.z = z; } if (!Maps::isValidTilePos(start)) {