Browse Source

slight refactor

SaltyMonkey 6 years ago
parent
commit
7acaafa85b
1 changed files with 1 additions and 7 deletions
  1. 1 7
      lib/unitState.js

+ 1 - 7
lib/unitState.js

@@ -63,7 +63,7 @@ class unitState extends EventEmitter {
 				this.onScreenEffectsBuffs.add(abnormality.id);
 				this.onScreenEffectsBuffs.add(abnormality.id);
 		});
 		});
 
 
-		this.__mod.mod.queryData("/S1ActionScripts@type=?/Script/", ["Teleport"], true, false, ["id"]).then(result => {
+		this.__mod.queryData("/S1ActionScripts@type=?/Script/", ["Teleport"], true, false, ["id"]).then(result => {
 			let res = result.map(rs => rs.attributes.id);
 			let res = result.map(rs => rs.attributes.id);
 			res.forEach(x => { this.specialAs.add(x); });
 			res.forEach(x => { this.specialAs.add(x); });
 		});
 		});
@@ -79,11 +79,9 @@ class unitState extends EventEmitter {
 
 
 	Init() {
 	Init() {
 		console.log("DEBUG: unitState -> Init");
 		console.log("DEBUG: unitState -> Init");
-
 		([...this.availableClasses]).forEach(x => {
 		([...this.availableClasses]).forEach(x => {
 			this.presets[x] = utils.loadJson(utils.getFullPath(__dirname, `../settings/presets/${x}.json`));
 			this.presets[x] = utils.loadJson(utils.getFullPath(__dirname, `../settings/presets/${x}.json`));
 		});
 		});
-
 		let staticData = utils.loadJson(utils.getFullPath(__dirname, "../data/staticData.json"));
 		let staticData = utils.loadJson(utils.getFullPath(__dirname, "../data/staticData.json"));
 
 
 		this.lockedPacketsData = staticData.blockedProto;
 		this.lockedPacketsData = staticData.blockedProto;
@@ -94,17 +92,13 @@ class unitState extends EventEmitter {
 			this.preset = this.__mod.settings.classBasedPresets
 			this.preset = this.__mod.settings.classBasedPresets
 				? (this.presets[this.__mod.game.me.class] || this.presets["common"])
 				? (this.presets[this.__mod.game.me.class] || this.presets["common"])
 				: this.presets["common"];
 				: this.presets["common"];
-
 			if (!this.preset) { throw new Error("Preset can't be loaded! Critical error. "); }
 			if (!this.preset) { throw new Error("Preset can't be loaded! Critical error. "); }
-
 			this.activeMode = this.preset.modes[this.preset.directives["default"]];
 			this.activeMode = this.preset.modes[this.preset.directives["default"]];
 		});
 		});
 
 
 		this.__mod.hook(...this.__proto.getData("S_LOAD_TOPO"), (event) => {
 		this.__mod.hook(...this.__proto.getData("S_LOAD_TOPO"), (event) => {
 			if (!this.__mod.settings.enableEvents) return;
 			if (!this.__mod.settings.enableEvents) return;
-
 			this.prevMode = rfdc(this.activeMode);
 			this.prevMode = rfdc(this.activeMode);
-
 			if (this.__mod.game.me.inBattleground && this.preset.directives.triggerBG) {
 			if (this.__mod.game.me.inBattleground && this.preset.directives.triggerBG) {
 				this.activeMode = this.preset.modes[this.preset.directives.triggerBG];
 				this.activeMode = this.preset.modes[this.preset.directives.triggerBG];
 				this.__mod.command.message(`Mode was changed to "${this.preset.directives.triggerBG}".`);
 				this.__mod.command.message(`Mode was changed to "${this.preset.directives.triggerBG}".`);