More instruction limits

This commit is contained in:
Anuken 2020-08-13 14:02:11 -04:00
parent af6ed6ea89
commit e1f0564d0b

View File

@ -8,6 +8,7 @@ import mindustry.gen.*;
import mindustry.logic.LExecutor.*; import mindustry.logic.LExecutor.*;
import mindustry.logic.LStatements.*; import mindustry.logic.LStatements.*;
import mindustry.type.*; import mindustry.type.*;
import mindustry.world.blocks.logic.*;
/** "Compiles" a sequence of statements into instructions. */ /** "Compiles" a sequence of statements into instructions. */
public class LAssembler{ public class LAssembler{
@ -65,7 +66,7 @@ public class LAssembler{
} }
public static Seq<LStatement> read(String data){ public static Seq<LStatement> read(String data){
return read(data, Integer.MAX_VALUE); return read(data, LogicBlock.maxInstructions);
} }
public static Seq<LStatement> read(String data, int max){ public static Seq<LStatement> read(String data, int max){
@ -79,7 +80,7 @@ public class LAssembler{
//comments //comments
if(line.startsWith("#")) continue; if(line.startsWith("#")) continue;
if(index++ > max) continue; if(index++ > max) break;
try{ try{
//yes, I am aware that this can be split with regex, but that's slow and even more incomprehensible //yes, I am aware that this can be split with regex, but that's slow and even more incomprehensible