mirror of
https://github.com/Anuken/Mindustry.git
synced 2026-01-25 05:51:47 -08:00
Fixed #4407
This commit is contained in:
parent
027d080c55
commit
457514a2c8
2 changed files with 8 additions and 8 deletions
|
|
@ -80,6 +80,7 @@ abstract class CommanderComp implements Entityc, Posc{
|
|||
|
||||
void command(Formation formation, Seq<Unit> units){
|
||||
clearCommand();
|
||||
units.shuffle();
|
||||
|
||||
float spacing = hitSize * 0.8f;
|
||||
minFormationSpeed = type.speed;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue