This commit is contained in:
Anuken
2023-05-12 12:10:37 -04:00
parent bcee2e7083
commit 7bcfaf54ef
2 changed files with 10 additions and 7 deletions

View File

@@ -477,11 +477,15 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
if(build == null) return;
if(net.server() && (!Units.canInteract(player, build) ||
!netServer.admins.allowAction(player, ActionType.configure, build.tile, action -> action.config = value))){
var packet = new TileConfigCallPacket(); //undo the config on the client
packet.player = player;
packet.build = build;
packet.value = build.config();
player.con.send(packet, true);
if(player.con != null){
var packet = new TileConfigCallPacket(); //undo the config on the client
packet.player = player;
packet.build = build;
packet.value = build.config();
player.con.send(packet, true);
}
throw new ValidateException(player, "Player cannot configure a tile.");
}
build.configured(player == null || player.dead() ? null : player.unit(), value);

View File

@@ -16,7 +16,6 @@ import mindustry.world.*;
import mindustry.world.blocks.defense.*;
import mindustry.world.blocks.payloads.*;
import mindustry.world.blocks.power.*;
import mindustry.world.blocks.power.PowerNode.*;
import mindustry.world.blocks.production.*;
import mindustry.world.meta.*;
@@ -173,7 +172,7 @@ public class BaseGenerator{
for(Tile tile : tiles){
if(tile.isCenter() && tile.block() instanceof PowerNode && tile.team() == state.rules.waveTeam){
tile.build.configure(new Point2[0]);
tile.build.configureAny(new Point2[0]);
tile.build.placed();
}
}