From 21697cc43b973a21447df4f0071cd64c19853d63 Mon Sep 17 00:00:00 2001 From: NeKz Date: Tue, 16 Apr 2024 21:54:13 +0100 Subject: [PATCH] Apply missing demo repair patch --- src/server/demo.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/demo.ts b/src/server/demo.ts index 8c84cf6..6bc533e 100644 --- a/src/server/demo.ts +++ b/src/server/demo.ts @@ -612,6 +612,7 @@ export const repairDemo = (buffer: Uint8Array): Uint8Array => { let paused = false; let coop = false; let coopCmEndTick = -1; + let didPopulateCustomCallbackMap = false; const didCoopChallengeModeFinish = (message: Messages.Message) => { // Start dropping messages on the next tick @@ -651,6 +652,14 @@ export const repairDemo = (buffer: Uint8Array): Uint8Array => { message instanceof Messages.UserCmd || message instanceof Messages.CustomData ) { + if (!didPopulateCustomCallbackMap && message instanceof Messages.CustomData) { + didPopulateCustomCallbackMap = message.unk === -1; + + if (!didPopulateCustomCallbackMap) { + return false; + } + } + if (didCoopChallengeModeFinish(message)) { return false; }