diff --git a/src/ProtocolCode.lua b/src/ProtocolCode.lua index 9da88ab..3dba2e3 100644 --- a/src/ProtocolCode.lua +++ b/src/ProtocolCode.lua @@ -90,7 +90,7 @@ actionCodes = { Hero_drawHeroRpc = 220, Hero_repayHeroRpc = 221, Hero_unlockPoolRpc = 222, - Hero_changeCrownRpc = 223, + Hero_changeCrown = 223, Hang_startRpc = 251, Hang_checkRpc = 252, diff --git a/src/actions/HeroAction.lua b/src/actions/HeroAction.lua index 068c521..1b5fba8 100644 --- a/src/actions/HeroAction.lua +++ b/src/actions/HeroAction.lua @@ -941,19 +941,18 @@ function _M.unlockPoolRpc(agent, data) return true end -function _M.changeCrownRpc(agnet, data) +function _M.changeCrown(agnet, data) local role = agent.role local msg = MsgPack.unpack(data) local heroType = msg.heroType - if not role:isHaveHero(heroType) then return end + if not role:isHaveHero(heroType) then return true end role:setProperty("crown", heroType) role:log("hero_show", { hero_id = heroType, }) - SendPacket(actionCodes.Hero_changeCrownRpc, "") return true end -- libgit2 0.21.2