Fixed map area disable logic
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user