diff options
| author | sD <stoned@derpymail.org> | 2019-12-18 20:01:49 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2019-12-18 20:01:49 +0100 |
| commit | 71fc9efce9c1afb09353bdf05161bc986cf49622 (patch) | |
| tree | 61651f5bd48d0c7c7f0f587ff1d90547883a7161 /webAO/client.js | |
| parent | 863a532d7602352df93fa52ddd62cc3534dc9690 (diff) | |
some defaults for fucked inis
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 11 |
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], |
