Fukki лет назад: 7
Родитель
Сommit
e9ec27b8ba
2 измененных файлов с 13 добавлено и 13 удалено
  1. 12 12
      index.js
  2. 1 1
      manifest.json

+ 12 - 12
index.js

@@ -45,13 +45,13 @@ module.exports = function AutoPOT(mod) {
 	mod.hook('S_INVEN', 16, e => {
 	mod.hook('S_INVEN', 16, e => {
 		if (config.enabled) {
 		if (config.enabled) {
 			let hp = null, mp = null;
 			let hp = null, mp = null;
-			for(let i = 0; i < hpPot.length; i++) {
-				hp = e.items.find(item => item.id === Number(hpPot[i][0]));
-				if (hp) hpPot[i][1].amount = hp.amount;
+			for(let h = 0; h < hpPot.length; h++) {
+				hp = e.items.find(item => item.id === Number(hpPot[h][0]));
+				if (hp) hpPot[h][1].amount = hp.amount;
 			}
 			}
-			for(let i = 0; i < mpPot.length; i++) {
-				mp = e.items.find(item => item.id === Number(mpPot[i][0]));
-				if (mp) mpPot[i][1].amount = mp.amount;
+			for(let m = 0; m < mpPot.length; m++) {
+				mp = e.items.find(item => item.id === Number(mpPot[m][0]));
+				if (mp) mpPot[m][1].amount = mp.amount;
 			}
 			}
 		}
 		}
 	});
 	});
@@ -62,16 +62,16 @@ module.exports = function AutoPOT(mod) {
 			hp = hpPot.findIndex(item => Number(item[0]) === e.item);
 			hp = hpPot.findIndex(item => Number(item[0]) === e.item);
 			if (hp >= 0 && !hpPot[hp][1].inCd) {
 			if (hp >= 0 && !hpPot[hp][1].inCd) {
 				hpPot[hp][1].inCd = true;
 				hpPot[hp][1].inCd = true;
-				setTimeout(function () {
-					hpPot[hp][1].inCd = false;
-				}, e.cooldown);
+				setTimeout(function (h) {
+					hpPot[h][1].inCd = false;
+				}, e.cooldown, hp);
 			}
 			}
 			mp = mpPot.findIndex(item => Number(item[0]) === e.item);
 			mp = mpPot.findIndex(item => Number(item[0]) === e.item);
 			if (mp >= 0 && !mpPot[mp][1].inCd) {
 			if (mp >= 0 && !mpPot[mp][1].inCd) {
 				mpPot[mp][1].inCd = true;
 				mpPot[mp][1].inCd = true;
-				setTimeout(function () {
-					mpPot[mp][1].inCd = false;
-				}, e.cooldown);
+				setTimeout(function (m) {
+					mpPot[m][1].inCd = false;
+				}, e.cooldown, mp);
 			}
 			}
 		}
 		}
  	});
  	});

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
 {
 	"files": {
 	"files": {
-		"index.js": "02d06f96c9fdbec066551e439f3e726cbe61e349bd83e7a141d6c2be7a91ecb6"
+		"index.js": "5dc0cad5ae05fb67d5edc565b0d10360f46055c92cf080dc9bcceb4516ccd78f"
 	},
 	},
 	"defs": {
 	"defs": {
 		"C_USE_ITEM": 3,
 		"C_USE_ITEM": 3,