Commit 22ef22a53a3697d9376387c8c564c3558c17324c

Authored by zhouhaihai
1 parent 39e60fd1

移除建筑

Showing 1 changed file with 9 additions and 0 deletions   Show diff stats
src/adv/AdvBattle.lua
@@ -332,6 +332,15 @@ function Battle:afterRound() @@ -332,6 +332,15 @@ function Battle:afterRound()
332 for i = #self.builds[mapIdx], 1, -1 do 332 for i = #self.builds[mapIdx], 1, -1 do
333 if self.builds[mapIdx][i].isDead then 333 if self.builds[mapIdx][i].isDead then
334 local build = table.remove(self.builds[mapIdx], i) 334 local build = table.remove(self.builds[mapIdx], i)
  335 +
  336 + local room = self.adv:getCurMap().rooms[build.roomId]
  337 + if room then
  338 + local block = room.blocks[build.blockId]
  339 + if block then
  340 + block:clear()
  341 + self.adv:backBlockChange(build.roomId, build.blockId)
  342 + end
  343 + end
335 build:clear() 344 build:clear()
336 end 345 end
337 end 346 end