summaryrefslogtreecommitdiff
path: root/cheat/gmod/lock_cursor.cpp
blob: 477847d09ca17e8697be0468f23c14ee669ee205 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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 );
	}
}