Commit 4ee2fe3183ec2097755c145ae4e675194371e8d4

Authored by chenyueqi
1 parent 27dd1a36

电波塔bug

Showing 2 changed files with 3 additions and 3 deletions   Show diff stats
src/actions/TowerAction.lua
@@ -78,11 +78,11 @@ function _M.endBattleRpc(agent, data) @@ -78,11 +78,11 @@ function _M.endBattleRpc(agent, data)
78 local curTower = csvdb["tower_battleCsv"][id] 78 local curTower = csvdb["tower_battleCsv"][id]
79 if not curTower then return 2 end 79 if not curTower then return 2 end
80 80
  81 + local towerInfo = role:getProperty("towerInfo")
81 local towerType = math.floor(id / 10000) 82 local towerType = math.floor(id / 10000)
82 local towerLevel = {[0] = (towerInfo.l or 1), [1] = (towerInfo.l1 or 10001), [2] = (towerInfo.l2 or 20001), [3] = (towerInfo.l3 or 30001)} 83 local towerLevel = {[0] = (towerInfo.l or 1), [1] = (towerInfo.l1 or 10001), [2] = (towerInfo.l2 or 20001), [3] = (towerInfo.l3 or 30001)}
83 local curLevel = towerLevel[towerType] 84 local curLevel = towerLevel[towerType]
84 85
85 - local towerInfo = role:getProperty("towerInfo")  
86 if curLevel ~= id or not towerInfo.k or towerInfo.k ~= key then 86 if curLevel ~= id or not towerInfo.k or towerInfo.k ~= key then
87 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({errorCode = 1})) 87 SendPacket(actionCodes.Tower_endBattleRpc, MsgPack.pack({errorCode = 1}))
88 return true 88 return true
@@ -105,7 +105,7 @@ function _M.endBattleRpc(agent, data) @@ -105,7 +105,7 @@ function _M.endBattleRpc(agent, data)
105 if msg.starNum and msg.starNum > 0 then --win 105 if msg.starNum and msg.starNum > 0 then --win
106 curCount = math.min(curCount + 1, globalCsv.tower_count_limit) -- 返还次数 106 curCount = math.min(curCount + 1, globalCsv.tower_count_limit) -- 返还次数
107 --排行榜 107 --排行榜
108 - role:setTowerRank(curLevel % 10000, towerType) 108 + role:setTowerRank(curLevel % 10000, towerType + 1)
109 109
110 curLevel = curLevel + 1 110 curLevel = curLevel + 1
111 reward, change = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}}) 111 reward, change = role:award(curTower.reward, {log = {desc = "towerBattle", int1 = id}})
src/models/RolePlugin.lua
@@ -2176,7 +2176,7 @@ function RolePlugin.bind(Role) @@ -2176,7 +2176,7 @@ function RolePlugin.bind(Role)
2176 if not update and self.towerBnousActive then 2176 if not update and self.towerBnousActive then
2177 return self.towerBnousActive 2177 return self.towerBnousActive
2178 end 2178 end
2179 - local towerInfo = role:getProperty("towerInfo") 2179 + local towerInfo = self:getProperty("towerInfo")
2180 local towerLevel = {towerInfo.l or 1, towerInfo.l1 or 10001, towerInfo.l2 or 20001, towerInfo.l3 or 30001} 2180 local towerLevel = {towerInfo.l or 1, towerInfo.l1 or 10001, towerInfo.l2 or 20001, towerInfo.l3 or 30001}
2181 local towerBnous = self:getProperty("towerBnous") 2181 local towerBnous = self:getProperty("towerBnous")
2182 local bnousCsv = csvdb["tower_battle_additionCsv"] 2182 local bnousCsv = csvdb["tower_battle_additionCsv"]