Skip to content

Commit 3f1739b

Browse files
committed
Do not attempt to pump mana if no potion is visible
1 parent 9c2b6d6 commit 3f1739b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/009-walker.lua

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Walker = (function()
2121
local prompt = Console.prompt
2222
local bankWithdrawGold = Npc.bankWithdrawGold
2323
local getMoney = Container.getMoney
24+
local getTotalItemCount = Container.getTotalItemCount
2425

2526
local function walkerLabelExists(label)
2627
local waypoints = _settings['Walker']['WaypointList']
@@ -650,6 +651,10 @@ Walker = (function()
650651
local function walkerRestoreMana(potionid, manaRestorePercent, callback)
651652
local selfid = xeno.getSelfID()
652653
local function pump()
654+
if getTotalItemCount(potionid) == 0 then
655+
return
656+
end
657+
653658
-- Stop if creature onscreen
654659
local pos = xeno.getSelfPosition()
655660
for i = CREATURES_LOW, CREATURES_HIGH do

0 commit comments

Comments
 (0)