Small QB Porter Fixes (#933)

[SKIP]
This commit is contained in:
Integer Limit 2024-08-21 22:41:13 +10:00 committed by GitHub
parent e9473efd18
commit 6dfb72c19d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View File

@ -135,8 +135,8 @@ export default class PortQBData {
} else {
this.ref = await input({
message:
"What Commit SHA, Tag OR Branch should we compare to? (Defaults to 'main')",
default: "main",
"What Commit SHA, Tag OR Branch should we compare to? (Defaults to 'HEAD')",
default: "HEAD",
});
}

View File

@ -209,7 +209,8 @@ function findAllParsers(modify: Modified): {
function assertIsModification(change: QuestChange) {
if (change.op !== "replace")
throw new Error(dedent`
Runtime Exception: Addition/Removal Should Not Happen Here! Report this to the Core Devs of Nomi-CEu!
Runtime Exception: Addition/Removal Should Not Happen Here!
If this is a Proper Change, Report this to the Core Devs of Nomi-CEu!
Path: ${change.path.toString()}
`);
}
@ -297,7 +298,11 @@ const modifyIcon = async (
modify: Modified,
change: QuestChange,
) => {
assertIsModification(change);
// Tag Compounds might be removed/added
if (
change.path.toString() !== "properties:10,betterquesting:10,icon:10,tag:10"
) assertIsModification(change);
const oldIcon =
modify.oldQuest["properties:10"]["betterquesting:10"]["icon:10"];
const newIcon =
@ -831,6 +836,7 @@ export const modificationParsers = [
logic: {
type: LogicType.Simple,
applyOnce: true,
formattedName: () => "Icon Modification",
func: modifyIcon,
},
},