mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-10-01 18:50:27 +03:00
Fixed #12280
This commit is contained in:
@@ -514,6 +514,7 @@ public class LogicBlock extends Block{
|
||||
var cur = world.build(l.x, l.y);
|
||||
|
||||
boolean valid = validLink(cur);
|
||||
Block lastBlock = (l.lastBuild == null ? null : l.lastBuild.block);
|
||||
if(l.lastBuild == null) l.lastBuild = cur;
|
||||
if(valid != l.valid || l.lastBuild != cur){
|
||||
l.lastBuild = cur;
|
||||
@@ -523,6 +524,13 @@ public class LogicBlock extends Block{
|
||||
l.trySet(executor, null); //always clear old variable, it may get a new name
|
||||
|
||||
if(valid){
|
||||
|
||||
if(lastBlock != null && cur.block != lastBlock){
|
||||
l.logicVar = null; //name was reassigned because block type changed, the old cached logic var is no longer relevant
|
||||
l.name = "";
|
||||
l.name = findLinkName(cur.block);
|
||||
}
|
||||
|
||||
//remove redundant links
|
||||
links.removeAll(o -> {
|
||||
boolean remove = world.build(o.x, o.y) == cur && o != l;
|
||||
|
||||
Reference in New Issue
Block a user