mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-12 19:58:25 +00:00
Fixed AS3 Metadata single value (null item key)
This commit is contained in:
@@ -156,8 +156,10 @@ public class ASM3Parser {
|
||||
Map<String, String> items = new HashMap<>();
|
||||
while (symb.type == ParsedSymbol.TYPE_KEYWORD_ITEM) {
|
||||
symb = lexer.lex();
|
||||
expected(symb, ParsedSymbol.TYPE_STRING, "string key");
|
||||
String key = (String) symb.value;
|
||||
if (symb.type != ParsedSymbol.TYPE_KEYWORD_NULL && symb.type != ParsedSymbol.TYPE_STRING) {
|
||||
throw new AVM2ParseException("string/null value expected", lexer.yyline());
|
||||
}
|
||||
String key = symb.type == ParsedSymbol.TYPE_KEYWORD_NULL ? null : (String) symb.value;
|
||||
symb = lexer.lex();
|
||||
expected(symb, ParsedSymbol.TYPE_STRING, "string value");
|
||||
String val = (String) symb.value;
|
||||
|
||||
@@ -433,15 +433,23 @@ public abstract class Trait implements Cloneable, Serializable {
|
||||
int val = abc.metadata_info.get(m).values[i];
|
||||
writer.append("item ");
|
||||
|
||||
writer.append("\"");
|
||||
writer.append(Helper.escapePCodeString(abc.constants.getString(key)));
|
||||
writer.append("\"");
|
||||
if (key == 0) {
|
||||
writer.append("null");
|
||||
} else {
|
||||
writer.append("\"");
|
||||
writer.append(Helper.escapePCodeString(abc.constants.getString(key)));
|
||||
writer.append("\"");
|
||||
}
|
||||
|
||||
writer.append(" ");
|
||||
|
||||
writer.append("\"");
|
||||
writer.append(Helper.escapePCodeString(abc.constants.getString(val)));
|
||||
writer.append("\"");
|
||||
if (val == 0) {
|
||||
writer.append("null");
|
||||
} else {
|
||||
writer.append("\"");
|
||||
writer.append(Helper.escapePCodeString(abc.constants.getString(val)));
|
||||
writer.append("\"");
|
||||
}
|
||||
writer.newLine();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user