From a937f9bde1ae9f45857550c6067616182f2745a6 Mon Sep 17 00:00:00 2001 From: sD Date: Sat, 11 Jan 2020 16:07:19 +0100 Subject: make music charid a number --- webAO/client.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'webAO/client.js') diff --git a/webAO/client.js b/webAO/client.js index fa1df5d..6f11881 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -552,12 +552,13 @@ class Client extends EventEmitter { * @param {Array} args packet arguments */ handleMC(args) { - const [_packet, track, charID] = args; + const track = args[1]; + const charID = Number(args[2]); const music = viewport.music; music.pause(); music.src = MUSIC_HOST + track.toLowerCase(); music.play(); - if (Number(args[2]) >= 0) { + if (charID >= 0) { const musicname = this.chars[charID].name; appendICLog(`${musicname} changed music to ${track}`); } else { -- cgit