From 3fc34c931eacc9bf8747794078b4f529c3ea5ba2 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Thu, 21 Aug 2025 15:07:31 -0700 Subject: [PATCH] fix emoji exploit: sending emoji to self causes game to crash (#1889) ## Description: When emoji is sent to oneself, it triggers: Cannot send emoji to oneself: ${this}, because the canSendEmoji wasn't checking if it was itself. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan --- src/core/game/PlayerImpl.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 7157e412f..92b849e13 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -551,6 +551,9 @@ export class PlayerImpl implements Player { } canSendEmoji(recipient: Player | typeof AllPlayers): boolean { + if (recipient === this) { + return false; + } const recipientID = recipient === AllPlayers ? AllPlayers : recipient.smallID(); const prevMsgs = this.outgoingEmojis_.filter(