Skip to content

Commit

Permalink
Apply missing demo repair patch
Browse files Browse the repository at this point in the history
  • Loading branch information
NeKzor committed Apr 16, 2024
1 parent 46b7e53 commit 21697cc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/server/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 21697cc

Please sign in to comment.