aboutsummaryrefslogtreecommitdiff
path: root/webAO
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2019-07-17 00:41:05 +0200
committerstonedDiscord <stoned@derpymail.org>2019-07-17 00:41:05 +0200
commit3d53f17fa74e49c19716be9ffc7585fa86d1aa90 (patch)
tree0246136321e28342afc38a71cea3cea0cd37b1ad /webAO
parent0724018f16ff439ffc6218dfbd35d082117ffd52 (diff)
why not trust the servers charid. this fixed the reset and removes a loop
Diffstat (limited to 'webAO')
-rw-r--r--webAO/client.js14
1 files changed, 3 insertions, 11 deletions
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();
}