Commit 5470c5309c335f8d4605d4dd4ca56994270a14ba

Authored by chenyueqi
1 parent ad76af64

先判断药水补给的数量是否大于0

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/adv/Adv.lua
... ... @@ -1191,10 +1191,10 @@ function Adv:supplyPotion()
1191 1191 local old = advItems:getv(potionId,0)
1192 1192 local need = max - old
1193 1193  
1194   - if need < count then
  1194 + if need < 0 then
  1195 + elseif need < count then
1195 1196 advItems = advItems:setv(potionId,max)
1196 1197 potionBag[potionId] = count - need
1197   - elseif need < 0 then
1198 1198 else
1199 1199 advItems = advItems:setv(potionId,old + count)
1200 1200 potionBag[potionId] = nil
... ...