From 15f064562f81da377fc79c339c2802222a91ec4e Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Mon, 30 Dec 2019 13:39:19 +0800 Subject: [PATCH] 头像 --- src/actions/RoleAction.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/actions/RoleAction.lua b/src/actions/RoleAction.lua index 007e7f4..d250193 100644 --- a/src/actions/RoleAction.lua +++ b/src/actions/RoleAction.lua @@ -893,7 +893,18 @@ function _M.changeHeadRpc(agent, data) if not icon then return end - if role:getItemCount(id) < 1 then + + local unlock = false + if role:getItemCount(id) >= 1 then + unlock = true + else + if icon.path == 1 then -- 获得对应英雄 + if role:isHaveHero(icon.condition) then + unlock = true + end + end + end + if not unlock then return end role:updateProperty({field = "headId" ,value = id}) -- libgit2 0.21.2