Commit 15f064562f81da377fc79c339c2802222a91ec4e
1 parent
d481965d
头像
Showing
1 changed file
with
12 additions
and
1 deletions
Show diff stats
src/actions/RoleAction.lua
| @@ -893,7 +893,18 @@ function _M.changeHeadRpc(agent, data) | @@ -893,7 +893,18 @@ function _M.changeHeadRpc(agent, data) | ||
| 893 | if not icon then | 893 | if not icon then |
| 894 | return | 894 | return |
| 895 | end | 895 | end |
| 896 | - if role:getItemCount(id) < 1 then | 896 | + |
| 897 | + local unlock = false | ||
| 898 | + if role:getItemCount(id) >= 1 then | ||
| 899 | + unlock = true | ||
| 900 | + else | ||
| 901 | + if icon.path == 1 then -- 获得对应英雄 | ||
| 902 | + if role:isHaveHero(icon.condition) then | ||
| 903 | + unlock = true | ||
| 904 | + end | ||
| 905 | + end | ||
| 906 | + end | ||
| 907 | + if not unlock then | ||
| 897 | return | 908 | return |
| 898 | end | 909 | end |
| 899 | role:updateProperty({field = "headId" ,value = id}) | 910 | role:updateProperty({field = "headId" ,value = id}) |