per-team toggles for core no-build radius / placement range check (#11448)

* per-team toggles for core no-build radius / placement range check

* oops

* fair enough
This commit is contained in:
WMF
2025-12-20 17:16:28 +01:00
committed by GitHub
parent 85b69d3afd
commit a1b47b1188
7 changed files with 39 additions and 11 deletions

View File

@@ -191,6 +191,10 @@ public class Build{
float mindst = Float.MAX_VALUE;
CoreBuild closest = null;
for(TeamData data : state.teams.active){
if(!data.team.rules().protectCores){
continue;
}
for(CoreBuild tile : data.cores){
float dst = tile.dst2(x * tilesize + type.offset, y * tilesize + type.offset);
if(dst < mindst){
@@ -265,7 +269,7 @@ public class Build{
}
public static @Nullable Building getEnemyOverlap(Block block, Team team, int x, int y){
return indexer.findEnemyTile(team, x * tilesize + block.size, y * tilesize + block.size, block.placeOverlapRange + 4f, p -> true);
return indexer.findEnemyTile(team, x * tilesize + block.size, y * tilesize + block.size, block.placeOverlapRange + 4f, b -> b.team.rules().checkPlacement);
}
public static boolean contactsGround(int x, int y, Block block){