this repo has no description

Merge pull request #207 from moonlight-mod/cyn/patcher-nitpicks

Changed files
+4 -1
packages
core
src
+4 -1
packages/core/src/patch.ts
···
for (let i = 0; i < patches.length; i++) {
const patch = patches[i];
if (patch.prerequisite != null && !patch.prerequisite()) {
+
moonlight.unpatched.delete(patch);
continue;
}
···
// We ensured normal PatchReplace objects get turned into arrays on register
const replaces = patch.replace as PatchReplace[];
+
let isPatched = true;
for (let i = 0; i < replaces.length; i++) {
const replace = replaces[i];
let patchId = `${patch.ext}#${patch.id}`;
···
if (replaced === moduleString) {
logger.warn("Patch replacement failed", id, patch);
+
isPatched = false;
if (patch.hardFail) {
hardFailed = true;
break;
···
exts.add(patch.ext);
}
-
moonlight.unpatched.delete(patch);
+
if (isPatched) moonlight.unpatched.delete(patch);
if (shouldRemove) patches.splice(i--, 1);
}
}