Fixed packet spam on sector capture
This commit is contained in:
@@ -755,6 +755,17 @@ public class Tile implements Position, QuadTreeObject, Displayable{
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void setTeams(int[] positions, Team team){
|
||||
if(positions == null) return;
|
||||
for(int pos : positions){
|
||||
Tile tile = world.tile(pos);
|
||||
if(tile != null && tile.build != null){
|
||||
tile.build.changeTeam(team);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Remote(called = Loc.server)
|
||||
public static void buildDestroyed(Building build){
|
||||
if(build == null) return;
|
||||
|
||||
@@ -2,6 +2,7 @@ package mindustry.world.blocks.environment;
|
||||
|
||||
import arc.graphics.g2d.*;
|
||||
import arc.math.*;
|
||||
import mindustry.game.*;
|
||||
import mindustry.world.*;
|
||||
|
||||
/**A type of floor that is overlaid on top of other floors.*/
|
||||
@@ -12,6 +13,11 @@ public class OverlayFloor extends Floor{
|
||||
useColor = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceOn(Tile tile, Team team, int rotation){
|
||||
return !wallOre || tile.block().solid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBase(Tile tile){
|
||||
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
|
||||
|
||||
@@ -45,6 +45,9 @@ public class RemoveWall extends Block{
|
||||
@Override
|
||||
public void placeEnded(Tile tile, @Nullable Unit builder){
|
||||
tile.setBlock(Blocks.air);
|
||||
if(tile.overlay().wallOre){
|
||||
tile.setOverlay(Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user