From 5470c5309c335f8d4605d4dd4ca56994270a14ba Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Mon, 1 Feb 2021 09:31:06 +0800 Subject: [PATCH] 先判断药水补给的数量是否大于0 --- src/adv/Adv.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adv/Adv.lua b/src/adv/Adv.lua index 1d34113..b4bb351 100644 --- a/src/adv/Adv.lua +++ b/src/adv/Adv.lua @@ -1191,10 +1191,10 @@ function Adv:supplyPotion() local old = advItems:getv(potionId,0) local need = max - old - if need < count then + if need < 0 then + elseif need < count then advItems = advItems:setv(potionId,max) potionBag[potionId] = count - need - elseif need < 0 then else advItems = advItems:setv(potionId,old + count) potionBag[potionId] = nil -- libgit2 0.21.2