mirror of
https://github.com/redphx/better-xcloud.git
synced 2025-06-07 08:07:18 +02:00
Only call eval() once per patch group
This commit is contained in:
parent
049e65429a
commit
ad98eb60e1
@ -4449,6 +4449,7 @@ class Patcher {
|
|||||||
|
|
||||||
for (let groupIndex = 0; groupIndex < Patcher.#PATCH_ORDERS.length; groupIndex++) {
|
for (let groupIndex = 0; groupIndex < Patcher.#PATCH_ORDERS.length; groupIndex++) {
|
||||||
const group = Patcher.#PATCH_ORDERS[groupIndex];
|
const group = Patcher.#PATCH_ORDERS[groupIndex];
|
||||||
|
let modified = false;
|
||||||
|
|
||||||
for (let patchIndex = 0; patchIndex < group.length; patchIndex++) {
|
for (let patchIndex = 0; patchIndex < group.length; patchIndex++) {
|
||||||
const patchName = group[patchIndex];
|
const patchName = group[patchIndex];
|
||||||
@ -4466,11 +4467,10 @@ class Patcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modified = true;
|
||||||
funcStr = patchedFuncStr;
|
funcStr = patchedFuncStr;
|
||||||
|
|
||||||
console.log(`[Better xCloud] Applied "${patchName}" patch`);
|
console.log(`[Better xCloud] Applied "${patchName}" patch`);
|
||||||
// Apply patched function
|
|
||||||
item[1][id] = eval(patchedFuncStr);
|
|
||||||
appliedPatches.push(patchName);
|
appliedPatches.push(patchName);
|
||||||
|
|
||||||
// Remove patch from group
|
// Remove patch from group
|
||||||
@ -4478,6 +4478,11 @@ class Patcher {
|
|||||||
patchIndex--;
|
patchIndex--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply patched functions
|
||||||
|
if (modified) {
|
||||||
|
item[1][id] = eval(funcStr);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove empty group
|
// Remove empty group
|
||||||
if (!group.length) {
|
if (!group.length) {
|
||||||
Patcher.#PATCH_ORDERS.splice(groupIndex, 1);
|
Patcher.#PATCH_ORDERS.splice(groupIndex, 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user