summaryrefslogtreecommitdiff
path: root/gmod/lock_cursor.cpp
diff options
context:
space:
mode:
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