From 3d53f17fa74e49c19716be9ffc7585fa86d1aa90 Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 17 Jul 2019 00:41:05 +0200 Subject: why not trust the servers charid. this fixed the reset and removes a loop --- webAO/client.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'webAO') diff --git a/webAO/client.js b/webAO/client.js index 2a8bb94..8a5ddfb 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -473,7 +473,7 @@ class Client extends EventEmitter { side: args[6], sound: escape(args[7]), type: args[8], - // charid: args[9], + charid: args[9], snddelay: args[10], objection: args[11], evidence: args[12], @@ -482,16 +482,8 @@ class Client extends EventEmitter { color: args[15], isnew: true, }; - - // The dreaded linear search... - for (let i = 0; i < this.chars.length; i++) { - if (this.chars[i].name === args[3]) { - chatmsg.character = i; - break; - } - } - - if (chatmsg.character === this.charID) { + + if (chatmsg.charid === this.charID) { resetICParams(); } -- cgit