Commit 667bd98bd1fb72a58be87a3b3de0ca3f681a9cae
1 parent
f037f9c3
增加 0 的判断
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
src/adv/Adv.lua
@@ -1377,7 +1377,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1377,7 +1377,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1377 | for _, room in pairs(self:getCurMap().rooms) do | 1377 | for _, room in pairs(self:getCurMap().rooms) do |
1378 | for _, block in pairs(room.blocks) do | 1378 | for _, block in pairs(room.blocks) do |
1379 | if block:isMonster() then | 1379 | if block:isMonster() then |
1380 | - if not monsterId then return false end | 1380 | + if not monsterId or monsterId == 0 then return false end |
1381 | if block.event.id == monsterId then | 1381 | if block.event.id == monsterId then |
1382 | return false | 1382 | return false |
1383 | end | 1383 | end |
@@ -1387,7 +1387,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1387,7 +1387,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1387 | else | 1387 | else |
1388 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1388 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1389 | if cblock:isMonster() then | 1389 | if cblock:isMonster() then |
1390 | - if not monsterId then return false end | 1390 | + if not monsterId or monsterId == 0 then return false end |
1391 | if cblock.event.id == monsterId then | 1391 | if cblock.event.id == monsterId then |
1392 | return false | 1392 | return false |
1393 | end | 1393 | end |
@@ -1402,7 +1402,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1402,7 +1402,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1402 | for _, room in pairs(self:getCurMap().rooms) do | 1402 | for _, room in pairs(self:getCurMap().rooms) do |
1403 | for _, block in pairs(room.blocks) do | 1403 | for _, block in pairs(room.blocks) do |
1404 | if block:isBuild() then | 1404 | if block:isBuild() then |
1405 | - if not buildId then return false end | 1405 | + if not buildId or buildId == 0 then return false end |
1406 | if block.event.id == buildId then | 1406 | if block.event.id == buildId then |
1407 | return false | 1407 | return false |
1408 | end | 1408 | end |
@@ -1412,7 +1412,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1412,7 +1412,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1412 | else | 1412 | else |
1413 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1413 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1414 | if cblock:isBuild() then | 1414 | if cblock:isBuild() then |
1415 | - if not buildId then return false end | 1415 | + if not buildId or buildId == 0 then return false end |
1416 | if cblock.event.id == buildId then | 1416 | if cblock.event.id == buildId then |
1417 | return false | 1417 | return false |
1418 | end | 1418 | end |
@@ -1427,7 +1427,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1427,7 +1427,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1427 | for _, room in pairs(self:getCurMap().rooms) do | 1427 | for _, room in pairs(self:getCurMap().rooms) do |
1428 | for _, block in pairs(room.blocks) do | 1428 | for _, block in pairs(room.blocks) do |
1429 | if block:isChoose() then | 1429 | if block:isChoose() then |
1430 | - if not chooseId then return false end | 1430 | + if not chooseId or chooseId == 0 then return false end |
1431 | if block.event.id == chooseId then | 1431 | if block.event.id == chooseId then |
1432 | return false | 1432 | return false |
1433 | end | 1433 | end |
@@ -1437,7 +1437,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | @@ -1437,7 +1437,7 @@ local function checkChooseCondFunc(self, condStr, room, block, tag, chooseData) | ||
1437 | else | 1437 | else |
1438 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do | 1438 | for _, cblock in ipairs(self:getCurMap():getBlocksBySize(room.roomId, block.blockId, size)) do |
1439 | if cblock:isChoose() then | 1439 | if cblock:isChoose() then |
1440 | - if not chooseId then return false end | 1440 | + if not chooseId or chooseId == 0 then return false end |
1441 | if cblock.event.id == chooseId then | 1441 | if cblock.event.id == chooseId then |
1442 | return false | 1442 | return false |
1443 | end | 1443 | end |