Skip to content

Bug Report: Crash when using stacked consumables (Saturn + Cartomancer) Description #54

Description

@p4Ndr4

Description

When using Saturn's consumable stacking feature together with Cartomancer, the game crashes when a stacked consumable card is used.

The crash appears to be related to the interaction between Saturn's stacking system and Cartomancer's edition assignment system.

Sorry if this report became very long. I tried to include as much information as possible to help identify the issue.


Disclaimer

The player who encountered this bug does not have any programming or modding knowledge.

All investigation, debugging, and code modification were performed with the assistance of an AI tool.
This bug report was also written with the help of AI in order to clearly describe the issue.

The player only followed testing steps suggested by the AI and verified whether the crash occurred.


Environment

Game Version

  • Balatro 1.0.1o-FULL

Mod Loader

  • Steamodded 1.0.0~BETA-1503a
  • Lovely 0.9.0

Platform

  • Windows
  • LÖVE 11.5.0

Installed Mods

  • Cartomancer 4.17c
  • Saturn 0.2.2-E-ALPHA
  • Handy 1.5.1o
  • JokerDisplay 1.9.6

Error Message

Oops! The game crashed:
card.lua:1743: attempt to index local 'eligible_card' (a nil value)

Additional Context:
Balatro Version: 1.0.1o-FULL
Modded Version: 1.0.0~BETA-1503a-STEAMODDED
LÖVE Version: 11.5.0
Lovely Version: 0.9.0
Platform: Windows

Steamodded Mods:
1: Cartomancer (Version 4.17c)
2: Saturn (Version 0.2.2-E-ALPHA)
3: Handy (Version 1.5.1o)
4: JokerDisplay (Version 1.9.6)

Stack Traceback
card.lua:1743: attempt to index local 'eligible_card' (a nil value)

Local variables:
eligible_card = nil
edition = "e_holo"

The crash occurs during an event where card editions are being assigned.
The following editions appeared in the logs:

e_negative
e_polychrome
e_holo
e_foil

Steps to Reproduce

  1. Install Saturn and Cartomancer.
  2. Obtain the consumable The Wheel of Fortune.
  3. Use the Perkeo Joker to duplicate The Wheel of Fortune.
  4. Saturn automatically merges the duplicated Wheel of Fortune cards into a stacked consumable.
  5. Use the stacked Wheel of Fortune card.

Result:
The game crashes with the error shown above.


Additional Observations

If the stacked consumable is manually split into individual cards before use, the crash does not occur.

Example:

  1. Split the stack into single consumables
  2. Use the card normally

Result:

  • No crash occurs

Possible Cause (AI Analysis)

In stack.lua, Saturn restricts stackable cards to negative edition only:

function Card:canStack()
  return inTable(CAN_STACK, self.ability.set)
    and self:getEditionType() == "negative"
end

However, Cartomancer dynamically assigns other editions such as:

  • holo
  • foil
  • polychrome

When these editions are applied to stacked consumables, the card object passed into the edition assignment logic appears to become invalid, resulting in:

eligible_card = nil

which leads to the crash.


Temporary Fix (AI Suggested)

Removing the negative-edition restriction appears to resolve the crash.

Original Code

function Card:canStack()
  return inTable(CAN_STACK, self.ability.set)
    and self:getEditionType() == "negative"
end

Modified Code

function Card:canStack()
  return self.ability
    and inTable(CAN_STACK, self.ability.set)
end

After applying this change:

  • Stacked consumables can be used normally
  • No further crashes were observed during testing

Summary

The crash appears to be caused by an incompatibility between:

  • Saturn's negative-edition-only stacking restriction
  • Cartomancer's dynamic edition assignment

Allowing stacked cards regardless of edition type seems to prevent the crash.


Thank you for your work on this mod.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions