Commit fed94c7ce111662be383a3d680f0a83848484ad8

Authored by zhouhaihai
1 parent 8cfb25d7

错误的函数

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
src/adv/AdvMap.lua
@@ -313,13 +313,13 @@ function Map:openBlocksIsMonsterByRoom(roomId, count, isPlayer, ignoreBack) @@ -313,13 +313,13 @@ function Map:openBlocksIsMonsterByRoom(roomId, count, isPlayer, ignoreBack)
313 end 313 end
314 end 314 end
315 315
316 - if not count or count == -1 or count >= len(allBlock) then 316 + if not count or count == -1 or count >= #allBlock then
317 for _, blockId in ipairs(allBlock) do 317 for _, blockId in ipairs(allBlock) do
318 openBlock(blockId) 318 openBlock(blockId)
319 end 319 end
320 else 320 else
321 for i = 1, count do 321 for i = 1, count do
322 - local idx = math.randomInt(1, len(allBlock)) 322 + local idx = math.randomInt(1, #allBlock)
323 openBlock(allBlock[idx]) 323 openBlock(allBlock[idx])
324 table.remove(allBlock, idx) 324 table.remove(allBlock, idx)
325 end 325 end