Skip to content

Instantly share code, notes, and snippets.

@asarium
Created March 2, 2014 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asarium/9308650 to your computer and use it in GitHub Desktop.
Save asarium/9308650 to your computer and use it in GitHub Desktop.
Index: code/io/mouse.cpp
===================================================================
--- code/io/mouse.cpp (revision 10476)
+++ code/io/mouse.cpp (working copy)
@@ -201,17 +201,21 @@
mouse_flags &= ~flags;
}
- LEAVE_CRITICAL_SECTION( mouse_lock );
+ LEAVE_CRITICAL_SECTION(mouse_lock);
+ Script_system.SetHookVar("MouseButton", 'i', &flags);
+
//WMC - On Mouse Pressed and On Mouse Released hooks
- if(set == 1)
+ if (set == 1)
{
Script_system.RunCondition(CHA_MOUSEPRESSED);
}
- else if(set == 0)
+ else if (set == 0)
{
Script_system.RunCondition(CHA_MOUSERELEASED);
}
+
+ Script_system.RemHookVar("MouseButton");
}
void mouse_flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment