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:

<DISCORD USERNAME>
This commit is contained in:
evanpelle
2025-06-07 20:30:49 -07:00
committed by evanpelle
parent ebbf4dd5e5
commit a4e508d3d4
+9
View File
@@ -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 (