diff --git a/modern/src/maki-interpreter/parser.js b/modern/src/maki-interpreter/parser.js index 0f5eea88..deb84199 100644 --- a/modern/src/maki-interpreter/parser.js +++ b/modern/src/maki-interpreter/parser.js @@ -155,15 +155,7 @@ function readVariables({ makiFile, classes }) { const global = makiFile.readUInt8(); makiFile.readUInt8(); // system - if (object) { - const klass = classes[typeOffset]; - if (klass == null) { - throw new Error("Invalid type"); - } - variables.push( - new Variable({ type: klass, typeName: "OBJECT", global: !!global }) - ); - } else if (subClass) { + if (subClass) { const variable = variables[typeOffset]; if (variable == null) { throw new Error("Invalid type"); @@ -171,6 +163,14 @@ function readVariables({ makiFile, classes }) { variables.push( new Variable({ type: variable, typeName: "SUBCLASS", global: !!global }) ); + } else if (object) { + const klass = classes[typeOffset]; + if (klass == null) { + throw new Error("Invalid type"); + } + variables.push( + new Variable({ type: klass, typeName: "OBJECT", global: !!global }) + ); } else { const typeName = PRIMITIVE_TYPES[typeOffset]; if (typeName == null) {