Fixed map area disable logic

This commit is contained in:
Anuken
2025-04-07 09:53:07 -04:00
parent 6bb031b47f
commit 7bab72df04
2 changed files with 9 additions and 6 deletions

View File

@@ -464,12 +464,15 @@ public class World{
}
public void checkMapArea(int x, int y, int w, int h){
for(var build : Groups.build){
//if the map area contracts, disable the block
build.checkAllowUpdate();
//reset map-area-based disabled blocks that were not in the previous map area
if(!build.enabled && build.block.autoResetEnabled && !Rect.contains(x, y, w, h, build.tile.x, build.tile.y)){
build.enabled = true;
for(var team : state.teams.present){
for(var build : team.buildings){
//reset map-area-based disabled blocks that were not in the previous map area
if(!build.enabled && build.block.autoResetEnabled && !Rect.contains(x, y, w, h, build.tile.x, build.tile.y)){
build.enabled = true;
}
//if the map area contracts, disable the block
build.checkAllowUpdate();
}
}
}