Skip to content

Fix crash: check ret type before accessing table fields#10

Open
Nizarberyan wants to merge 1 commit intoSomeCoder99:mainfrom
Nizarberyan:main
Open

Fix crash: check ret type before accessing table fields#10
Nizarberyan wants to merge 1 commit intoSomeCoder99:mainfrom
Nizarberyan:main

Conversation

@Nizarberyan
Copy link

i tried to use a joker and the game crashed so i fixed it, here is the error i got (and also fixed a spelling mistake)

Oops! The game crashed:
...Roaming\Balatro\Mods/balatro-plus/src/bplus\override.lua:126: attempt to index local 'ret' (a boolean value)

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1016c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
    1: Balatro+ by SomeCoder99 [ID: balatro_plus, Version: 1.0.2-a, Uses Lovely]
Lovely Mods:

Stack Traceback
===============
(3) Lua method 'calculate_joker' at file 'C:\users\steamuser\AppData\Roaming\Balatro\Mods/balatro-plus/src/bplus\override.lua:126'
Local variables:
 self = table: 0x05efd9b0  {click_offset:table: 0x041b3ba0, static_rotation:false, ambient_tilt:0.2, parent:table: 0x041393b0, T:table: 0x041b3b78, last_aligned:-1, extra_cost:0 (more...)}
 ctx = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
 ret = boolean: true
 (*temporary) = nil
 (*temporary) = nil
 (*temporary) = string: "attempt to index local 'ret' (a boolean value)"
(4) Lua upvalue 'eval_card_ref' at file 'functions/common_events.lua:718'
Local variables:
 card = table: 0x05efd9b0  {click_offset:table: 0x041b3ba0, static_rotation:false, ambient_tilt:0.2, parent:table: 0x041393b0, T:table: 0x041b3b78, last_aligned:-1, extra_cost:0 (more...)}
 context = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
 ret = table: 0x186fa658  {}
 post_trig = table: 0x046fe760  {}
 areas = table: 0x04560538  {1:table: 0x041393b0, 2:table: 0x062e6f58, 3:table: 0x135780b0}
 area_set = table: 0x046fe788  {table: 0x062e6f58:true, table: 0x041393b0:true, table: 0x135780b0:true}
(5) Lua global 'eval_card' at Steamodded file 'src/overrides.lua:2385' 
Local variables:
 card = table: 0x05efd9b0  {click_offset:table: 0x041b3ba0, static_rotation:false, ambient_tilt:0.2, parent:table: 0x041393b0, T:table: 0x041b3b78, last_aligned:-1, extra_cost:0 (more...)}
 context = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
(6) Lua field 'calculate_card_areas' at Steamodded file 'src/utils.lua:1659' 
Local variables:
 _type = string: "jokers"
 context = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
 return_table = nil
 args = table: 0x03d6a6d8  {has_area:true, joker_area:true}
 flags = table: 0x03d6a700  {}
 (for generator) = C function: builtin#6
 (for state) = table: 0x04bfcd38  {1:table: 0x041393b0, 2:table: 0x062e6f58, 3:table: 0x135780b0}
 (for control) = number: 1
 _ = number: 1
 area = table: 0x041393b0  {click_offset:table: 0x04aba248, static_rotation:false, shuffle_amt:0, T:table: 0x0456afb8, offset:table: 0x0409bf58, role:table: 0x0622fa00, last_aligned:-1 (more...)}
 (for generator) = C function: builtin#6
 (for state) = table: 0x135a2aa8  {1:table: 0x05efd9b0}
 (for control) = number: 1
 _ = number: 1
 _card = table: 0x05efd9b0  {click_offset:table: 0x041b3ba0, static_rotation:false, ambient_tilt:0.2, parent:table: 0x041393b0, T:table: 0x041b3b78, last_aligned:-1, extra_cost:0 (more...)}
(7) Lua field 'calculate_context' at Steamodded file 'src/utils.lua:1902' 
Local variables:
 context = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
 return_table = nil
 no_resolve = nil
 has_area = boolean: true
 flags = table: 0x187c6650  {}
 (*temporary) = number: 1
(8) Lua field 'calculate_destroying_cards' at Steamodded file 'src/utils.lua:2069' 
Local variables:
 context = table: 0x13d93bf0  {destroying_card:table: 0x06322218, main_eval:true, poker_hands:table: 0x098d5448, scoring_name:High Card, scoring_hand:table: 0x06032880, full_hand:table: 0x0d3110f0 (more...)}
 cards_destroyed = table: 0x06320390  {}
 scoring_hand = table: 0x06032880  {1:table: 0x06322218}
 (for generator) = C function: builtin#6
 (for state) = table: 0x0d3110f0  {1:table: 0x06322218}
 (for control) = number: 1
 i = number: 1
 card = table: 0x06322218  {click_offset:table: 0x044f63f0, base_cost:1, children:table: 0x06265ff0, ambient_tilt:0.2, parent:table: 0x13d25560, under_overlay:false, T:table: 0x06322408 (more...)}
 destroyed = nil
 in_scoring = boolean: true
