Merge pull request #636 from Teremiare/patch-7

Don't let spectators chat in battles when they're ignoring spectators
This commit is contained in:
Guangcong Luo
2016-02-06 06:58:04 -06:00

View File

@@ -93,7 +93,9 @@
this.tabComplete.reset();
this.chatHistory.push(text);
text = this.parseCommand(text);
if (text) {
if (this.battle && this.battle.ignoreSpects && app.user.get('userid') !== this.battle.p1.id && app.user.get('userid') !== this.battle.p2.id) {
this.add("You can't chat in this battle as you're currently ignoring spectators");
} else if (text) {
this.send(text);
}
this.$chatbox.val('');