mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 04:05:32 +00:00
Ensure rated game and cheat won't be enabled at the same time.
Reported by: Freagarach Differential Revision: https://code.wildfiregames.com/D3943 This was SVN commit r25418.
This commit is contained in:
@@ -4,6 +4,7 @@ GameSettings.prototype.Attributes.Rating = class Rating extends GameSetting
|
||||
{
|
||||
this.hasXmppClient = Engine.HasXmppClient();
|
||||
this.settings.playerCount.watch(() => this.maybeUpdate(), ["nbPlayers"]);
|
||||
this.settings.cheats.watch(() => this.maybeUpdate(), ["enabled"]);
|
||||
this.maybeUpdate();
|
||||
}
|
||||
|
||||
@@ -30,7 +31,9 @@ GameSettings.prototype.Attributes.Rating = class Rating extends GameSetting
|
||||
maybeUpdate()
|
||||
{
|
||||
// This setting is activated by default if it's possible.
|
||||
this.available = this.hasXmppClient && this.settings.playerCount.nbPlayers === 2;
|
||||
this.available = this.hasXmppClient &&
|
||||
this.settings.playerCount.nbPlayers === 2 &&
|
||||
!this.settings.cheats.enabled;
|
||||
this.enabled = this.available;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user