Browse Source

fix message for dungeon switch

SaltyMonkey 6 years ago
parent
commit
0a88daa08a
1 changed files with 12 additions and 3 deletions
  1. 12 3
      lib/unitState.js

+ 12 - 3
lib/unitState.js

@@ -112,11 +112,20 @@ class unitState extends EventEmitter {
 				this.__mod.command.message(`Mode was changed to "${this.preset.directives.triggerCU}".`);
 				this.__mod.command.message(`Mode was changed to "${this.preset.directives.triggerCU}".`);
 			}
 			}
 			else if (this.__mod.game.me.inDungeon && this.preset.directives.triggerDungeons) {
 			else if (this.__mod.game.me.inDungeon && this.preset.directives.triggerDungeons) {
-				let mode = this.preset.modes[this.preset.directives.triggerDungeons[event.zone]] ||
-					this.preset.modes[this.preset.directives.triggerDungeons["all"]];
+				let mode = undefined;
+				let name = undefined;
+
+				if (this.preset.modes[this.preset.directives.triggerDungeons[event.zone]]) {
+					name = this.preset.directives.triggerDungeons[event.zone];
+					mode = this.preset.modes[this.preset.directives.triggerDungeons[event.zone]];
+				}
+				else if (this.preset.modes[this.preset.directives.triggerDungeons["all"]]) {
+					name = this.preset.directives.triggerDungeons["all"];
+					mode = this.preset.modes[this.preset.directives.triggerDungeons["all"]];
+				}
 				if(mode) {
 				if(mode) {
 					this.activeMode = mode;
 					this.activeMode = mode;
-					this.__mod.command.message(`Mode was changed to "${mode}".`);
+					this.__mod.command.message(`Mode was changed to ${name}`);
 				}
 				}
 			}
 			}
 			else if (this.__mod.game.me.inOpenWorld && this.preset.directives.triggerOW) {
 			else if (this.__mod.game.me.inOpenWorld && this.preset.directives.triggerOW) {