aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.js
diff options
context:
space:
mode:
authorsD <stoned@derpymail.org>2019-12-19 16:05:18 +0100
committersD <stoned@derpymail.org>2019-12-19 16:05:18 +0100
commit9fc6fa6e2308c74394698645b652fbf579b02b88 (patch)
treeecc4b3389172c0a086a8dd3aae276b2b5ecd966f /webAO/client.js
parent7169a80cf4e68ae06069cfb2bfbcd003b3a892fd (diff)
assign looks neat
Diffstat (limited to 'webAO/client.js')
-rw-r--r--webAO/client.js17
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(),