Browse Source

default to `nickname` instead of `firstname` in `$npc.usedname`

Stephan Fuchs 10 tháng trước cách đây
mục cha
commit
5b56f081d8

+ 0 - 1
sugarcube/src/npcs/_npcstatic/compiled/npcstatic1compiled.js

@@ -868,7 +868,6 @@ setup.npcs["A32"] = {
 setup.npcs["A33"] = {
 	dna:'1429755064 1545843327 1198040660 1962976090 1780199176 1936146603 2049979334',
 	firstname:'Anya',
-	nickname:'Sister',
 	lastname:'Incorrect Initialization: $pc.name_last',
 	notes:'Your older sister',
 	dob:19970816,

+ 3 - 2
sugarcube/src/npcs/_system/NPC.js

@@ -107,12 +107,13 @@ class NPC{
 	}
 	get titlename(){return `${this.title} ${this.get('lastname')}`;}
 	get usedname(){
-		switch (this.get('nameScheme','firstname')) {
+		switch (this.get('nameScheme')) {
 			case 'title_lastname':
 				return this.titlename;
 			case 'firstname':
-			default:
 				return this.get('firstname');
+			default:
+				return this.get('nickname') || this.get('firstname');
 		}
 	}