fix rule logic
This commit is contained in:
parent
20b1004e62
commit
ef8e2391d6
|
|
@ -39,15 +39,17 @@ class GamePlaceBreakRule(val game: Game) {
|
|||
game.map.teams.flatMap {
|
||||
it.sides + it.mine
|
||||
}.map {
|
||||
it.containsBlock(loc).also { result -> debug("area $it contains $loc is $result") }
|
||||
it.containsBlock(loc)
|
||||
}.reduce { a, b -> a || b }
|
||||
}
|
||||
|
||||
// allow enemy wall
|
||||
addRule("allow_enemy_wall") { player, type, loc ->
|
||||
addRule("allow_wall_conditional") { player, type, loc ->
|
||||
val team = player.team ?: return@addRule false
|
||||
val isWall = game.teams
|
||||
.map { team.teamInfo.wall.containsBlock(loc) }
|
||||
.map {
|
||||
it.teamInfo.wall.containsBlock(loc).also { result -> debug("area ${it.teamInfo.wall} contains $loc is $result") }
|
||||
}
|
||||
.reduce { a, b -> a || b }
|
||||
if (!isWall) return@addRule false
|
||||
val isHome = team.teamInfo.wall.containsBlock(loc)
|
||||
|
|
|
|||
Loading…
Reference in New Issue