From 77784e5f09e0c05c5034693d6973a4bfaef0f072 Mon Sep 17 00:00:00 2001 From: sD Date: Tue, 28 Apr 2020 22:02:13 +0200 Subject: handle servers not supporting modcall reason --- webAO/client.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index 58a8c61..0b06670 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -317,7 +317,11 @@ class Client extends EventEmitter { * @param {string} message to mod */ sendZZ(msg) { - this.sendServer(`ZZ#${msg}#%`); + if (extrafeatures.includes("modcall_reason")) { + this.sendServer(`ZZ#${msg}#%`); + } else { + this.sendServer(`ZZ#%`); + } } /** @@ -2590,7 +2594,10 @@ window.randomCharacterOOC = randomCharacterOOC; * Call mod. */ export function callMod() { - let modcall = prompt("Please enter the reason for the modcall", ""); + let modcall; + if (extrafeatures.includes("modcall_reason")) { + modcall = prompt("Please enter the reason for the modcall", ""); + } if (modcall == null || modcall === "") { // cancel } else { -- cgit