Fixed #11379
This commit is contained in:
@@ -35,6 +35,8 @@ public class LogicBlock extends Block{
|
|||||||
private static final int maxLinks = 6000;
|
private static final int maxLinks = 6000;
|
||||||
public static final int maxNameLength = 32;
|
public static final int maxNameLength = 32;
|
||||||
|
|
||||||
|
private static final IntSet usedBuildings = new IntSet();
|
||||||
|
|
||||||
public int maxInstructionScale = 5;
|
public int maxInstructionScale = 5;
|
||||||
public int instructionsPerTick = 1;
|
public int instructionsPerTick = 1;
|
||||||
//privileged only
|
//privileged only
|
||||||
@@ -268,6 +270,7 @@ public class LogicBlock extends Block{
|
|||||||
stream.readInt();
|
stream.readInt();
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
usedBuildings.clear();
|
||||||
for(int i = 0; i < total; i++){
|
for(int i = 0; i < total; i++){
|
||||||
String name = stream.readUTF();
|
String name = stream.readUTF();
|
||||||
short x = stream.readShort(), y = stream.readShort();
|
short x = stream.readShort(), y = stream.readShort();
|
||||||
@@ -280,6 +283,9 @@ public class LogicBlock extends Block{
|
|||||||
Building build = world.build(x, y);
|
Building build = world.build(x, y);
|
||||||
|
|
||||||
if(build != null){
|
if(build != null){
|
||||||
|
if(!usedBuildings.add(build.id)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
String bestName = getLinkName(build.block);
|
String bestName = getLinkName(build.block);
|
||||||
if(!name.startsWith(bestName)){
|
if(!name.startsWith(bestName)){
|
||||||
name = findLinkName(build.block);
|
name = findLinkName(build.block);
|
||||||
|
|||||||
Reference in New Issue
Block a user