mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Allow G_LoadDemoInfo to load TA demos
This commit is contained in:
parent
a19f0139af
commit
5fd7f4ee65
3 changed files with 16 additions and 4 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue