mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 18:46:49 +00:00
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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user