From bc02acb64f5e5ac126bd5e0c6bd3429dc0fa3985 Mon Sep 17 00:00:00 2001 From: Mike Stewart Date: Tue, 28 Feb 2012 09:16:33 -0800 Subject: [PATCH] Fix cursor detection for follow. --- plugins/follow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/follow.cpp b/plugins/follow.cpp index fb72df5eb..ab4bb4a31 100644 --- a/plugins/follow.cpp +++ b/plugins/follow.cpp @@ -77,7 +77,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) gui->getMenuWidth(menu_width, area_map_width); gui->getCursorCoords(c_x,c_y,c_z); - if (c_z == -3000 && menu_width == 3) menu_width = 2; //Presence of the cursor means that there's actually a width-2 menu open + if (c_x == -30000 && menu_width == 3) menu_width = 2; //Presence of the cursor means that there's actually a width-2 menu open h -= 2; //account for vertical borders @@ -114,7 +114,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) gui->setViewCoords(x, y, z); //Set the new screen position! - if (c_x != 3000 && !world->ReadPauseState()) gui->setCursorCoords(c_x - (prevX-x), c_y - (prevY-y), z); //If, for some reason, the cursor is active and the screen is still moving, move the cursor along with the screen + if (c_x != -30000 && !world->ReadPauseState()) gui->setCursorCoords(c_x - (prevX-x), c_y - (prevY-y), z); //If, for some reason, the cursor is active and the screen is still moving, move the cursor along with the screen prevX = x; //Save this round's stuff for next time so we can monitor for changes made by the user prevY = y;