mirror of
https://github.com/mon/BemaniPatcher.git
synced 2026-08-01 14:10:40 -07:00
Fix copying original bytes in dynamic patches
This commit is contained in:
+4
-4
@@ -210,8 +210,8 @@ class DynamicPatch {
|
|||||||
replace(file, offset,
|
replace(file, offset,
|
||||||
new TextEncoder().encode(featureOn? patch.on : patch.off));
|
new TextEncoder().encode(featureOn? patch.on : patch.off));
|
||||||
} else {
|
} else {
|
||||||
patch.on = patch.on.map((patch, idx) => patch === 'XX' ? file[offset + idx] : patch);
|
patch.on = patch.on.map((byte, idx) => byte === 'XX' ? file[offset + idx] : byte);
|
||||||
patch.off = patch.off.map((patch, idx) => patch === 'XX' ? file[offset + idx] : patch);
|
patch.off = patch.off.map((byte, idx) => byte === 'XX' ? file[offset + idx] : byte);
|
||||||
replace(file, offset,
|
replace(file, offset,
|
||||||
featureOn? patch.on : patch.off);
|
featureOn? patch.on : patch.off);
|
||||||
}
|
}
|
||||||
@@ -221,8 +221,8 @@ class DynamicPatch {
|
|||||||
replace(file, patch.offset,
|
replace(file, patch.offset,
|
||||||
new TextEncoder().encode(featureOn? patch.on : patch.off));
|
new TextEncoder().encode(featureOn? patch.on : patch.off));
|
||||||
} else {
|
} else {
|
||||||
patch.on = patch.on.map((patch, idx) => patch === 'XX' ? file[patch.offset + idx] : patch);
|
patch.on = patch.on.map((byte, idx) => byte === 'XX' ? file[patch.offset + idx] : byte);
|
||||||
patch.off = patch.off.map((patch, idx) => patch === 'XX' ? file[patch.offset + idx] : patch);
|
patch.off = patch.off.map((byte, idx) => byte === 'XX' ? file[patch.offset + idx] : byte);
|
||||||
replace(file, patch.offset,
|
replace(file, patch.offset,
|
||||||
featureOn? patch.on : patch.off);
|
featureOn? patch.on : patch.off);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user