mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-12-05 18:30:22 -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;
|
||||
public static final int maxNameLength = 32;
|
||||
|
||||
private static final IntSet usedBuildings = new IntSet();
|
||||
|
||||
public int maxInstructionScale = 5;
|
||||
public int instructionsPerTick = 1;
|
||||
//privileged only
|
||||
|
|
@ -268,6 +270,7 @@ public class LogicBlock extends Block{
|
|||
stream.readInt();
|
||||
}
|
||||
}else{
|
||||
usedBuildings.clear();
|
||||
for(int i = 0; i < total; i++){
|
||||
String name = stream.readUTF();
|
||||
short x = stream.readShort(), y = stream.readShort();
|
||||
|
|
@ -280,6 +283,9 @@ public class LogicBlock extends Block{
|
|||
Building build = world.build(x, y);
|
||||
|
||||
if(build != null){
|
||||
if(!usedBuildings.add(build.id)){
|
||||
continue;
|
||||
}
|
||||
String bestName = getLinkName(build.block);
|
||||
if(!name.startsWith(bestName)){
|
||||
name = findLinkName(build.block);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue