Allow G_LoadDemoInfo to load TA demos

This commit is contained in:
Eidolon 2024-03-02 12:24:07 -06:00
parent a19f0139af
commit 5fd7f4ee65
3 changed files with 16 additions and 4 deletions

View file

@ -2563,7 +2563,7 @@ static bool load_ubjson_standing(menudemo_t* pdemo, tcb::span<std::byte> slice,
return true; return true;
} }
void G_LoadDemoInfo(menudemo_t *pdemo) void G_LoadDemoInfo(menudemo_t *pdemo, boolean allownonmultiplayer)
{ {
savebuffer_t info = {0}; savebuffer_t info = {0};
UINT8 *extrainfo_p; UINT8 *extrainfo_p;
@ -2652,7 +2652,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
pdemoflags = READUINT16(info.p); pdemoflags = READUINT16(info.p);
// temp? // temp?
if (!(pdemoflags & DF_MULTIPLAYER)) if (!(pdemoflags & DF_MULTIPLAYER) && !allownonmultiplayer)
{ {
CONS_Alert(CONS_ERROR, M_GetText("%s is not a multiplayer replay and can't be listed on this menu fully yet.\n"), pdemo->filepath); CONS_Alert(CONS_ERROR, M_GetText("%s is not a multiplayer replay and can't be listed on this menu fully yet.\n"), pdemo->filepath);
goto badreplay; goto badreplay;
@ -2678,6 +2678,18 @@ void G_LoadDemoInfo(menudemo_t *pdemo)
goto badreplay; goto badreplay;
} }
if ((pdemoflags & DF_ATTACKMASK))
{
if ((pdemoflags & ATTACKING_TIME))
{
info.p += 4; // time
}
if ((pdemoflags & ATTACKING_LAP))
{
info.p += 4; // lap
}
}
for (i = 0; i < PRNUMSYNCED; i++) for (i = 0; i < PRNUMSYNCED; i++)
{ {
info.p += 4; // RNG seed info.p += 4; // RNG seed

View file

@ -227,7 +227,7 @@ void G_DoneLevelLoad(void);
void G_StopDemo(void); void G_StopDemo(void);
boolean G_CheckDemoStatus(void); boolean G_CheckDemoStatus(void);
void G_LoadDemoInfo(menudemo_t *pdemo); void G_LoadDemoInfo(menudemo_t *pdemo, boolean allownonmultiplayer);
void G_DeferedPlayDemo(const char *demo); void G_DeferedPlayDemo(const char *demo);
void G_SaveDemo(void); void G_SaveDemo(void);

View file

@ -216,7 +216,7 @@ EggTVData::Replay::Replay(Folder::Cache::ReplayRef& ref) : ref_(&ref)
std::copy_n(path.string().c_str(), path.native().size() + 1, info.filepath); std::copy_n(path.string().c_str(), path.native().size() + 1, info.filepath);
G_LoadDemoInfo(&info); G_LoadDemoInfo(&info, /*allownonmultiplayer*/ false);
if (info.type != MD_LOADED) if (info.type != MD_LOADED)
{ {