From 08d88cd296c0f1fdf2d8b586ddb16fb566b8d61b Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Sun, 21 Apr 2019 22:24:02 +0200 Subject: [PATCH] Return default facility name when user name is undefined Closes #678. --- src/004-base/facility.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/004-base/facility.js b/src/004-base/facility.js index a827c02e81d..08b59e59f07 100644 --- a/src/004-base/facility.js +++ b/src/004-base/facility.js @@ -245,7 +245,8 @@ App.Entity.Facilities.Facility = class { /** Facility display name * @returns {string} */ get name() { - return State.variables[this.desc.baseName + "Name"]; + const res = State.variables[this.desc.baseName + "Name"]; + return res !== undefined ? res : 'the ' + this.genericName; } /** Facility generic name ("Brothel", "Schoolroom", etc.) -- GitLab