Commit 9a6d3ed3e07b7edc0b3ccc623be7a72e779648f4
1 parent
cec4aa73
fix: unLockStoryBookRpc 客户端重复领取,临时解决。
Showing
2 changed files
with
10 additions
and
5 deletions
 
Show diff stats
src/actions/RoleAction.lua
| @@ -981,13 +981,18 @@ function _M.unLockStoryBookRpc(agent, data) | @@ -981,13 +981,18 @@ function _M.unLockStoryBookRpc(agent, data) | ||
| 981 | if not storyBookData or storyBookData.lockItem == "" then return 1 end -- 不能解锁 | 981 | if not storyBookData or storyBookData.lockItem == "" then return 1 end -- 不能解锁 | 
| 982 | 982 | ||
| 983 | local storyStatus = role:getProperty("storyB") | 983 | local storyStatus = role:getProperty("storyB") | 
| 984 | - if storyStatus[storyId] and storyStatus[storyId].s then return 2 end --不需要解锁 | 984 | + | 
| 985 | + --不需要解锁 | ||
| 986 | + if storyStatus[storyId] and storyStatus[storyId].s then | ||
| 987 | + SendPacket(actionCodes.Role_unLockStoryBookRpc, '') | ||
| 988 | + return true | ||
| 989 | + end | ||
| 985 | 990 | ||
| 986 | if storyBookData.lockItem ~= "free" then | 991 | if storyBookData.lockItem ~= "free" then | 
| 987 | local cost = storyBookData.lockItem:toNumMap() | 992 | local cost = storyBookData.lockItem:toNumMap() | 
| 988 | - if not cost or not next(cost) then return 3 end | ||
| 989 | - if not role:checkItemEnough(cost) then return 4 end -- 消耗品不足 | ||
| 990 | - if not role:costItems(cost, {log = {desc = "unlockStory", int1 = storyId}}) then return 5 end | 993 | + if not cost or not next(cost) then return 2 end | 
| 994 | + if not role:checkItemEnough(cost) then return 3 end -- 消耗品不足 | ||
| 995 | + if not role:costItems(cost, {log = {desc = "unlockStory", int1 = storyId}}) then return 4 end | ||
| 991 | end | 996 | end | 
| 992 | 997 | ||
| 993 | -- 解锁 | 998 | -- 解锁 |