Fukki 7 years ago
parent
commit
99794f0b6f
2 changed files with 6 additions and 11 deletions
  1. 5 10
      index.js
  2. 1 1
      manifest.json

+ 5 - 10
index.js

@@ -1,8 +1,7 @@
 const path = require('path'); const fs = require('fs');
 module.exports = function AutoPOT(mod) {
 	const cmd = mod.command || mod.require.command, map = new WeakMap();
-	let config = getConfig(), hpPot = getHP(), mpPot = getMP(), aLoc = null, wLoc = 0;
-	let invUpdate = false, TmpData = [], aRes = null;
+	let config = getConfig(), hpPot = getHP(), mpPot = getMP(), TmpData = [], aRes = null, aLoc = null, wLoc = 0;
 	mod.game.initialize(['me', 'contract', 'inventory']);
 
 	if (!map.has(mod.dispatch || mod)) {
@@ -235,14 +234,10 @@ module.exports = function AutoPOT(mod) {
 	});
 	
 	mod.hook('S_INVEN', 'raw', () => {
-		if (!invUpdate) {
-			invUpdate = true;
-			for(let hp = 0; hp < hpPot.length; hp++)
-				hpPot[hp][1].amount = mod.game.inventory.getTotalAmount(s2n(hpPot[hp][0]));
-			for(let mp = 0; mp < mpPot.length; mp++)
-				mpPot[mp][1].amount = mod.game.inventory.getTotalAmount(s2n(mpPot[mp][0]));
-			invUpdate = false;
-		}
+		for(let hp = 0; hp < hpPot.length; hp++)
+			hpPot[hp][1].amount = mod.game.inventory.getTotalAmount(s2n(hpPot[hp][0]));
+		for(let mp = 0; mp < mpPot.length; mp++)
+			mpPot[mp][1].amount = mod.game.inventory.getTotalAmount(s2n(mpPot[mp][0]));
 	});
 	
 	mod.hook('S_RETURN_TO_LOBBY', 'raw', () => {

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
 	"files": {
-		"index.js": "87ead5037b3d5f272ab1147c66c3e8f0cc7376f26a93ca6455f4273038cac0d2"
+		"index.js": "2fcd76e36daa7a33260c3b7328d68acb1d690e391b309689f2823390ef0d7f1c"
 	},
 	"defs": {
 		"C_ADMIN": 1,