summaryrefslogtreecommitdiff
path: root/gmod/lock_cursor.cpp
diff options
context:
space:
mode:
authorJustSomePwner <crotchyalt@gmail.com>2018-08-30 14:01:54 +0200
committerJustSomePwner <crotchyalt@gmail.com>2018-08-30 14:01:54 +0200
commit7ccb819f867493f8ec202ea3b39c94c198c64584 (patch)
tree94622e61af0ff359e3d6689cf274d74f60b2492a /gmod/lock_cursor.cpp
parent564d979b79e8a5aaa5014eba0ecd36c61575934f (diff)
first
Diffstat (limited to 'gmod/lock_cursor.cpp')
-rw-r--r--gmod/lock_cursor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gmod/lock_cursor.cpp b/gmod/lock_cursor.cpp
new file mode 100644
index 0000000..477847d
--- /dev/null
+++ b/gmod/lock_cursor.cpp
@@ -0,0 +1,13 @@
+#include "hooks.hpp"
+
+void __fastcall hooks::lock_cursor( void* ecx, void* edx ) {
+ static auto lock_cursor_o = g_gmod.m_surface->get_old_function< decltype( &hooks::lock_cursor ) >( 62 );
+ if( g_gmod.m_panic ) return lock_cursor_o( ecx, edx );
+
+ if( g_settings.menu.open ) {
+ g_gmod.m_surface( )->UnlockCursor( );
+ }
+ else {
+ lock_cursor_o( ecx, edx );
+ }
+} \ No newline at end of file