bug修复
This commit is contained in:
parent
eb3ec49d37
commit
5de785f28e
@ -219,43 +219,35 @@ function BattleManager:getAroundPosIds(posId, direction, range, cludePosIdsMap,
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif direction == BattleConst.BOARD_RANGE_TYPE.LEFT_UP then
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.LEFT_UP then
|
||||||
for i = c - 1, c - range, -1 do
|
for i = 1, range do
|
||||||
if i >= 1 then
|
local newR = r - i
|
||||||
for j = r - 1, r - range, -1 do
|
local newC = c - i
|
||||||
if j >= 1 then
|
if newR >= 1 and newC >= 1 then
|
||||||
table.insert(posIdList, {posId = self:getPosId(j, i), direction = direction})
|
table.insert(posIdList, {posId = self:getPosId(newR, newC), direction = direction})
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif direction == BattleConst.BOARD_RANGE_TYPE.LEFT_DOWN then
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.LEFT_DOWN then
|
||||||
for i = c - 1, c - range, -1 do
|
for i = 1, range do
|
||||||
if i >= 1 then
|
local newR = r + i
|
||||||
for j = r + 1, r + range do
|
local newC = c - i
|
||||||
if j <= BattleConst.ROW_COUNT then
|
if newR <= BattleConst.ROW_COUNT and newC >= 1 then
|
||||||
table.insert(posIdList, {posId = self:getPosId(j, i), direction = direction})
|
table.insert(posIdList, {posId = self:getPosId(newR, newC), direction = direction})
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif direction == BattleConst.BOARD_RANGE_TYPE.RIGHT_UP then
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.RIGHT_UP then
|
||||||
for i = c + 1, c + range do
|
for i = 1, range do
|
||||||
if i <= BattleConst.COLUMN_COUNT then
|
local newR = r - i
|
||||||
for j = r - 1, r - range, -1 do
|
local newC = c + i
|
||||||
if j >= 1 then
|
if newR >= 1 and newC <= BattleConst.COLUMN_COUNT then
|
||||||
table.insert(posIdList, {posId = self:getPosId(j, i), direction = direction})
|
table.insert(posIdList, {posId = self:getPosId(newR, newC), direction = direction})
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif direction == BattleConst.BOARD_RANGE_TYPE.RIGHT_DOWN then
|
elseif direction == BattleConst.BOARD_RANGE_TYPE.RIGHT_DOWN then
|
||||||
for i = c + 1, c + range do
|
for i = 1, range do
|
||||||
if i <= BattleConst.COLUMN_COUNT then
|
local newR = r + i
|
||||||
for j = r + 1, r + range do
|
local newC = c + i
|
||||||
if j <= BattleConst.ROW_COUNT then
|
if newR <= BattleConst.ROW_COUNT and newC <= BattleConst.COLUMN_COUNT then
|
||||||
table.insert(posIdList, {posId = self:getPosId(j, i), direction = direction})
|
table.insert(posIdList, {posId = self:getPosId(newR, newC), direction = direction})
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user