From cfae632ea12524ee862c17b13dde74b28e7bac57 Mon Sep 17 00:00:00 2001 From: liuzujun Date: Sun, 26 Sep 2021 09:09:22 +0800 Subject: [PATCH] 玩家商品购买次数减一 --- src/actions/GmAction.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+), 0 deletions(-) diff --git a/src/actions/GmAction.lua b/src/actions/GmAction.lua index f093107..bf2f59e 100644 --- a/src/actions/GmAction.lua +++ b/src/actions/GmAction.lua @@ -1139,4 +1139,17 @@ function _M.get_draw_hero_pro(role, pms) return json.encode(result) end +function _M.decrePayR(role, pms) + local id = tonumber(pms.pm1) + local payR = role.storeData:getProperty("payR") + if payR[id] > 0 then + payR[id] = payR[id] - 1 + if payR[id] == 0 then + payR[id] = nil + end + end + role.storeData:updateProperty({field = "payR", value = payR}) + return "指令成功" +end + return _M \ No newline at end of file -- libgit2 0.21.2