From 1220f6692c694cd9751100a600ae3ae98c1367e3 Mon Sep 17 00:00:00 2001 From: myk002 Date: Tue, 29 Jun 2021 23:04:06 -0700 Subject: [PATCH] simplify as per code review --- plugins/tiletypes.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp index a9cbe1a6e..1916f62a4 100644 --- a/plugins/tiletypes.cpp +++ b/plugins/tiletypes.cpp @@ -755,20 +755,19 @@ command_result executePaintJob(color_ostream &out, uint32_t x_max = 0, y_max = 0, z_max = 0; Maps::getSize(x_max, y_max, z_max); - DFCoord cursor; + df::coord cursor; if (Maps::isValidTilePos(opts.cursor)) { cursor = opts.cursor; } else { - int32_t x = 0, y = 0, z = 0; - if (!Gui::getCursorCoords(x,y,z)) + cursor = Gui::getCursorPos(); + if (!cursor.isValid()) { out.printerr("Can't get cursor coords! Make sure you have a cursor active in DF or specify the --cursor option.\n"); return CR_FAILURE; } - cursor = DFCoord(x, y, z); } if (!opts.quiet)