diff --git a/engine/client/in_touch.c b/engine/client/in_touch.c index 5f74c471..8f279b30 100644 --- a/engine/client/in_touch.c +++ b/engine/client/in_touch.c @@ -527,12 +527,32 @@ static touch_button_t *Touch_FindFirst( touchbuttonlist_t *list, const char *nam return Touch_FindNext( list->first, name, privileged ); } +static void Touch_DisableEdit_f( void ) +{ + touch.state = state_none; + if( touch.edit ) + touch.edit->finger = -1; + if( touch.selection ) + touch.selection->finger = -1; + touch.edit = touch.selection = NULL; + touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1; + + if( touch_in_menu.value ) + Cvar_DirectSet( &touch_in_menu, "0" ); + else if( cls.key_dest == key_game ) + Touch_WriteConfig(); +} + void Touch_SetClientOnly( byte state ) { // TODO: fix clash with vgui cursors if( touch.clientonly == state ) return; + // a1ba: the way client only touch buttons are used, they might come from + // client.dll, locking user in edit state, so disable it first + Touch_DisableEdit_f(); + touch.clientonly = state; touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1; @@ -1021,22 +1041,6 @@ static void Touch_EnableEdit_f( void ) } } -static void Touch_DisableEdit_f( void ) -{ - touch.state = state_none; - if( touch.edit ) - touch.edit->finger = -1; - if( touch.selection ) - touch.selection->finger = -1; - touch.edit = touch.selection = NULL; - touch.resize_finger = touch.move_finger = touch.look_finger = touch.wheel_finger = -1; - - if( touch_in_menu.value ) - Cvar_DirectSet( &touch_in_menu, "0" ); - else if( cls.key_dest == key_game ) - Touch_WriteConfig(); -} - static void Touch_DeleteProfile_f( void ) { if( Cmd_Argc() != 2 )