diff options
| author | sD <stoned@derpymail.org> | 2019-12-19 16:05:18 +0100 |
|---|---|---|
| committer | sD <stoned@derpymail.org> | 2019-12-19 16:05:18 +0100 |
| commit | 9fc6fa6e2308c74394698645b652fbf579b02b88 (patch) | |
| tree | ecc4b3389172c0a086a8dd3aae276b2b5ecd966f /webAO/client.js | |
| parent | 7169a80cf4e68ae06069cfb2bfbcd003b3a892fd (diff) | |
assign looks neat
Diffstat (limited to 'webAO/client.js')
| -rw-r--r-- | webAO/client.js | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/webAO/client.js b/webAO/client.js index 9f6039e..d1b8cb9 100644 --- a/webAO/client.js +++ b/webAO/client.js @@ -560,16 +560,13 @@ class Client extends EventEmitter { } // fix all the funny ini business - if (cini.options === undefined) - cini.options = {}; - 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"; + const default_options = { + name: chargs[0].toLowerCase(), + showname: chargs[0], + side: "def", + gender: "male" + }; + cini.options = Object.assign(default_options, cini.options); this.chars[charid] = { name: chargs[0].toLowerCase(), |
