Skip to content

Commit e29f514

Browse files
authored
Merge pull request #728 from belowdecent/belowdecent-shenanigans
"delete" code card clean up
2 parents 88120fb + 1e4ad36 commit e29f514

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

items/code.lua

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,37 +4051,25 @@ local delete = {
40514051
if not G.GAME.cry_banned_pcards then
40524052
G.GAME.cry_banned_pcards = {}
40534053
end
4054-
local a = nil
4055-
local c = nil
4056-
local _p = nil
4057-
if G.shop_jokers.highlighted[1] then
4058-
_p = not not G.shop_jokers.highlighted[1].base.value
4059-
a = G.shop_jokers
4060-
c = G.shop_jokers.highlighted[1]
4061-
end
4062-
if G.shop_booster.highlighted[1] then
4063-
_p = not not G.shop_booster.highlighted[1].base.value
4064-
a = G.shop_booster
4065-
c = G.shop_booster.highlighted[1]
4066-
end
4067-
if G.shop_vouchers.highlighted[1] then
4068-
_p = not not G.shop_vouchers.highlighted[1].base.value
4069-
a = G.shop_vouchers
4070-
c = G.shop_vouchers.highlighted[1]
4071-
if c.shop_voucher then
4072-
G.GAME.current_round.voucher.spawn[c.config.center.key] = nil
4073-
G.GAME.current_round.cry_voucher_edition = nil
4074-
G.GAME.current_round.cry_voucher_stickers =
4075-
{ eternal = false, perishable = false, rental = false, pinned = false, banana = false }
4076-
end
4077-
end
4054+
4055+
local c = G.shop_jokers.highlighted[1]
4056+
or G.shop_booster.highlighted[1]
4057+
or G.shop_vouchers.highlighted[1]
4058+
4059+
if G.shop_vouchers.highlighted[1] and c.shop_voucher then
4060+
G.GAME.current_round.voucher.spawn[c.config.center.key] = nil
4061+
G.GAME.current_round.cry_voucher_edition = nil
4062+
G.GAME.current_round.cry_voucher_stickers =
4063+
{ eternal = false, perishable = false, rental = false, pinned = false, banana = false }
4064+
end
4065+
40784066
if c.config.center.rarity == "cry_exotic" then
40794067
check_for_unlock({ type = "what_have_you_done" })
40804068
end
40814069

40824070
G.GAME.cry_banished_keys[c.config.center.key] = true
40834071

4084-
if _p then
4072+
if not not c.base.value then -- is there a case where ~= nil would fail here?
40854073
for k, v in pairs(G.P_CARDS) do
40864074
-- bans a specific rank AND suit
40874075
if v.value == c.base.value and v.suit == c.base.suit then

0 commit comments

Comments
 (0)