Browse Source

debug step 0

SaltyMonkey 6 years ago
parent
commit
22a287ed35
2 changed files with 3 additions and 3 deletions
  1. 2 2
      lib/unitCommands.js
  2. 1 1
      lib/unitFps.js

+ 2 - 2
lib/unitCommands.js

@@ -50,7 +50,7 @@ class unitControl {
 			if(res.bestMatch.rating < 0.2) { deps.mod.command.message("Mode was not found"); return; }
 
 			deps.data.prevMode = rfdc(deps.data.activeMode);
-			deps.data.activeMode = deps.data.preset[res.bestMatch.target];
+			deps.data.activeMode = deps.data.preset.modes[res.bestMatch.target];
 			deps.mod.command.message(`Mode was changed to "${res.bestMatch.target}".`);
 			deps.data._eventTrigger();
 		};
@@ -81,7 +81,7 @@ class unitControl {
 			prefixes.push(deps.mod.settings.customCommandsTag);
 
 		if (deps.mod.settings.registerCommands)
-			deps.mod.command.add(prefixes, commands);
+			deps.mod.command.add(prefixes, commands, this);
 	}
 }
 module.exports = unitControl;

+ 1 - 1
lib/unitFps.js

@@ -231,7 +231,7 @@ class unitFps {
 
 		const throttlePacketsHandler = (name, code, payload) => {
 			// eslint-disable-next-line no-magic-numbers
-			let needBlock = (data.activeMode.throttleSomePackets && throttlePacketsData[name] && (Buffer.compare(throttlePacketsData[name], payload) === 0));
+			let needBlock = (data.activeMode.throttleSomePackets && throttlePacketsData[name] && (throttlePacketsData[name].equals(payload)));
 			throttlePacketsData[name] = payload;
 			return needBlock ? false : undefined;
 		};