Commit e668f4d07f8f802cfe21b7785e15fea3d7ac6700
1 parent
3eb77775
fix cost
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/actions/CarAction.lua
| @@ -28,8 +28,8 @@ function _M.makePotionRpc( agent, data ) | @@ -28,8 +28,8 @@ function _M.makePotionRpc( agent, data ) | ||
| 28 | end | 28 | end |
| 29 | 29 | ||
| 30 | local cost = potionData.material:toNumMap() | 30 | local cost = potionData.material:toNumMap() |
| 31 | - for _, n in pairs(cost) do | ||
| 32 | - n = n * count | 31 | + for k, n in pairs(cost) do |
| 32 | + cost[k] = n * count | ||
| 33 | end | 33 | end |
| 34 | if not role:checkItemEnough(cost) then | 34 | if not role:checkItemEnough(cost) then |
| 35 | return 5 | 35 | return 5 |
| @@ -70,8 +70,8 @@ function _M.equipUpRpc( agent, data ) | @@ -70,8 +70,8 @@ function _M.equipUpRpc( agent, data ) | ||
| 70 | end | 70 | end |
| 71 | 71 | ||
| 72 | local cost = equipData.cost:toNumMap() | 72 | local cost = equipData.cost:toNumMap() |
| 73 | - for _, n in pairs(cost) do | ||
| 74 | - n = n * count | 73 | + for k, n in pairs(cost) do |
| 74 | + cost[k] = n * count | ||
| 75 | end | 75 | end |
| 76 | if not role:checkItemEnough(cost) then | 76 | if not role:checkItemEnough(cost) then |
| 77 | return 4 | 77 | return 4 |