diff --git a/core/src/mindustry/entities/comp/CommanderComp.java b/core/src/mindustry/entities/comp/CommanderComp.java index 0ce8d60d10..2842e5cc9c 100644 --- a/core/src/mindustry/entities/comp/CommanderComp.java +++ b/core/src/mindustry/entities/comp/CommanderComp.java @@ -80,6 +80,7 @@ abstract class CommanderComp implements Entityc, Posc{ void command(Formation formation, Seq units){ clearCommand(); + units.shuffle(); float spacing = hitSize * 0.8f; minFormationSpeed = type.speed; diff --git a/core/src/mindustry/logic/LAssembler.java b/core/src/mindustry/logic/LAssembler.java index 8282e66ca6..95195cc3fe 100644 --- a/core/src/mindustry/logic/LAssembler.java +++ b/core/src/mindustry/logic/LAssembler.java @@ -61,9 +61,6 @@ public class LAssembler{ String[] lines = data.split("\n"); int index = 0; for(String line : lines){ - //comments - int commentIdx = line.indexOf('#'); - if(commentIdx != -1) line = line.substring(0, commentIdx).trim(); if(line.isEmpty()) continue; //remove trailing semicolons in case someone adds them in for no reason if(line.endsWith(";")) line = line.substring(0, line.length() - 1); @@ -83,7 +80,9 @@ public class LAssembler{ for(int i = 0; i < line.length() + 1; i++){ char c = i == line.length() ? ' ' : line.charAt(i); - if(c == '"'){ + if(c == '#' && !inString){ + break; + }else if(c == '"'){ inString = !inString; }else if(c == ' ' && !inString){ tokens.add(line.substring(lastIdx, Math.min(i, lastIdx + maxTokenLength))); @@ -96,6 +95,9 @@ public class LAssembler{ arr = new String[]{line}; } + //nothing found + if(arr.length == 0) continue; + String type = arr[0]; //legacy stuff @@ -131,10 +133,7 @@ public class LAssembler{ String first = arr[0]; if(customParsers.containsKey(first)){ statements.add(customParsers.get(first).get(arr)); - }else{ - //unparseable statement - statements.add(new InvalidStatement()); - } + } //unparseable statement, skip } }catch(Exception parseFailed){ parseFailed.printStackTrace();