changeset 1830:5ea627a263dd

Clicking works again
author Nomad
date Fri, 11 Oct 2013 10:41:12 +0200
parents e4e27261d84e
children f017f8e79aa1 f094bfb4ba31
files Mouse.cpp OSWindow.cpp
diffstat 2 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Mouse.cpp	Fri Oct 11 07:29:14 2013 +0200
+++ b/Mouse.cpp	Fri Oct 11 10:41:12 2013 +0200
@@ -512,7 +512,9 @@
     y = pY;
     x = pX;
   }
-  if ( pCurrentScreen != SCREEN_GAME)// || !dword_507B98_ctrl_pressed ) // stealing cursor
+
+  extern bool _507B98_ctrl_pressed;
+  if ( pCurrentScreen != SCREEN_GAME || !_507B98_ctrl_pressed ) // stealing cursor
     goto LABEL_30;
   v4 = GetCurrentMenuID();
   x = pX;
@@ -580,7 +582,9 @@
   else
     v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]];
   v6 = (unsigned __int16)v5;
-  if (PID_TYPE(v5) == OBJECT_Actor
+
+  auto type = PID_TYPE(v6);
+  if (type == OBJECT_Actor
     && uActiveCharacter
     && v5 < 0x2000000
     && pPlayers[uActiveCharacter]->CanAct()
--- a/OSWindow.cpp	Fri Oct 11 07:29:14 2013 +0200
+++ b/OSWindow.cpp	Fri Oct 11 10:41:12 2013 +0200
@@ -57,12 +57,16 @@
 }
 
 
+bool _507B98_ctrl_pressed = false;
 bool OSWindow::WinApiMessageProc(UINT msg, WPARAM wparam, LPARAM lparam, LRESULT *result)
 {
   switch (msg)
   {
     case WM_KEYUP:
     {
+      if (wparam == VK_CONTROL)
+        _507B98_ctrl_pressed = false;
+
       OnKey(wparam);
       return *result = 0, true;
     }
@@ -207,6 +211,11 @@
             UI_OnKeyDown(wparam);
           return 0;
         }
+        if (wparam == VK_CONTROL)
+        {
+          _507B98_ctrl_pressed = true;
+          return false;
+        }
         if ( wparam == VK_ESCAPE )
         {
           pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, window_SpeakInHouse != 0, 0);