From a4e508d3d46a4e5c57f6fc00e39c4b8748505135 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 7 Jun 2025 20:30:49 -0700 Subject: [PATCH] Disable donations public ffa matches (#1097) ## Description: Some players have created a script to auto donate to themselves. So we should disable donation in public ffa matches. ## 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: --- src/core/game/PlayerImpl.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index 1faa13d93..323d8f41b 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -22,6 +22,8 @@ import { ColoredTeams, Embargo, EmojiMessage, + GameMode, + GameType, Gold, MessageType, MutableAlliance, @@ -527,6 +529,13 @@ export class PlayerImpl implements Player { if (!this.isFriendly(recipient)) { return false; } + if ( + recipient.type() === PlayerType.Human && + this.mg.config().gameConfig().gameMode === GameMode.FFA && + this.mg.config().gameConfig().gameType === GameType.Public + ) { + return false; + } for (const donation of this.sentDonations) { if (donation.recipient === recipient) { if (