From eda49d1ad83d1a4fd36acc21b48c1e56242a0648 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 e1716bce1..bb906acb3 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -557,6 +557,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(