This commit is contained in:
Anuken
2020-11-28 11:31:07 -05:00
parent 8a424111f0
commit 6e62859d0e
2 changed files with 6 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ import mindustry.world.*;
/** "Compiles" a sequence of statements into instructions. */
public class LAssembler{
public static ObjectMap<String, Func<String[], LStatement>> customParsers = new ObjectMap<>();
public static final int maxTokenLength = 40;
public static final int maxTokenLength = 36;
private int lastVar;
/** Maps names to variable IDs. */

View File

@@ -29,7 +29,11 @@ public class Bar extends Element{
public Bar(Prov<String> name, Prov<Color> color, Floatp fraction){
this.fraction = fraction;
lastValue = value = Mathf.clamp(fraction.get());
try{
lastValue = value = Mathf.clamp(fraction.get());
}catch(Exception e){ //getting the fraction may involve referring to invalid data
lastValue = value = 0f;
}
update(() -> {
try{
this.name = name.get();