Skip to content

Commit 0df541d

Browse files
committed
hotfix: fixing missing logic from spoiler code
1 parent 48c588b commit 0df541d

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/modules/balatrots/Game.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ export class Game extends Lock {
10431043
} else {
10441044
const item = (card as ItemImpl).getName();
10451045
const spoilerSource = this.hasSpoilersMap[item];
1046-
if (this.hasSpoilers) {
1046+
if (this.hasSpoilers && spoilerSource) {
10471047
return this.peekJoker(spoilerSource, ante, false)
10481048
}
10491049
return card as Card;
@@ -1145,18 +1145,18 @@ item wheel_of_fortune_edition(instance* inst) {
11451145
}
11461146
return (value + this.hashedSeed) / 2;
11471147
}
1148-
static get CARDS_ABANDONED(): Card[] {
1148+
static get CARDS_ABANDONED(): Array<Card> {
11491149
// Abandoned Deck: 40 cards, no face cards (J, Q, K).
11501150
return this.CARDS.filter(c => {
11511151
const name = c.getName();
11521152
return !name.includes("_J") && !name.includes("_Q") && !name.includes("_K");
11531153
}).map(c => new Card(c.getName() as PlayingCard));
11541154
}
11551155

1156-
static get CARDS_CHECKERED(): Card[] {
1156+
static get CARDS_CHECKERED(): Array<Card> {
11571157
// Checkered Deck: 52 cards (Hearts/Spades only).
11581158
return this.CARDS.map(c => {
1159-
const name = c.getName() as string;
1159+
const name = c.getName();
11601160
const rank = name.split("_")[1];
11611161
const suit = name.split("_")[0];
11621162
let newSuit = suit;
@@ -1169,7 +1169,7 @@ item wheel_of_fortune_edition(instance* inst) {
11691169
/**
11701170
* Returns a fully shuffled deck for the given ante and round index (1, 2, or 3).
11711171
*/
1172-
private getShuffledDeck(ante: number, round: number = 1): Card[] {
1172+
private getShuffledDeck(ante: number, round: number = 1): Array<Card> {
11731173
const deckType = this.params.getDeck().name;
11741174
let cards: Card[];
11751175

@@ -1181,7 +1181,7 @@ item wheel_of_fortune_edition(instance* inst) {
11811181
cards = Game.CARDS_CHECKERED;
11821182
break;
11831183
case deckNames[DeckType.ERRATIC_DECK]: {
1184-
const randomizedCards: Card[] = [];
1184+
const randomizedCards: Array<Card> = [];
11851185
for(let i = 0; i < 52; i++){
11861186
const card = this.randchoice_simple(RandomQueueNames.R_Erratic, Game.CARDS);
11871187
randomizedCards.push(new Card(card.getName() as PlayingCard));
@@ -1215,12 +1215,12 @@ item wheel_of_fortune_edition(instance* inst) {
12151215
* @param round The round index within the ante (1, 2, or 3) (default 1)
12161216
* @param count Number of cards to draw (default 8)
12171217
*/
1218-
getDeckDraw(ante: number, round: number = 1, count: number = 8): Card[] {
1218+
getDeckDraw(ante: number, round: number = 1, count: number = 8): Array<Card> {
12191219
const deck = this.getShuffledDeck(ante, round);
12201220
return deck.slice(0, count);
12211221
}
12221222

1223-
getStartingDeckDraw(): Card[] {
1223+
getStartingDeckDraw(): Array<Card> {
12241224
// pifreak loves you!
12251225
return this.getDeckDraw(1, 1, 8);
12261226
}

0 commit comments

Comments
 (0)