diff --git a/src/main/kotlin/cc/maxmc/blastingcrisis/game/GamePlaceBreakRule.kt b/src/main/kotlin/cc/maxmc/blastingcrisis/game/GamePlaceBreakRule.kt index 3fced52..2c0a716 100644 --- a/src/main/kotlin/cc/maxmc/blastingcrisis/game/GamePlaceBreakRule.kt +++ b/src/main/kotlin/cc/maxmc/blastingcrisis/game/GamePlaceBreakRule.kt @@ -39,17 +39,19 @@ class GamePlaceBreakRule(val game: Game) { game.map.teams.flatMap { it.sides + it.mine }.map { - it.containsBlock(loc) + it.containsBlock(loc).also { result -> debug("area $it contains $loc is $result") } }.reduce { a, b -> a || b } } // allow enemy wall addRule("allow_enemy_wall") { player, type, loc -> val team = player.team ?: return@addRule false - val result = game.teams.filterNot { it == team } + val isWall = game.teams .map { team.teamInfo.wall.containsBlock(loc) } .reduce { a, b -> a || b } - if (type == BREAK) result else !result + if (!isWall) return@addRule false + val isHome = team.teamInfo.wall.containsBlock(loc) + (type == BREAK) xor isHome } } } \ No newline at end of file