Fix: Don't fallback to legacy mode when using skip list

When HYTALE_PATCH_SKIP is set, the legacy fallback was ignoring
the skip list and patching all occurrences anyway.

Now if skip list is active or HYTALE_NO_LEGACY_FALLBACK=1,
the legacy fallback is disabled.

Also found 4th occurrence at 0x1bc5d67 with metadata byte 0x89
that legacy mode was patching - this may be the crash culprit.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-01-27 03:51:32 +01:00
parent 654deca933
commit 6333263ef9

View File

@@ -584,6 +584,17 @@ class ClientPatcher {
const { buffer: finalData, count: discordCount } = this.patchDiscordUrl(patchedData);
if (count === 0 && discordCount === 0) {
// Check if we're in debug mode with skip - don't fallback if intentionally skipping
const hasSkipList = (process.env.HYTALE_PATCH_SKIP || '').trim().length > 0;
const noLegacyFallback = process.env.HYTALE_NO_LEGACY_FALLBACK === '1';
if (hasSkipList || noLegacyFallback) {
console.log('No occurrences patched (skip list active or legacy fallback disabled)');
fs.writeFileSync(clientPath, patchedData);
this.markAsPatched(clientPath);
return { success: true, patchCount: 0, skipped: true };
}
console.log('No occurrences found - trying legacy UTF-16LE format...');
// Fallback to legacy patching for older binary formats