MiscGroups bugfixes

*Fixed parser crashing if Platform def not found
*Fixed MiscGroups order
-Removed Platform.miscGroups (debug)
This commit is contained in:
izawartka 2025-07-19 12:50:56 +02:00
parent 9840400fd9
commit c01077ce38
2 changed files with 3 additions and 4 deletions

View File

@ -32,8 +32,6 @@ export default class Platform extends Misc {
values[9] // name
);
object.miscGroups = [...miscGroups];
return object;
}
@ -41,6 +39,7 @@ export default class Platform extends Misc {
let def = DefinedPlatforms[prefabName];
if (!def) {
SceneryParserLog.warn('platformUndefinedPrefabName', `Platform ${name} has an undefined prefab name ${prefabName}`);
return null;
}
if(def.alias) return Platform.getDef(name, def.alias);

View File

@ -115,11 +115,11 @@ export default class SceneryParser {
return MainCamera.fromText(text);
case 'MiscGroup':
const group = MiscGroup.fromText(text);
currentMiscGroups.unshift(group);
currentMiscGroups.push(group);
return null;
case 'EndMiscGroup':
if(!currentMiscGroups.shift()) {
if(!currentMiscGroups.pop()) {
SceneryParserLog.warn('endMiscGroupWithoutStart', 'Unexpected EndMiscGroup found without a preceding MiscGroup');
}