Skip to content

Commit

Permalink
Don't notify of draft effect usage if the card isn't face up to begin…
Browse files Browse the repository at this point in the history
… with.
  • Loading branch information
Senryoku committed Mar 5, 2025
1 parent c60307f commit 52e19b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2025,11 +2025,13 @@ export class Session implements IIndexable {

const notifyDraftEffectUse = () => {
try {
const str = `${Connections[userID].userName} used the effect of '${card.name}'.`;
const msg = new ToastMessage(str);
this.forUsers((uid) => {
if (uid !== userID) Connections[uid]?.socket.emit("message", msg, true);
});
if (hasEffect(card, OnPickDraftEffect.FaceUp)) {
const str = `${Connections[userID].userName} used the effect of '${card.name}'.`;
const msg = new ToastMessage(str);
this.forUsers((uid) => {
if (uid !== userID) Connections[uid]?.socket.emit("message", msg, true);
});
}
} catch (e) {
console.error("Error notifying of draft effect use: ", e);
}
Expand Down

0 comments on commit 52e19b1

Please sign in to comment.