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:
parent
5fbdbaa3bc
commit
ad62707eef
@ -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;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user