mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-06 02:40:23 -08:00
Fixed #11379
This commit is contained in:
parent
d8106cb886
commit
10bb45de31
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue