From 213e82f2c1398c56f3e91d38d31daec5b3dbc2a7 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Fri, 11 Aug 2023 11:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/battle_base_controller.lua | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lua/app/module/battle/controller/battle_base_controller.lua b/lua/app/module/battle/controller/battle_base_controller.lua index e50a0479..5e275c34 100644 --- a/lua/app/module/battle/controller/battle_base_controller.lua +++ b/lua/app/module/battle/controller/battle_base_controller.lua @@ -2102,34 +2102,38 @@ function BattleBaseController:fillThisPos(posId, columnCount, gridMap, reverse) end function BattleBaseController:judgeGridEdgeCanFall(posId, fallPosId, reverse) + local direction = ModuleManager.BattleManager:getPosDirection(posId, fallPosId) + local reverseDirection = ModuleManager.BattleManager:getReverseDirection(direction) local fallDownPosId - if reverse then - --竖向 - local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP) - if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then - return - end - - fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP) - if fallDownPosId then - local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) + if reverseDirection then + if reverse then + --竖向 + local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP) if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then return end - end - else - --竖向 - local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) - if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then - return - end - - fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) - if fallDownPosId then - local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.UP) + + fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.UP) + if fallDownPosId then + local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) + if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then + return + end + end + else + --竖向 + local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then return end + + fallDownPosId = ModuleManager.BattleManager:getPosByDirection(fallPosId, BattleConst.BOARD_RANGE_TYPE.DOWN) + if fallDownPosId then + local gridEdgeEntity = self.battleData:getGridEdgeEntity(fallDownPosId, BattleConst.BOARD_RANGE_TYPE.UP) + if gridEdgeEntity and not gridEdgeEntity:getIsIdle() then + return + end + end end end