aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2019-12-18 20:01:49 +0100
committersD <stoned@derpymail.org>2019-12-18 20:01:49 +0100
commit71fc9efce9c1afb09353bdf05161bc986cf49622 (patch)
tree61651f5bd48d0c7c7f0f587ff1d90547883a7161 /webAO/client.js
parent863a532d7602352df93fa52ddd62cc3534dc9690 (diff)
some defaults for fucked inis
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/webAO/client.js b/webAO/client.js
index 0865f68..9a663f2 100644
--- a/webAO/client.js
+++ b/webAO/client.js
@@ -550,8 +550,17 @@ class Client extends EventEmitter {
const cinidata = await request(AO_HOST + "characters/" + escape(chargs[0].toLowerCase()) + "/char.ini");
cini = INI.parse(cinidata.toLowerCase());
} catch(err) {
- cini = {options: {name: chargs[0].toLowerCase(),showname: chargs[0],side: "def", gender: "male"}};
+ cini = {};
}
+ if (cini.options.name === undefined)
+ cini.options.name = chargs[0].toLowerCase();
+ if (cini.options.showname === undefined)
+ cini.options.showname = chargs[0];
+ if (cini.options.side === undefined)
+ cini.options.side = "def";
+ if (cini.options.gender === undefined)
+ cini.options.gender = "male";
+
console.log(cini);
this.chars[charid] = {
name: chargs[0],