Skip to content

Commit afa7966

Browse files
authored
Update BetterMouseAndGamepad.lua
fix game crashes on discard or play keybind usage
1 parent d7a92b2 commit afa7966

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

BetterMouseAndGamepad.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--- MOD_NAME: Better Mouse And Gamepad
33
--- MOD_ID: BetterMouseAndGamepad
44
--- MOD_AUTHOR: [Kooluve]
5-
--- MOD_DESCRIPTION: [V1.0.4] Make mouse and gamepad more efficient and easier to use. View "README.md" and "*.lua" file for all functions and settings. https://github.com/Kooluve/Better-Mouse-And-Gamepad
5+
--- MOD_DESCRIPTION: [V1.0.5] Make mouse and gamepad more efficient and easier to use. View "README.md" and "*.lua" file for all functions and settings. https://github.com/Kooluve/Better-Mouse-And-Gamepad
66
----------------------------------------------
77
------------MOD CODE -------------------------
88

@@ -437,7 +437,8 @@ end
437437

438438
function queue_U_wheel_press()
439439
if C.locks.frame or not mod_functions_can["middle_mouse_button_up"] then return end
440-
if not G.SETTINGS.paused and G.STATE == G.STATES.SELECTING_HAND and Game_state_change_to_selecting_hand and C.cursor_down.target.states.drag.is == false then
440+
if C.cursor_down.target and C.cursor_down.target.states.drag.is then return end
441+
if not G.SETTINGS.paused and G.STATE == G.STATES.SELECTING_HAND and Game_state_change_to_selecting_hand then
441442
local play_button = G.buttons:get_UIE_by_ID('play_button')
442443
if play_button and play_button.config.button then
443444
G.FUNCS.play_cards_from_highlighted()
@@ -448,7 +449,8 @@ end
448449

449450
function queue_D_wheel_press()
450451
if C.locks.frame or not mod_functions_can["middle_mouse_button_down"] then return end
451-
if not G.SETTINGS.paused and G.STATE == G.STATES.SELECTING_HAND and Game_state_change_to_selecting_hand and C.cursor_down.target.states.drag.is == false then
452+
if C.cursor_down.target and C.cursor_down.target.states.drag.is then return end
453+
if not G.SETTINGS.paused and G.STATE == G.STATES.SELECTING_HAND and Game_state_change_to_selecting_hand then
452454
local discard_button = G.buttons:get_UIE_by_ID('discard_button')
453455
if discard_button and discard_button.config.button then
454456
G.FUNCS.discard_cards_from_highlighted()

0 commit comments

Comments
 (0)