(9) Lua upvalue 'g_funcs_evaluate_play' at file 'functions/state_events.lua:799'
Local variables:
 e = nil
 text = string: "High Card"
 disp_text = string: "High Card"
 poker_hands = table: 0x098d5448  {Flush House:table: 0x1074f4e8, Full House:table: 0x06025068, top:table: 0x0630c550, Flush:table: 0x06033a20, Pair:table: 0x04c27038, Four of a Kind:table: 0x04154c60 (more...)}
 scoring_hand = table: 0x06032880  {1:table: 0x06322218}
 non_loc_disp_text = string: "High Card"
 final_scoring_hand = table: 0x06032880  {1:table: 0x06322218}
 hand_text_set = boolean: false
 modded = nil
 nu_chip = nil
 nu_mult = nil
 cards_destroyed = table: 0x06320390  {}
 (for generator) = C function: builtin#6
 (for state) = table: 0x13d93bc8  {1:table: 0x13d25560, 2:table: 0x099a7fb0}
 (for control) = number: 1
 _ = number: 1
 v = table: 0x13d25560  {click_offset:table: 0x0995ac30, static_rotation:false, shuffle_amt:0, T:table: 0x13d78e40, offset:table: 0x0629a4b8, role:table: 0x04b539d8, last_aligned:-1 (more...)}
(10) Lua field 'evaluate_play' at file 'C:\users\steamuser\AppData\Roaming\Balatro\Mods/balatro-plus/src/bplus\override.lua:48'
Local variables:
 e = nil
(11) Lua field 'func' at file 'functions/state_events.lua:564'
(12) Lua method 'handle' at file 'engine/event.lua:99'
Local variables:
 self = table: 0x13d6e220  {start_timer:true, timer:TOTAL, blockable:true, trigger:immediate, func:function: 0x04540ae8, delay:0, complete:false, time:3428.7890116364, blocking:true (more...)}
 _results = table: 0x0d317aa8  {blocking:true, pause_skip:false, time_done:false, completed:false}
(13) Lua method 'update' at file 'engine/event.lua:182'
Local variables:
 self = table: 0x03d6dfa8  {queue_last_processed:1715.9833333321, queues:table: 0x03d6ee20, queue_dt:0.016666666666667, queue_timer:1737.9171457677}
 dt = number: 0.0166288
 forced = nil
 (for generator) = C function: next
 (for state) = table: 0x03d6ee20  {unlock:table: 0x03d6fc58, other:table: 0x03d6d788, tutorial:table: 0x03d6d180, base:table: 0x03d70b10, achievement:table: 0x03d6d1a8}
 (for control) = number: nan
 k = string: "base"
 v = table: 0x03d70b10  {1:table: 0x107ece10, 2:table: 0x03dd5e08, 3:table: 0x13d6e220, 4:table: 0x04c5fef0, 5:table: 0x10737e68, 6:table: 0x03e0bda0, 7:table: 0x06059068 (more...)}
 blocked = boolean: false
 i = number: 3
 results = table: 0x0d317aa8  {blocking:true, pause_skip:false, time_done:false, completed:false}
(14) Lua upvalue 'gameUpdateRef' at file 'game.lua:2600'
Local variables:
 self = table: 0x03a92b30  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x05f1c878, F_ENGLISH_ONLY:false, viewed_stake:1, HUD:table: 0x04524168 (more...)}
 dt = number: 0.0166288
 http_resp = nil
(15) Lua method 'update' at Steamodded file 'src/ui.lua:124' 
Local variables:
 self = table: 0x03a92b30  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x05f1c878, F_ENGLISH_ONLY:false, viewed_stake:1, HUD:table: 0x04524168 (more...)}
 dt = number: 0.0166288
(16) Lua field 'update' at file 'main.lua:1007'
Local variables:
 dt = number: 0.0166288
(17) Lua function '?' at file 'main.lua:946' (best guess)
(18) global C function 'xpcall'
(19) LÖVE function at file 'boot.lua:377' (best guess)
Local variables:
 func = Lua function '?' (defined at line 917 of chunk main.lua)
 inerror = boolean: true
 deferErrhand = Lua function '(LÖVE Function)' (defined at line 348 of chunk [love "boot.lua"])
 earlyinit = Lua function '(LÖVE Function)' (defined at line 355 of chunk [love "boot.lua"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant