First, minor steps to Record Attack support

To-Do:
- fix demo desync (desync is only super noticeable on slopes, but a
message pops up when the player starts moving regardless)
- fix ghosts not appearing
- replace that dumb level tally
- remove a bunch of things that made the assumption that race & record
attack would never mix (ex: "next map x doesn't support race mode, using
map y anyway" message)
This commit is contained in:
TehRealSalt 2017-10-15 02:33:28 -04:00
parent ba7580d8e2
commit 540bea911a
6 changed files with 13 additions and 34 deletions

View File

@ -3241,7 +3241,7 @@ void SV_StartSinglePlayerServer(void)
server = true;
netgame = false;
multiplayer = false;
gametype = GT_COOP;
gametype = GT_RACE; //srb2kart
// no more tic the game with this settings!
SV_StopServer();

View File

@ -1863,6 +1863,8 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum)
// a copy of color
if (players[0].mo)
players[0].mo->color = players[0].skincolor;
CV_StealthSetValue(&cv_kartcc, 150); // srb2kart
}
if (metalrecording)
G_BeginMetal();

View File

@ -3816,8 +3816,8 @@ char *G_BuildMapTitle(INT32 mapnum)
// DEMO RECORDING
//
#define DEMOVERSION 0x0009
#define DEMOHEADER "\xF0" "SRB2Replay" "\x0F"
#define DEMOVERSION 0x0001
#define DEMOHEADER "\xF0" "KartReplay" "\x0F"
#define DF_GHOST 0x01 // This demo contains ghost data too!
#define DF_RECORDATTACK 0x02 // This demo is from record attack and contains its final completion time, score, and rings!
@ -4991,8 +4991,6 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
switch(oldversion) // demoversion
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:
@ -5007,10 +5005,7 @@ UINT8 G_CmpDemoTime(char *oldname, char *newname)
Z_Free(buffer);
return UINT8_MAX;
} p += 4; // "PLAY"
if (oldversion <= 0x0008)
p++; // gamemap
else
p += 2; // gamemap
p += 2; // gamemap
p += 16; // mapmd5
flags = READUINT8(p);
if (!(flags & aflags))
@ -5131,8 +5126,6 @@ void G_DoPlayDemo(char *defdemoname)
switch(demoversion)
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:
@ -5158,10 +5151,7 @@ void G_DoPlayDemo(char *defdemoname)
return;
}
demo_p += 4; // "PLAY"
if (demoversion <= 0x0008)
gamemap = READUINT8(demo_p);
else
gamemap = READINT16(demo_p);
gamemap = READINT16(demo_p);
demo_p += 16; // mapmd5
demoflags = READUINT8(demo_p);
@ -5361,8 +5351,6 @@ void G_AddGhost(char *defdemoname)
switch(ghostversion)
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:
@ -5387,10 +5375,7 @@ void G_AddGhost(char *defdemoname)
Z_Free(buffer);
return;
} p += 4; // "PLAY"
if (ghostversion <= 0x0008)
p++; // gamemap
else
p += 2; // gamemap
p += 2; // gamemap
p += 16; // mapmd5 (possibly check for consistency?)
flags = READUINT8(p);
if (!(flags & DF_GHOST))
@ -5591,8 +5576,6 @@ void G_DoPlayMetal(void)
switch(metalversion)
{
case DEMOVERSION: // latest always supported
// compatibility available?
case 0x0008:
break;
// too old, cannot support.
default:

View File

@ -574,8 +574,8 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] =
unlockable_t unlockables[MAXUNLOCKABLES] =
{
// Name, Objective, Menu Height, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist
/* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, 1, SECRET_RECORDATTACK, 0, true, true, 0},
/* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, 2, SECRET_NIGHTSMODE, 0, true, true, 0},
/* 01 */ {"Record Attack", "Complete Greenflower Zone, Act 1", 0, -1, SECRET_RECORDATTACK, 0, true, true, 0},
/* 02 */ {"NiGHTS Mode", "Complete Floral Field", 0, -1, SECRET_NIGHTSMODE, 0, true, true, 0},
/* 03 */ {"Play Credits", "Complete 1P Mode", 30, 10, SECRET_CREDITS, 0, true, true, 0},
/* 04 */ {"Sound Test", "Complete 1P Mode", 40, 10, SECRET_SOUNDTEST, 0, false, false, 0},

View File

@ -8920,9 +8920,7 @@ void P_RespawnSpecials(void)
mapthing_t *mthing = NULL;
// only respawn items when cv_itemrespawn is on
if (!(netgame || multiplayer) // Never respawn in single player
|| gametype == GT_COOP // Never respawn in co-op gametype
|| !cv_itemrespawn.value) // cvar is turned off
if (!cv_itemrespawn.value)
return;
// Don't respawn in special stages!
@ -9505,12 +9503,8 @@ void P_SpawnMapThing(mapthing_t *mthing)
if (modeattacking) // Record Attack special stuff
{
// Don't spawn starposts that wouldn't be usable
if (i == MT_STARPOST)
return;
// Emerald Tokens -->> Score Tokens
else if (i == MT_EMMY)
if (i == MT_EMMY)
return; /// \todo
// 1UPs -->> Score TVs

View File

@ -224,7 +224,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
DEH_WriteUndoline("LEVELFLAGS", va("%d", mapheaderinfo[num]->levelflags), UNDO_NONE);
mapheaderinfo[num]->levelflags = 0;
DEH_WriteUndoline("MENUFLAGS", va("%d", mapheaderinfo[num]->menuflags), UNDO_NONE);
mapheaderinfo[num]->menuflags = 0;
mapheaderinfo[num]->menuflags = LF2_RECORDATTACK|LF2_NOVISITNEEDED; // 0
// TODO grades support for delfile (pfft yeah right)
P_DeleteGrades(num);
// an even further impossibility, delfile custom opts support