Made logic processors reset variables on edit
This commit is contained in:
@@ -9,6 +9,7 @@ import mindustry.ui.dialogs.*;
|
|||||||
|
|
||||||
public class MapResizeDialog extends BaseDialog{
|
public class MapResizeDialog extends BaseDialog{
|
||||||
public static int minSize = 50, maxSize = 500, increment = 50;
|
public static int minSize = 50, maxSize = 500, increment = 50;
|
||||||
|
|
||||||
int width, height;
|
int width, height;
|
||||||
|
|
||||||
public MapResizeDialog(MapEditor editor, Intc2 cons){
|
public MapResizeDialog(MapEditor editor, Intc2 cons){
|
||||||
|
|||||||
@@ -317,17 +317,6 @@ public class LogicBlock extends Block{
|
|||||||
asm.putConst("@links", executor.links.length);
|
asm.putConst("@links", executor.links.length);
|
||||||
asm.putConst("@ipt", instructionsPerTick);
|
asm.putConst("@ipt", instructionsPerTick);
|
||||||
|
|
||||||
//store any older variables
|
|
||||||
for(Var var : executor.vars){
|
|
||||||
boolean unit = var.name.equals("@unit");
|
|
||||||
if(!var.constant || unit){
|
|
||||||
BVar dest = asm.getVar(var.name);
|
|
||||||
if(dest != null && (!dest.constant || unit)){
|
|
||||||
dest.value = var.isobj ? var.objval : var.numval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//inject any extra variables
|
//inject any extra variables
|
||||||
if(assemble != null){
|
if(assemble != null){
|
||||||
assemble.get(asm);
|
assemble.get(asm);
|
||||||
|
|||||||
Reference in New Issue
Block a user