diff --git a/src/actions/TowerAction.lua b/src/actions/TowerAction.lua index 7d6358d..d11d433 100644 --- a/src/actions/TowerAction.lua +++ b/src/actions/TowerAction.lua @@ -78,11 +78,11 @@ function _M.endBattleRpc(agent, data) local curTower = csvdb["tower_battleCsv"][id] if not curTower then return 2 end + local towerInfo = role:getProperty("towerInfo") local towerType = math.floor(id / 10000) local towerLevel = {[0] = (towerInfo.l or 1), [1] = (towerInfo.l1 or 10001), [2] = (towerInfo.l2 or 20001), [3] = (towerInfo.l3 or 30001)} local curLevel = towerLevel[towerType] - local towerInfo = role:getProperty("towerInfo") if curLevel ~= id or not towerInfo.k or towerInfo.k ~= key then SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({errorCode = 1})) return true @@ -105,7 +105,7 @@ function _M.endBattleRpc(agent, data) if msg.starNum and msg.starNum > 0 then --win curCount = math.min(curCount + 1, globalCsv.tower_count_limit) -- 返还次数 --排行榜 - role:setTowerRank(curLevel % 10000, towerType) + role:setTowerRank(curLevel % 10000, towerType + 1) curLevel = curLevel + 1 reward, change = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}}) diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 40b365d..4766bf9 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -2176,7 +2176,7 @@ function RolePlugin.bind(Role) if not update and self.towerBnousActive then return self.towerBnousActive end - local towerInfo = role:getProperty("towerInfo") + local towerInfo = self:getProperty("towerInfo") local towerLevel = {towerInfo.l or 1, towerInfo.l1 or 10001, towerInfo.l2 or 20001, towerInfo.l3 or 30001} local towerBnous = self:getProperty("towerBnous") local bnousCsv = csvdb["tower_battle_additionCsv"] -- libgit2 0.21.2