Skip to content

Commit 75d236e

Browse files
committed
fix: leveling up a hand when scoring parameters don't have correct values no longer crashes
1 parent c875190 commit 75d236e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

src/utils.lua

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,14 +3317,16 @@ function SMODS.upgrade_poker_hands(args)
33173317
end
33183318
end
33193319
for i, parameter in ipairs(args.parameters) do
3320-
G.GAME.hands[hand][parameter] = args.func(G.GAME.hands[hand][parameter], hand, parameter)
3321-
if not instant then
3322-
G.E_MANAGER:add_event(Event({trigger = 'after', delay = i == 1 and 0.2 or 0.9, func = function()
3323-
play_sound('tarot1')
3324-
if args.from then args.from:juice_up(0.8, 0.5) end
3325-
G.TAROT_INTERRUPT_PULSE = true
3326-
return true end }))
3327-
update_hand_text({delay = 0}, {[parameter] = G.GAME.hands[hand][parameter], StatusText = true})
3320+
if G.GAME.hands[hand][parameter] then
3321+
G.GAME.hands[hand][parameter] = args.func(G.GAME.hands[hand][parameter], hand, parameter)
3322+
if not instant then
3323+
G.E_MANAGER:add_event(Event({trigger = 'after', delay = i == 1 and 0.2 or 0.9, func = function()
3324+
play_sound('tarot1')
3325+
if args.from then args.from:juice_up(0.8, 0.5) end
3326+
G.TAROT_INTERRUPT_PULSE = true
3327+
return true end }))
3328+
update_hand_text({delay = 0}, {[parameter] = G.GAME.hands[hand][parameter], StatusText = true})
3329+
end
33283330
end
33293331
end
33303332
if args.level_up then

version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return "1.0.0~BETA-1222a-STEAMODDED"
1+
return "1.0.0~BETA-1223a-STEAMODDED"

0 commit comments

Comments
 (0)