fix seeing double crashing the game

This commit is contained in:
2025-04-30 18:36:49 +02:00
parent 750116e46c
commit 4110ad5a92
2 changed files with 14 additions and 12 deletions

View File

@@ -2,12 +2,14 @@
"id": "FantomsPreview", "id": "FantomsPreview",
"name": "Fantoms Preview", "name": "Fantoms Preview",
"display_name": "Fantoms Preview", "display_name": "Fantoms Preview",
"author": ["Fantom, Divvy"], "author": [
"Fantom, Divvy"
],
"description": "A QoL mod for balatro allowing for a preview of score/money before submitting the hand.", "description": "A QoL mod for balatro allowing for a preview of score/money before submitting the hand.",
"prefix": "fn", "prefix": "fn",
"main_file": "CorePreview.lua", "main_file": "CorePreview.lua",
"priority": 0, "priority": 0,
"version": "2.2.0", "version": "2.3.0",
"dependencies": [], "dependencies": [],
"conflicts": [] "conflicts": []
} }

View File

@@ -805,10 +805,10 @@ FNSJ.simulate_seeing_double = function(joker_obj, context)
-- Account for all 'real' suits: -- Account for all 'real' suits:
for _, card in ipairs(context.scoring_hand) do for _, card in ipairs(context.scoring_hand) do
if card.ability.effect ~= "Wild Card" then if card.ability.effect ~= "Wild Card" then
if DV.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end if FN.SIM.is_suit(card, "Hearts") then inc_suit("Hearts") end
if DV.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end if FN.SIM.is_suit(card, "Diamonds") then inc_suit("Diamonds") end
if DV.SIM.is_suit(card, "Spades") then inc_suit("Spades") end if FN.SIM.is_suit(card, "Spades") then inc_suit("Spades") end
if DV.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end if FN.SIM.is_suit(card, "Clubs") then inc_suit("Clubs") end
end end
end end
@@ -816,16 +816,16 @@ FNSJ.simulate_seeing_double = function(joker_obj, context)
for _, card in ipairs(context.scoring_hand) do for _, card in ipairs(context.scoring_hand) do
if card.ability.effect == "Wild Card" then if card.ability.effect == "Wild Card" then
-- IMPORTANT: Clubs must come first here, because Clubs are required for xmult. This is in line with game's implementation. -- IMPORTANT: Clubs must come first here, because Clubs are required for xmult. This is in line with game's implementation.
if DV.SIM.is_suit(card, "Clubs") and suit_count["Clubs"] == 0 then inc_suit("Clubs") if FN.SIM.is_suit(card, "Clubs") and suit_count["Clubs"] == 0 then inc_suit("Clubs")
elseif DV.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts") elseif FN.SIM.is_suit(card, "Hearts") and suit_count["Hearts"] == 0 then inc_suit("Hearts")
elseif DV.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds") elseif FN.SIM.is_suit(card, "Diamonds") and suit_count["Diamonds"] == 0 then inc_suit("Diamonds")
elseif DV.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades") elseif FN.SIM.is_suit(card, "Spades") and suit_count["Spades"] == 0 then inc_suit("Spades")
end end
end end
end end
if suit_count["Clubs"] > 0 and (suit_count["Hearts"] > 0 or suit_count["Diamonds"] > 0 or suit_count["Spades"] > 0) then if suit_count["Clubs"] > 0 and (suit_count["Hearts"] > 0 or suit_count["Diamonds"] > 0 or suit_count["Spades"] > 0) then
DV.SIM.x_mult(joker_obj.ability.extra) FN.SIM.x_mult(joker_obj.ability.extra)
end end
end end
end end