Skip to content

[beta branch] Number comparison issue #293

@KassLavender

Description

@KassLavender

Describe the bug

Alright, there seems to be some situations in which mod, passed to ease_dollars, appears to be of type table instead of number.
You can see this by editing Talisman's talisman.lua hook:

local edo = ease_dollars
function ease_dollars(mod, instant)
  print("Talisman:")
  print(type(mod))
  print("--")
  if Talisman.config_file.disable_anims then--and (Talisman.calculating_joker or Talisman.calculating_score or Talisman.calculating_card) then
    mod = mod or 0
    if to_big(mod) > to_big(0) then inc_career_stat('c_dollars_earned', mod) end
    G.GAME.dollars = G.GAME.dollars + mod
    Talisman.dollar_update = true
  else return edo(mod, instant) end
end

and paperback's hook:

local ease_dollars_ref = ease_dollars
function ease_dollars(mod, instant)
  print("Paperback:")
  if type(mod) == "table" then
    for i, v in pairs(mod) do
      print(i)
      print(v)
    end
  end
  print(type(mod))
  print("--")
  if mod > 0 and next(SMODS.find_card("j_paperback_coin_collection")) then
    for _, c in ipairs(SMODS.find_card("j_paperback_coin_collection")) do
      mod = mod + c.ability.extra.dollars
      SMODS.calculate_effect({ message = "+$" .. c.ability.extra.dollars }, c)
    end
  end
  return ease_dollars_ref(mod, instant)
end

Where

Gives a surreal output at "Cash Out" at the end of a won round:

INFO - [G] Paperback:
INFO - [G] array
INFO - [G] table: 0x03a2a308
INFO - [G] sign
INFO - [G] 1
INFO - [G] table
INFO - [G] --

At other instances of ease_dollars being called, such as with Golden Joker without a sleeve, payout works normally, and looks something like:

INFO - [G] Paperback:
INFO - [G] number
INFO - [G] --
INFO - [G] Talisman:
INFO - [G] number
INFO - [G] --

Please note that with only Talisman and Sleeves unlocked, having a deck with yellow sleeve and reaching "Cash Out" outputs

INFO - [G] Talisman:
INFO - [G] table
INFO - [G] --

So it appears that Talisman is able to handle the table being passed to its hook of ease dollars.

My guess is that the number that is being passed needs to be able to handle talisman-type numbers. This does not occur with Paperback and Sleeves but not Talisman.

To Reproduce

Start a run with say Red Deck, have Yellow Sleeve. When you hit "Cash Out", crash. Seems to not happen with other sleeves? Could be situational

Expected behavior

ease_dollars being able to handle mod value

Screenshots

No response

OS

Windows 10

Lovely Version

0.8.0

Steamodded Version

1.0.0~BETA-1323c-STEAMODDED

Paperback Version

0.7.1a~BETA

Additional Context

No response

Crash Log

[SMODS paperback "utilities/hooks.lua"]:429: attempt to compare number with table
Stack Traceback
===============
(1) Lua local 'handler' at file 'main.lua:612'
	Local variables:
	 msg = string: "[SMODS paperback \"utilities/hooks.lua\"]:429: attempt to compare number with table"
	 (*temporary) = Lua function '?' (defined at line 31 of chunk [SMODS _ "src/logging.lua"])
	 (*temporary) = string: "Oops! The game crashed\
"
(2) LÖVE metamethod at file 'boot.lua:352'
	Local variables:
	 errhand = Lua function '?' (defined at line 598 of chunk main.lua)
	 handler = Lua function '?' (defined at line 598 of chunk main.lua)
(3) Lua global 'ease_dollars' at file 'utilities/hooks.lua:429' (from mod with id paperback)
	Local variables:
	 mod = 8  {array:table: 0x1f284988, sign:1}
	 instant = nil
	 (*temporary) = number: 0
	 (*temporary) = nil
	 (*temporary) = table: 0x1f2060f8  {1:table: 0x1f7fb508, 2:table: 0x2062b5b8, 3:table: 0x2052a678, 4:table: 0x2052aab8}
	 (*temporary) = number: 4
	 (*temporary) = table: 0x1ea568c8  {handle:function: 0x1ea568f0, __index:table: 0x1ea568c8, init:function: 0x1ea5eb28, __call:function: 0x1e9fdff0, super:table: 0x1e9fdf68}
	 (*temporary) = table: 0x1ea568c8  {handle:function: 0x1ea568f0, __index:table: 0x1ea568c8, init:function: 0x1ea5eb28, __call:function: 0x1e9fdff0, super:table: 0x1e9fdf68}
	 (*temporary) = boolean: true
	 (*temporary) = table: 0x2052aa58  {func:function: 0x1fab0ef0, trigger:immediate}
	 (*temporary) = number: 72.5672
	 (*temporary) = string: "attempt to compare number with table"
(4) Lua upvalue 'cash_out_ref' at file 'functions/button_callbacks.lua:3001'
	Local variables:
	 e = table: 0x1f1b1c50  {pixellated_rect:table: 0x1f14cb28, click_offset:table: 0x1f736d30, static_rotation:true, parent:table: 0x1ea26f00, T:table: 0x1f736ac8, offset:table: 0x1f9af328 (more...)}
(5) Lua function '?' at file 'utilities/hooks.lua:184' (from mod with id paperback) (best guess)
	Local variables:
	 e = table: 0x1f1b1c50  {pixellated_rect:table: 0x1f14cb28, click_offset:table: 0x1f736d30, static_rotation:true, parent:table: 0x1ea26f00, T:table: 0x1f736ac8, offset:table: 0x1f9af328 (more...)}
(6) Lua method 'click' at file 'engine/ui.lua:996'
	Local variables:
	 self = table: 0x1f1b1c50  {pixellated_rect:table: 0x1f14cb28, click_offset:table: 0x1f736d30, static_rotation:true, parent:table: 0x1ea26f00, T:table: 0x1f736ac8, offset:table: 0x1f9af328 (more...)}
(7) Lua method 'update' at file 'engine/controller.lua:375'
	Local variables:
	 self = table: 0x1ee28ff0  {held_button_times:table: 0x1ee17980, focus_cursor_stack_level:1, snap_cursor_to:table: 0x1f3923e8, interrupt:table: 0x1ee179d0, GAMEPAD:table: 0x1ef1fd18 (more...)}
	 dt = number: 0.00707219
(8) Lua upvalue 'gameUpdateRef' at file 'game.lua:2757'
	Local variables:
	 self = table: 0x1ea035c0  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x1f7c8360, F_ENGLISH_ONLY:false, viewed_stake:1, HUD:table: 0x1ed1e708 (more...)}
	 dt = number: 0.00707219
(9) Lua upvalue 'upd' at Steamodded file 'src/ui.lua:124' 
	Local variables:
	 self = table: 0x1ea035c0  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x1f7c8360, F_ENGLISH_ONLY:false, viewed_stake:1, HUD:table: 0x1ed1e708 (more...)}
	 dt = number: 0.00707219
(10) Lua method 'update' at file 'main.lua:2010'
	Local variables:
	 self = table: 0x1ea035c0  {F_GUIDE:false, F_CRASH_REPORTS:false, F_QUIT_BUTTON:true, HUD_tags:table: 0x1f7c8360, F_ENGLISH_ONLY:false, viewed_stake:1, HUD:table: 0x1ed1e708 (more...)}
	 dt = number: 0.00707219
(11) Lua upvalue 'oldupd' at file 'main.lua:1007'
	Local variables:
	 dt = number: 0.00707219
(12) Lua field 'update' at file 'main.lua:2043'
	Local variables:
	 dt = number: 0.00707219
(13) Lua function '?' at file 'main.lua:946' (best guess)
(14) global C function 'xpcall'
(15) 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"])

INFO - [G] line not found
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] file not found: main.lua: No such file or directory
INFO - [G] 2026-01-25 01:12:04 :: INFO  :: StackTrace :: Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1323c-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.8.0
Platform: Windows
Steamodded Mods:
    1: Talisman by MathIsFun_, Mathguy24, jenwalter666, cg, lord.ruby [ID: Talisman, Version: 2.7, Uses Lovely]
    2: Paperback by PaperMoon, OppositeWolf770, srockw, Nether, B [ID: paperback, Version: 0.7.1a~BETA, Uses Lovely]
    3: Card Sleeves by Larswijn [ID: CardSleeves, Priority: -10, Version: 1.8.0, Uses Lovely]
Lovely Mods:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions