Commit cfae632ea12524ee862c17b13dde74b28e7bac57
1 parent
7eda801e
玩家商品购买次数减一
Showing
1 changed file
with
13 additions
and
0 deletions
Show diff stats
src/actions/GmAction.lua
@@ -1139,4 +1139,17 @@ function _M.get_draw_hero_pro(role, pms) | @@ -1139,4 +1139,17 @@ function _M.get_draw_hero_pro(role, pms) | ||
1139 | return json.encode(result) | 1139 | return json.encode(result) |
1140 | end | 1140 | end |
1141 | 1141 | ||
1142 | +function _M.decrePayR(role, pms) | ||
1143 | + local id = tonumber(pms.pm1) | ||
1144 | + local payR = role.storeData:getProperty("payR") | ||
1145 | + if payR[id] > 0 then | ||
1146 | + payR[id] = payR[id] - 1 | ||
1147 | + if payR[id] == 0 then | ||
1148 | + payR[id] = nil | ||
1149 | + end | ||
1150 | + end | ||
1151 | + role.storeData:updateProperty({field = "payR", value = payR}) | ||
1152 | + return "指令成功" | ||
1153 | +end | ||
1154 | + | ||
1142 | return _M | 1155 | return _M |
1143 | \ No newline at end of file | 1156 | \ No newline at end of file |