From 8217900c0d52988294bcda6231439df130e104dc Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 10 Oct 2017 17:56:38 +0100 Subject: [PATCH 01/15] * Make replays take analog mode, flipcam, directionchar and autobrake settings into account. * Fix replays for the current state of internal, irrespective of that previous thing. * Fix replay ghosts for everything. * Known issues; NiGHTS still prints an error message about desyncing on map start, but plays back fine. Curious. --- src/g_game.c | 67 ++++++++++++++++++++++++++++++++++++---------------- src/p_user.c | 3 +++ 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 19abd516b..eff1d2370 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3950,7 +3950,7 @@ char *G_BuildMapTitle(INT32 mapnum) // DEMO RECORDING // -#define DEMOVERSION 0x0009 +#define DEMOVERSION 0x000a #define DEMOHEADER "\xF0" "SRB2Replay" "\x0F" #define DF_GHOST 0x01 // This demo contains ghost data too! @@ -4244,9 +4244,9 @@ void G_WriteGhostTic(mobj_t *ghost) // Only store the 8 most relevant bits of angle // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites // and it does not affect this mode of movement at all anyway. - if (ghost->angle>>24 != oldghost.angle) + if (ghost->player && ghost->player->drawangle>>24 != oldghost.angle) { - oldghost.angle = ghost->angle>>24; + oldghost.angle = ghost->player->drawangle>>24; ziptic |= GZT_ANGLE; WRITEUINT8(demo_p,oldghost.angle); } @@ -4818,11 +4818,11 @@ void G_WriteMetalTic(mobj_t *metal) // Only store the 8 most relevant bits of angle // because exact values aren't too easy to discern to begin with when only 8 angles have different sprites // and it does not affect movement at all anyway. - if (metal->angle>>24 != oldmetal.angle) + if (metal->player && metal->player->drawangle>>24 != oldmetal.angle) { - oldmetal.angle = metal->angle>>24; - WRITEUINT8(demo_p,oldmetal.angle); + oldmetal.angle = metal->player->drawangle>>24; ziptic |= GZT_ANGLE; + WRITEUINT8(demo_p,oldmetal.angle); } // Metal Sonic does not need our state changes. @@ -4990,6 +4990,21 @@ void G_BeginRecording(void) // Don't do it. WRITEFIXED(demo_p, player->jumpfactor); + // Save pflag data + { + UINT8 buf = 0; + if (player->pflags & PF_FLIPCAM) + buf |= 1; + if (player->pflags & PF_ANALOGMODE) + buf |= 2; + if (player->pflags & PF_DIRECTIONCHAR) + buf |= 4; + if (player->pflags & PF_AUTOBRAKE) + buf |= 8; + + WRITEUINT8(demo_p,buf); + } + // Save netvar data CV_SaveNetVars(&demo_p); @@ -5004,7 +5019,7 @@ void G_BeginRecording(void) oldghost.x = player->mo->x; oldghost.y = player->mo->y; oldghost.z = player->mo->z; - oldghost.angle = player->mo->angle; + oldghost.angle = player->drawangle>>24; // preticker started us gravity flipped if (player->mo->eflags & MFE_VERTICALFLIP) @@ -5037,7 +5052,8 @@ void G_BeginMetal(void) oldmetal.x = mo->x; oldmetal.y = mo->y; oldmetal.z = mo->z; - oldmetal.angle = mo->angle; + if (mo->player) + oldmetal.angle = mo->player->drawangle>>24; } void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings) @@ -5137,8 +5153,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: @@ -5214,6 +5228,7 @@ void G_DoPlayDemo(char *defdemoname) lumpnum_t l; char skin[17],color[17],*n,*pdemoname; UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration; + pflags_t pflags; UINT32 randseed; fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight; char msg[1024]; @@ -5277,8 +5292,6 @@ void G_DoPlayDemo(char *defdemoname) switch(demoversion) { case DEMOVERSION: // latest always supported - // compatibility available? - case 0x0008: break; // too old, cannot support. default: @@ -5304,10 +5317,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); @@ -5367,6 +5377,20 @@ void G_DoPlayDemo(char *defdemoname) spinheight = (fixed_t)READUINT8(demo_p)<mo->skin = &skins[player->skin]; player->mo->color = player->skincolor; + G_GhostAddColor(GHC_NORMAL); // Restore aiming angle if (player == &players[consoleplayer]) @@ -6906,6 +6907,8 @@ static void P_MovePlayer(player_t *player) && !(player->exiting))) { skin_t *skin = ((skin_t *)(player->mo->skin)); + if (skin->flags & SF_SUPER && player->mo->color < MAXSKINCOLORS) + G_GhostAddColor(GHC_SUPER); player->mo->color = (skin->flags & SF_SUPER) ? skin->supercolor + (unsigned)abs(((signed)(leveltime >> 1) % 9) - 4) : player->mo->color; // This is where super flashing is handled. } From 728a195e549bff03e290de2603f828d602a82905 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 10 Oct 2017 19:30:32 +0100 Subject: [PATCH 02/15] Fix NiGHTS desync message... by obliterating all its special casing. --- src/g_game.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index eff1d2370..d3ea896d6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3976,9 +3976,9 @@ static ticcmd_t oldcmd; #define GZT_ANGLE 0x08 // Not used for Metal Sonic #define GZT_SPRITE 0x10 // Animation frame -#define GZT_EXTRA 0x20 -#define GZT_NIGHTS 0x40 // NiGHTS Mode stuff! -#define GZT_SPR2 0x80 // Player animations +#define GZT_SPR2 0x20 // Player animations +// spare GZT slot 0x40 +#define GZT_EXTRA 0x80 // GZT_EXTRA flags #define EZT_THOK 0x01 // Spawned a thok object @@ -4188,9 +4188,6 @@ void G_WriteGhostTic(mobj_t *ghost) if (!(demoflags & DF_GHOST)) return; // No ghost data to write. - if (ghost->player && ghost->player->powers[pw_carry] == CR_NIGHTSMODE) // We're talking about the NiGHTS thing, not the normal platforming thing! - ziptic |= GZT_NIGHTS; - ziptic_p = demo_p++; // the ziptic, written at the end of this function #define MAXMOM (0xFFFF<<8) @@ -4335,7 +4332,6 @@ void G_ConsGhostTic(void) UINT8 ziptic; UINT16 px,py,pz,gx,gy,gz; mobj_t *testmo; - boolean nightsfail = false; if (!demo_p || !demo_start) return; @@ -4371,10 +4367,6 @@ void G_ConsGhostTic(void) demo_p++; if (ziptic & GZT_SPR2) demo_p++; - if (ziptic & GZT_NIGHTS) { - if (!testmo->player || !(testmo->player->powers[pw_carry] == CR_NIGHTSMODE)) - nightsfail = true; - } if (ziptic & GZT_EXTRA) { // But wait, there's more! @@ -4436,7 +4428,7 @@ void G_ConsGhostTic(void) gy = oldghost.y>>FRACBITS; gz = oldghost.z>>FRACBITS; - if (nightsfail || px != gx || py != gy || pz != gz) + if (px != gx || py != gy || pz != gz) { if (demosynced) CONS_Alert(CONS_WARNING, M_GetText("Demo playback has desynced!\n")); From 7fcef5d44de38773aeedda509fbe4be10a2f9958 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 10 Oct 2017 21:24:24 +0100 Subject: [PATCH 03/15] Huh, that's what was going on with the black magyks. Silly me! --- src/g_game.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index d3ea896d6..89a77e9ac 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4963,8 +4963,6 @@ void G_BeginRecording(void) demo_p += 16; // Stats - WRITEUINT8(demo_p,player->camerascale>>FRACBITS); - WRITEUINT8(demo_p,player->shieldscale>>FRACBITS); WRITEUINT8(demo_p,player->charability); WRITEUINT8(demo_p,player->charability2); WRITEUINT8(demo_p,player->actionspd>>FRACBITS); @@ -4977,6 +4975,8 @@ void G_BeginRecording(void) WRITEUINT8(demo_p,player->acceleration); WRITEUINT8(demo_p,player->height>>FRACBITS); WRITEUINT8(demo_p,player->spinheight>>FRACBITS); + WRITEUINT8(demo_p,player->camerascale>>FRACBITS); + WRITEUINT8(demo_p,player->shieldscale>>FRACBITS); // Trying to convert it back to % causes demo desync due to precision loss. // Don't do it. @@ -5011,7 +5011,7 @@ void G_BeginRecording(void) oldghost.x = player->mo->x; oldghost.y = player->mo->y; oldghost.z = player->mo->z; - oldghost.angle = player->drawangle>>24; + oldghost.angle = player->mo->angle>>24; // preticker started us gravity flipped if (player->mo->eflags & MFE_VERTICALFLIP) @@ -5044,8 +5044,7 @@ void G_BeginMetal(void) oldmetal.x = mo->x; oldmetal.y = mo->y; oldmetal.z = mo->z; - if (mo->player) - oldmetal.angle = mo->player->drawangle>>24; + oldmetal.angle = mo->angle>>24; } void G_SetDemoTime(UINT32 ptime, UINT32 pscore, UINT16 prings) @@ -5353,8 +5352,6 @@ void G_DoPlayDemo(char *defdemoname) M_Memcpy(color,demo_p,16); demo_p += 16; - camerascale = (fixed_t)READUINT8(demo_p)< Date: Wed, 11 Oct 2017 17:45:32 +0100 Subject: [PATCH 04/15] Beginner support for followitem. Doesn't handle it for ghosts; need to do that independently. --- src/g_game.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 5f4e83bc1..aa5031cbf 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4985,6 +4985,9 @@ void G_BeginRecording(void) // Don't do it. WRITEFIXED(demo_p, player->jumpfactor); + // And mobjtype_t is best with UINT32 too... + WRITEUINT32(demo_p, player->followitem); + // Save pflag data { UINT8 buf = 0; @@ -5223,7 +5226,7 @@ void G_DoPlayDemo(char *defdemoname) char skin[17],color[17],*n,*pdemoname; UINT8 version,subversion,charability,charability2,thrustfactor,accelstart,acceleration; pflags_t pflags; - UINT32 randseed; + UINT32 randseed, followitem; fixed_t camerascale,shieldscale,actionspd,mindash,maxdash,normalspeed,runspeed,jumpfactor,height,spinheight; char msg[1024]; @@ -5370,6 +5373,7 @@ void G_DoPlayDemo(char *defdemoname) camerascale = (fixed_t)READUINT8(demo_p)< Date: Thu, 12 Oct 2017 13:15:24 +0100 Subject: [PATCH 05/15] Fixed followmobj not getting deleted when removing mobjs. Why did I do it in this branch? I've got lots related to followmobjs to do here for demo purposes, so... --- src/p_mobj.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index cefc3129e..c786d3ed8 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8587,6 +8587,12 @@ void P_RemoveMobj(mobj_t *mobj) if (mobj->type == MT_OVERLAY) P_RemoveOverlay(mobj); + if (mobj->player && mobj->player->followmobj) + { + P_RemoveMobj(mobj->player->followmobj); + mobj->player->followmobj = NULL; + } + mobj->health = 0; // Just because // unlink from sector and block lists From 1ba9d1fe6e33ce39e5ba004d069f90271c4c3a9c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 14 Oct 2017 17:50:14 +0100 Subject: [PATCH 06/15] * Rudimentary (set everything every state or DIE) support for ghost followmobjs. * Rename GZT_SPRITE to GZT_FRAME, since otherwise it's easy to confuse with EZT_SPRITE (which does something completely different). * Fix issue where ghosts were facing wrong direction on spawn. * Other minor refactorings. * ...also, made smiles' tails pop up instead of down when skidding --- src/g_game.c | 152 ++++++++++++++++++++++++++++++++++++++------------- src/p_user.c | 2 +- 2 files changed, 116 insertions(+), 38 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index aa5031cbf..e31cd8e3b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3978,10 +3978,10 @@ static ticcmd_t oldcmd; #define GZT_MOMZ 0x04 #define GZT_ANGLE 0x08 // Not used for Metal Sonic -#define GZT_SPRITE 0x10 // Animation frame +#define GZT_FRAME 0x10 // Animation frame #define GZT_SPR2 0x20 // Player animations -// spare GZT slot 0x40 -#define GZT_EXTRA 0x80 +#define GZT_EXTRA 0x40 +#define GZT_FOLLOW 0x80 // Followmobj // GZT_EXTRA flags #define EZT_THOK 0x01 // Spawned a thok object @@ -3993,6 +3993,7 @@ static ticcmd_t oldcmd; #define EZT_SCALE 0x10 // Changed size #define EZT_HIT 0x20 // Damaged a mobj #define EZT_SPRITE 0x40 // Changed sprite set completely out of PLAY (NiGHTS, SOCs, whatever) +// spare EZT slot 0x80 static mobj_t oldmetal, oldghost; @@ -4252,10 +4253,10 @@ void G_WriteGhostTic(mobj_t *ghost) } // Store the sprite frame. - if ((ghost->frame & 0xFF) != oldghost.frame) + if ((ghost->frame & FF_FRAMEMASK) != oldghost.frame) { - oldghost.frame = (ghost->frame & 0xFF); - ziptic |= GZT_SPRITE; + oldghost.frame = (ghost->frame & FF_FRAMEMASK); + ziptic |= GZT_FRAME; WRITEUINT8(demo_p,oldghost.frame); } @@ -4300,7 +4301,7 @@ void G_WriteGhostTic(mobj_t *ghost) for (i = 0; i < ghostext.hits; i++) { mobj_t *mo = ghostext.hitlist[i]; - WRITEUINT32(demo_p,UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.) + //WRITEUINT32(demo_p,UINT32_MAX); // reserved for some method of determining exactly which mobj this is. (mobjnum doesn't work here.) WRITEUINT32(demo_p,mo->type); WRITEUINT16(demo_p,(UINT16)mo->health); WRITEFIXED(demo_p,mo->x); @@ -4317,11 +4318,28 @@ void G_WriteGhostTic(mobj_t *ghost) ghostext.flags = 0; } + if (ghost->player && ghost->player->followmobj) + { + INT16 temp; + + ziptic |= GZT_FOLLOW; + + temp = (INT16)((ghost->player->followmobj->x-ghost->x)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((ghost->player->followmobj->y-ghost->y)>>8); + WRITEINT16(demo_p,temp); + temp = (INT16)((ghost->player->followmobj->z-ghost->z)>>8); + WRITEINT16(demo_p,temp); + WRITEUINT8(demo_p,ghost->player->followmobj->sprite); + WRITEUINT8(demo_p,ghost->player->followmobj->sprite2); + WRITEUINT8(demo_p,(ghost->player->followmobj->frame & FF_FRAMEMASK)); + } + *ziptic_p = ziptic; // attention here for the ticcmd size! // latest demos with mouse aiming byte in ticcmd - if (demo_p >= demoend - (13 + 9)) + if (demo_p >= demoend - (13 + 9 + 9)) { G_CheckDemoStatus(); // no more space return; @@ -4366,19 +4384,19 @@ void G_ConsGhostTic(void) } if (ziptic & GZT_ANGLE) demo_p++; - if (ziptic & GZT_SPRITE) + if (ziptic & GZT_FRAME) demo_p++; if (ziptic & GZT_SPR2) demo_p++; if (ziptic & GZT_EXTRA) { // But wait, there's more! - ziptic = READUINT8(demo_p); - if (ziptic & EZT_COLOR) + UINT8 xziptic = READUINT8(demo_p); + if (xziptic & EZT_COLOR) demo_p++; - if (ziptic & EZT_SCALE) + if (xziptic & EZT_SCALE) demo_p += sizeof(fixed_t); - if (ziptic & EZT_HIT) + if (xziptic & EZT_HIT) { // Resync mob damage. UINT16 i, count = READUINT16(demo_p); thinker_t *th; @@ -4392,7 +4410,7 @@ void G_ConsGhostTic(void) for (i = 0; i < count; i++) { - demo_p += 4; // reserved. + //demo_p += 4; // reserved. type = READUINT32(demo_p); health = READUINT16(demo_p); x = READFIXED(demo_p); @@ -4419,10 +4437,20 @@ void G_ConsGhostTic(void) } } } - if (ziptic & EZT_SPRITE) + if (xziptic & EZT_SPRITE) demo_p++; } + if (ziptic & GZT_FOLLOW) + { // Even more... + demo_p += sizeof(INT16); + demo_p += sizeof(INT16); + demo_p += sizeof(INT16); + demo_p++; + demo_p++; + demo_p++; + } + // Re-synchronise px = testmo->x>>FRACBITS; py = testmo->y>>FRACBITS; @@ -4459,6 +4487,7 @@ void G_GhostTicker(void) { // Skip normal demo data. UINT8 ziptic = READUINT8(g->p); + UINT8 xziptic = 0; if (ziptic & ZT_FWD) g->p++; if (ziptic & ZT_SIDE) @@ -4492,8 +4521,8 @@ void G_GhostTicker(void) g->oldmo.z += g->oldmo.momz; } if (ziptic & GZT_ANGLE) - g->oldmo.angle = READUINT8(g->p)<<24; - if (ziptic & GZT_SPRITE) + g->mo->angle = READUINT8(g->p)<<24; + if (ziptic & GZT_FRAME) g->oldmo.frame = READUINT8(g->p); if (ziptic & GZT_SPR2) g->oldmo.sprite2 = READUINT8(g->p); @@ -4504,14 +4533,13 @@ void G_GhostTicker(void) g->mo->y = g->oldmo.y; g->mo->z = g->oldmo.z; P_SetThingPosition(g->mo); - g->mo->angle = g->oldmo.angle; g->mo->frame = g->oldmo.frame | tr_trans30<mo->sprite2 = g->oldmo.sprite2; if (ziptic & GZT_EXTRA) { // But wait, there's more! - ziptic = READUINT8(g->p); - if (ziptic & EZT_COLOR) + xziptic = READUINT8(g->p); + if (xziptic & EZT_COLOR) { g->color = READUINT8(g->p); switch(g->color) @@ -4529,22 +4557,22 @@ void G_GhostTicker(void) break; } } - if (ziptic & EZT_FLIP) + if (xziptic & EZT_FLIP) g->mo->eflags ^= MFE_VERTICALFLIP; - if (ziptic & EZT_SCALE) + if (xziptic & EZT_SCALE) { g->mo->destscale = READFIXED(g->p); if (g->mo->destscale != g->mo->scale) P_SetScale(g->mo, g->mo->destscale); } - if (ziptic & EZT_THOKMASK) + if (xziptic & EZT_THOKMASK) { // Let's only spawn ONE of these per frame, thanks. mobj_t *mobj; INT32 type = -1; if (g->mo->skin) { skin_t *skin = (skin_t *)g->mo->skin; - switch (ziptic & EZT_THOKMASK) + switch (xziptic & EZT_THOKMASK) { case EZT_THOK: type = skin->thokitem < 0 ? (UINT32)mobjinfo[MT_PLAYER].painchance : (UINT32)skin->thokitem; @@ -4585,7 +4613,7 @@ void G_GhostTicker(void) mobj->fuse = 8; P_SetTarget(&mobj->target, g->mo); } - if (ziptic & EZT_HIT) + if (xziptic & EZT_HIT) { // Spawn hit poofs for killing things! UINT16 i, count = READUINT16(g->p), health; UINT32 type; @@ -4594,7 +4622,7 @@ void G_GhostTicker(void) mobj_t *poof; for (i = 0; i < count; i++) { - g->p += 4; // reserved + //g->p += 4; // reserved type = READUINT32(g->p); health = READUINT16(g->p); x = READFIXED(g->p); @@ -4612,7 +4640,7 @@ void G_GhostTicker(void) P_SetMobjStateNF(poof, S_XPLD1); } } - if (ziptic & EZT_SPRITE) + if (xziptic & EZT_SPRITE) g->mo->sprite = READUINT8(g->p); } @@ -4636,6 +4664,54 @@ void G_GhostTicker(void) break; } +#define follow g->mo->tracer + if (ziptic & GZT_FOLLOW) + { // Even more... + if (!follow) + { + mobj_t *newmo = P_SpawnMobj(g->mo->x, g->mo->y, g->mo->z, MT_GHOST); + P_SetTarget(&g->mo->tracer, newmo); + P_SetTarget(&newmo->tracer, g->mo); + newmo->skin = g->mo->skin; + newmo->tics = -1; + newmo->flags2 |= MF2_LINKDRAW; + + follow->eflags = (follow->eflags & ~MFE_VERTICALFLIP)|(g->mo->eflags & MFE_VERTICALFLIP); + follow->destscale = g->mo->destscale; + if (follow->destscale != follow->scale) + P_SetScale(follow, follow->destscale); + } + else + { + if (xziptic & EZT_FLIP) + g->mo->eflags ^= MFE_VERTICALFLIP; + if (xziptic & EZT_SCALE) + { + follow->destscale = g->mo->destscale; + if (follow->destscale != follow->scale) + P_SetScale(follow, follow->destscale); + } + } + + P_UnsetThingPosition(follow); + follow->x = g->mo->x + (READINT16(g->p)<<8); + follow->y = g->mo->y + (READINT16(g->p)<<8); + follow->z = g->mo->z + (READINT16(g->p)<<8); + P_SetThingPosition(follow); + follow->sprite = READUINT8(g->p); + follow->sprite2 = READUINT8(g->p); + follow->frame = (READUINT8(g->p)) | tr_trans30<angle = g->mo->angle; + follow->color = g->mo->color; + } + else if (follow) + { + P_RemoveMobj(follow); + P_SetTarget(&follow, NULL); + } +#undef follow + // Demo ends after ghost data. if (*g->p == DEMOMARKER) { @@ -4682,8 +4758,8 @@ void G_ReadMetalTic(mobj_t *metal) oldmetal.z += oldmetal.momz; } if (ziptic & GZT_ANGLE) - oldmetal.angle = READUINT8(metal_p)<<24; - if (ziptic & GZT_SPRITE) + metal->angle = READUINT8(metal_p)<<24; + if (ziptic & GZT_FRAME) metal_p++; // Currently unused. (Metal Sonic figures out what he's doing his own damn self.) if (ziptic & GZT_SPR2) metal_p++; @@ -4698,7 +4774,6 @@ void G_ReadMetalTic(mobj_t *metal) metal->y = oldmetal.y; metal->z = oldmetal.z; P_SetThingPosition(metal); - metal->angle = oldmetal.angle; if (ziptic & GZT_EXTRA) { // But wait, there's more! @@ -5668,10 +5743,6 @@ void G_AddGhost(char *defdemoname) gh->mo = P_SpawnMobj(x, y, z, MT_GHOST); gh->mo->angle = FixedAngle(mthing->angle*FRACUNIT); } - gh->mo->state = states+S_PLAY_STND; - gh->mo->sprite = gh->mo->state->sprite; - gh->mo->frame = (gh->mo->state->frame & FF_FRAMEMASK) | tr_trans20<mo->tics = -1; gh->oldmo.x = gh->mo->x; gh->oldmo.y = gh->mo->y; @@ -5697,6 +5768,12 @@ void G_AddGhost(char *defdemoname) } gh->oldmo.color = gh->mo->color; + gh->mo->state = states+S_PLAY_STND; + gh->mo->sprite = gh->mo->state->sprite; + gh->mo->sprite2 = (gh->mo->state->frame & FF_FRAMEMASK); + gh->mo->frame = tr_trans20<mo->tics = -1; + CONS_Printf(M_GetText("Added ghost %s from %s\n"), name, pdemoname); Z_Free(pdemoname); } @@ -5743,8 +5820,10 @@ void G_DoPlayMetal(void) continue; mo = (mobj_t *)th; - if (mo->type == MT_METALSONIC_RACE) - break; + if (mo->type != MT_METALSONIC_RACE) + continue; + + break; } if (!mo) { @@ -5781,7 +5860,6 @@ void G_DoPlayMetal(void) oldmetal.x = mo->x; oldmetal.y = mo->y; oldmetal.z = mo->z; - oldmetal.angle = mo->angle; metalplayback = mo; } diff --git a/src/p_user.c b/src/p_user.c index 43134d796..07173e613 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -10612,7 +10612,7 @@ void P_PlayerAfterThink(player_t *player) chosenstate = S_TAILSOVERLAY_RUN; else if (player->panim == PA_WALK) { - if (!smilesonground) + if (!smilesonground || player->mo->state-states == S_PLAY_SKID) chosenstate = S_TAILSOVERLAY_PLUS30DEGREES; else if (player->speed >= FixedMul(player->runspeed/2, player->mo->scale)) chosenstate = S_TAILSOVERLAY_0DEGREES; From a4f10a4b96663aff7d8147e727d0f77063f34664 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 15 Oct 2017 12:35:49 +0100 Subject: [PATCH 07/15] Fixed replays of skins whose realnames differed from their normal names from not being readable (by fixing the writing). --- src/m_menu.c | 8 ++++---- src/y_inter.c | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 10faadfdf..58f98a378 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2007,7 +2007,7 @@ void Nextmap_OnChange(void) SP_TimeAttackMenu[taghost].status = IT_DISABLED; // Check if file exists, if not, disable REPLAY option - sprintf(tabase,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string); + sprintf(tabase,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s",srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), skins[cv_chooseskin.value-1].name); for (i = 0; i < 5; i++) { SP_ReplayMenu[i].status = IT_DISABLED; SP_GuestReplayMenu[i].status = IT_DISABLED; @@ -7616,7 +7616,7 @@ static void M_ChooseTimeAttack(INT32 choice) I_Error("Out of memory for replay filepath\n"); sprintf(gpath,"replay"PATHSEP"%s"PATHSEP"%s", timeattackfolder, G_BuildMapName(cv_nextmap.value)); - snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, cv_chooseskin.string); + snprintf(nameofdemo, sizeof nameofdemo, "%s-%s-last", gpath, skins[cv_chooseskin.value-1].name); if (!cv_autorecord.value) remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo)); @@ -7655,7 +7655,7 @@ static void M_ReplayTimeAttack(INT32 choice) return; } // srb2/replay/main/map01-sonic-time-best.lmp - G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which)); + G_DoPlayDemo(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), skins[cv_chooseskin.value-1].name, which)); } else if (currentMenu == &SP_NightsReplayDef) { @@ -7699,7 +7699,7 @@ static void M_OverwriteGuest(const char *which, boolean nights) UINT8 *buf; size_t len; if (!nights) - len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), cv_chooseskin.string, which), &buf); + len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), skins[cv_chooseskin.value-1].name, which), &buf); else len = FIL_ReadFile(va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-%s.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value), which), &buf); if (!len) { diff --git a/src/y_inter.c b/src/y_inter.c index 0907d396c..226d86955 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -915,14 +915,14 @@ static void Y_UpdateRecordReplays(void) I_Error("Out of memory for replay filepath\n"); sprintf(gpath,"%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s", srb2home, timeattackfolder, G_BuildMapName(gamemap)); - snprintf(lastdemo, 255, "%s-%s-last.lmp", gpath, cv_chooseskin.string); + snprintf(lastdemo, 255, "%s-%s-last.lmp", gpath, skins[cv_chooseskin.value-1].name); if (FIL_FileExists(lastdemo)) { UINT8 *buf; size_t len = FIL_ReadFile(lastdemo, &buf); - snprintf(bestdemo, 255, "%s-%s-time-best.lmp", gpath, cv_chooseskin.string); + snprintf(bestdemo, 255, "%s-%s-time-best.lmp", gpath, skins[cv_chooseskin.value-1].name); if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1) { // Better time, save this demo. if (FIL_FileExists(bestdemo)) @@ -931,7 +931,7 @@ static void Y_UpdateRecordReplays(void) CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW RECORD TIME!"), M_GetText("Saved replay as"), bestdemo); } - snprintf(bestdemo, 255, "%s-%s-score-best.lmp", gpath, cv_chooseskin.string); + snprintf(bestdemo, 255, "%s-%s-score-best.lmp", gpath, skins[cv_chooseskin.value-1].name); if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<1))) { // Better score, save this demo. if (FIL_FileExists(bestdemo)) @@ -940,7 +940,7 @@ static void Y_UpdateRecordReplays(void) CONS_Printf("\x83%s\x80 %s '%s'\n", M_GetText("NEW HIGH SCORE!"), M_GetText("Saved replay as"), bestdemo); } - snprintf(bestdemo, 255, "%s-%s-rings-best.lmp", gpath, cv_chooseskin.string); + snprintf(bestdemo, 255, "%s-%s-rings-best.lmp", gpath, skins[cv_chooseskin.value-1].name); if (!FIL_FileExists(bestdemo) || (G_CmpDemoTime(bestdemo, lastdemo) & (1<<2))) { // Better rings, save this demo. if (FIL_FileExists(bestdemo)) From 04160f0081d54db0026b07351cb7353f8825bd00 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 15 Oct 2017 13:37:05 +0100 Subject: [PATCH 08/15] Fixed the smilestails/any other followmobj not spawning at leveltime 0 in a fresh record attack boot! --- src/d_netcmd.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 0a63a2fc7..59f5ccc7a 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1890,6 +1890,13 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) if (resetplayer && !FLS) emeralds = 0; + if (modeattacking) + { + SetPlayerSkinByNum(0, cv_chooseskin.value-1); + players[0].skincolor = skins[players[0].skin].prefcolor; + CV_StealthSetValue(&cv_playercolor, players[0].skincolor); + } + #ifdef HAVE_BLUA LUAh_MapChange(); #endif @@ -1901,16 +1908,6 @@ static void Got_Mapcmd(UINT8 **cp, INT32 playernum) if (timingdemo) G_DoneLevelLoad(); - if (modeattacking) - { - SetPlayerSkinByNum(0, cv_chooseskin.value-1); - players[0].skincolor = skins[players[0].skin].prefcolor; - CV_StealthSetValue(&cv_playercolor, players[0].skincolor); - - // a copy of color - if (players[0].mo) - players[0].mo->color = players[0].skincolor; - } if (metalrecording) G_BeginMetal(); if (demorecording) // Okay, level loaded, character spawned and skinned, From c7b2c43ae5fdf7ec4ddd2ea59b3dddedf343a263 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sun, 15 Oct 2017 13:37:05 +0100 Subject: [PATCH 09/15] Record attack input display! https://cdn.discordapp.com/attachments/293238104096112641/369485020038955008/srb20041.gif --- src/d_netcmd.c | 5 +- src/doomstat.h | 1 + src/g_game.c | 20 +++--- src/p_user.c | 2 +- src/st_stuff.c | 166 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 184 insertions(+), 10 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 59f5ccc7a..a36915d66 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -196,6 +196,9 @@ static CV_PossibleValue_t chances_cons_t[] = {{0, "MIN"}, {9, "MAX"}, {0, NULL}} static CV_PossibleValue_t pause_cons_t[] = {{0, "Server"}, {1, "All"}, {0, NULL}}; static CV_PossibleValue_t timetic_cons_t[] = {{0, "Normal"}, {1, "Tics"}, {2, "Centiseconds"}, {0, NULL}}; +consvar_t cv_timetic = {"timerres", "Normal", CV_SAVE, timetic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display + +consvar_t cv_showinputjoy = {"showinputjoy", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef NETGAME_DEVMODE static consvar_t cv_fishcake = {"fishcake", "Off", CV_CALL|CV_NOSHOWHELP|CV_RESTRICT, CV_OnOff, Fishcake_OnChange, 0, NULL, NULL, 0, 0, NULL}; @@ -319,7 +322,6 @@ consvar_t cv_overtime = {"overtime", "Yes", CV_NETVAR, CV_YesNo, NULL, 0, NULL, consvar_t cv_rollingdemos = {"rollingdemos", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_timetic = {"timerres", "Normal", CV_SAVE, timetic_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; // use tics in display consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t pointlimit_cons_t[] = {{0, "MIN"}, {999999990, "MAX"}, {0, NULL}}; @@ -672,6 +674,7 @@ void D_RegisterClientCommands(void) // HUD CV_RegisterVar(&cv_timetic); CV_RegisterVar(&cv_itemfinder); + CV_RegisterVar(&cv_showinputjoy); // time attack ghost options are also saved to config CV_RegisterVar(&cv_ghost_bestscore); diff --git a/src/doomstat.h b/src/doomstat.h index 0d763a5a9..c13b1db5a 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -494,6 +494,7 @@ extern boolean singletics; #include "d_clisrv.h" extern consvar_t cv_timetic; // display high resolution timer +extern consvar_t cv_showinputjoy; // display joystick in time attack extern consvar_t cv_forceskin; // force clients to use the server's skin extern consvar_t cv_downloading; // allow clients to downloading WADs. extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS]; diff --git a/src/g_game.c b/src/g_game.c index e31cd8e3b..837191a3c 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5067,13 +5067,16 @@ void G_BeginRecording(void) { UINT8 buf = 0; if (player->pflags & PF_FLIPCAM) - buf |= 1; + buf |= 0x01; if (player->pflags & PF_ANALOGMODE) - buf |= 2; + buf |= 0x02; if (player->pflags & PF_DIRECTIONCHAR) - buf |= 4; + buf |= 0x04; if (player->pflags & PF_AUTOBRAKE) - buf |= 8; + buf |= 0x08; + if (cv_usejoystick.value) + buf |= 0x10; + CV_SetValue(&cv_showinputjoy, !!(cv_usejoystick.value)); WRITEUINT8(demo_p,buf); } @@ -5454,14 +5457,15 @@ void G_DoPlayDemo(char *defdemoname) { UINT8 buf = READUINT8(demo_p); pflags = 0; - if (buf & 1) + if (buf & 0x01) pflags |= PF_FLIPCAM; - if (buf & 2) + if (buf & 0x02) pflags |= PF_ANALOGMODE; - if (buf & 4) + if (buf & 0x04) pflags |= PF_DIRECTIONCHAR; - if (buf & 8) + if (buf & 0x08) pflags |= PF_AUTOBRAKE; + CV_SetValue(&cv_showinputjoy, !!(buf & 0x10)); } // net var data diff --git a/src/p_user.c b/src/p_user.c index f4c57bcc6..788fe02d8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9849,7 +9849,7 @@ void P_PlayerThink(player_t *player) } } - // Autobrake! + // Autobrake! check ST_drawInput if you modify this { boolean currentlyonground = P_IsObjectOnGround(player->mo); diff --git a/src/st_stuff.c b/src/st_stuff.c index 66907036e..605c68d8d 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -779,6 +779,170 @@ static void ST_drawLives(void) } } +static void ST_drawInput(void) +{ + //const INT32 v_splitflag = (splitscreen && stplyr == &players[displayplayer] ? V_SPLITSCREEN : 0); -- no splitscreen support - record attack only for base game + const UINT8 accent = (stplyr->skincolor ? Color_Index[stplyr->skincolor-1][4] : 0); + UINT8 col, offs; + + if (stplyr->pflags & PF_AUTOBRAKE) + { + V_DrawThinString(hudinfo[HUD_LIVESPIC].x-2, hudinfo[HUD_LIVESPIC].y-13, + ((!stplyr->powers[pw_carry] + && (stplyr->pflags & PF_APPLYAUTOBRAKE) + && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) + && (stplyr->rmomx || stplyr->rmomy)) + ? 0 : V_GRAYMAP), + "AUTOBRAKE"); + } + + if (cv_showinputjoy.value) // joystick render! + { + /*V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y , 16, 1, 16); + V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y+15, 16, 1, 16); + V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y+ 1, 1, 14, 16); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+15, hudinfo[HUD_LIVESPIC].y+ 1, 1, 14, 16); -- red's outline*/ + V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y , 16, 16, 20); // O backing + if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove) + { + V_DrawFill(hudinfo[HUD_LIVESPIC].x+5, hudinfo[HUD_LIVESPIC].y+5, 6, 6, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+3+stplyr->cmd.sidemove/12, + hudinfo[HUD_LIVESPIC].y+3-stplyr->cmd.forwardmove/12, + 10, 10, 29); + } + V_DrawFill(hudinfo[HUD_LIVESPIC].x+3+stplyr->cmd.sidemove/9, + hudinfo[HUD_LIVESPIC].y+3-stplyr->cmd.forwardmove/9, + 10, 10, ((stplyr->cmd.sidemove || stplyr->cmd.forwardmove) ? accent : 16)); + } + else // arrows! + { + V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y-1, 16, 16, 20); // O backing + // underside of base + /*if (stplyr->cmd.forwardmove > 0) + V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y+14, 16, 2, 29); + else if (!stplyr->cmd.forwardmove)*/ + V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y+15, 16, 1, 29); + + // < + if (stplyr->cmd.sidemove < 0) + { + offs = 0; + col = accent; + } + else + { + offs = 1; + col = 16; + V_DrawFill(hudinfo[HUD_LIVESPIC].x- 2, hudinfo[HUD_LIVESPIC].y+10, 6, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 4, hudinfo[HUD_LIVESPIC].y+ 9, 1, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 8, 1, 1, 29); + } + V_DrawFill(hudinfo[HUD_LIVESPIC].x- 2, hudinfo[HUD_LIVESPIC].y+ 5-offs, 6, 6, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 4, hudinfo[HUD_LIVESPIC].y+ 6-offs, 1, 4, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 7-offs, 1, 2, col); + + // ^ + if (stplyr->cmd.forwardmove > 0) + { + offs = 0; + col = accent; + } + else + { + offs = 1; + col = 16; + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 3, 1, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+ 4, 1, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+ 5, 2, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 9, hudinfo[HUD_LIVESPIC].y+ 4, 1, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 3, 1, 1, 29); + } + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y- 2-offs, 6, 6, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+ 4-offs, 4, 1, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+ 5-offs, 2, 1, col); + + // > + if (stplyr->cmd.sidemove > 0) + { + offs = 0; + col = accent; + } + else + { + offs = 1; + col = 16; + V_DrawFill(hudinfo[HUD_LIVESPIC].x+12, hudinfo[HUD_LIVESPIC].y+10, 6, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+11, hudinfo[HUD_LIVESPIC].y+ 9, 1, 1, 29); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 8, 1, 1, 29); + } + V_DrawFill(hudinfo[HUD_LIVESPIC].x+12, hudinfo[HUD_LIVESPIC].y+ 5-offs, 6, 6, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+11, hudinfo[HUD_LIVESPIC].y+ 6-offs, 1, 4, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 7-offs, 1, 2, col); + + // v + if (stplyr->cmd.forwardmove < 0) + { + offs = 0; + col = accent; + } + else + { + offs = 1; + col = 16; + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+17, 6, 1, 29); + } + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+12-offs, 6, 6, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+11-offs, 4, 1, col); + V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+10-offs, 2, 1, col); + } + +#define drawbutt(xoffs, yoffs, butt, symb)\ + if (stplyr->cmd.buttons & butt)\ + {\ + offs = 0;\ + col = accent;\ + }\ + else\ + {\ + offs = 1;\ + col = 16;\ + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+(xoffs), hudinfo[HUD_LIVESPIC].y+9+(yoffs), 10, 1, 29);\ + }\ + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+(xoffs), hudinfo[HUD_LIVESPIC].y+(yoffs)-offs, 10, 10, col);\ + V_DrawCharacter(hudinfo[HUD_LIVESPIC].x+16+1+(xoffs), hudinfo[HUD_LIVESPIC].y+1+(yoffs)-offs, symb, false) + + drawbutt( 4,-3, BT_JUMP, 'J'); + drawbutt(15,-3, BT_USE, 'S'); + + if (stplyr->mo) + { + UINT8 i, precision; + angle_t ang = (stplyr->mo->angle - R_PointToAngle(stplyr->mo->x, stplyr->mo->y))>>ANGLETOFINESHIFT; + fixed_t xcomp = FINESINE(ang)>>13; + fixed_t ycomp = FINECOSINE(ang)>>14; + if (ycomp == 4) + ycomp = 3; + + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+4, hudinfo[HUD_LIVESPIC].y+8, 21, 10, 20); // sundial backing + + if (ycomp > 0) + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+13-xcomp, hudinfo[HUD_LIVESPIC].y+11-ycomp, 3, 3, accent); // point (behind) + + precision = max(3, abs(xcomp)); + for (i = 0; i < precision; i++) + { + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+14-(i*xcomp)/precision, + hudinfo[HUD_LIVESPIC].y+12-(i*ycomp)/precision, + 1, 1, 16); + } + + if (ycomp <= 0) + V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+13-xcomp, hudinfo[HUD_LIVESPIC].y+11-ycomp, 3, 3, accent); // point (in front) + } + +#undef drawbutt +} + static void ST_drawLevelTitle(void) { char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl; @@ -1868,6 +2032,8 @@ static void ST_overlayDrawer(void) #endif ) ST_drawLives(); + else if (modeattacking) + ST_drawInput(); } } From 0fe1f9d63b6f322a9b08acd99febd5bff988de2a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 18 Oct 2017 13:22:57 +0100 Subject: [PATCH 10/15] * "BAD DEMO!!" and "ANALOG" attachments to the input viewer * Minor refactor --- src/g_game.c | 6 +-- src/g_game.h | 1 + src/st_stuff.c | 139 ++++++++++++++++++++++++++++--------------------- 3 files changed, 82 insertions(+), 64 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 837191a3c..74e6a6b73 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -248,7 +248,7 @@ static UINT8 demoflags; static UINT16 demoversion; boolean singledemo; // quit after playing a demo from cmdline boolean demo_start; // don't start playing demo right away -static boolean demosynced = true; // console warning message +boolean demosynced = true; // console warning message boolean metalrecording; // recording as metal sonic mobj_t *metalplayback; @@ -1683,6 +1683,7 @@ void G_DoLoadLevel(boolean resetplayer) // Make sure objectplace is OFF when you first start the level! OP_ResetObjectplace(); + demosynced = true; levelstarttic = gametic; // for time calculation @@ -5492,9 +5493,6 @@ void G_DoPlayDemo(char *defdemoname) if (VERSION != version || SUBVERSION != subversion) CONS_Alert(CONS_WARNING, M_GetText("Demo version does not match game version. Desyncs may occur.\n")); - // console warning messages - demosynced = true; - // didn't start recording right away. demo_start = false; diff --git a/src/g_game.h b/src/g_game.h index 31eea061a..1860bb6e0 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -41,6 +41,7 @@ extern boolean demoplayback, titledemo, demorecording, timingdemo; // Quit after playing a demo from cmdline. extern boolean singledemo; extern boolean demo_start; +extern boolean demosynced; extern mobj_t *metalplayback; diff --git a/src/st_stuff.c b/src/st_stuff.c index 605c68d8d..c3ce200f6 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -785,44 +785,41 @@ static void ST_drawInput(void) const UINT8 accent = (stplyr->skincolor ? Color_Index[stplyr->skincolor-1][4] : 0); UINT8 col, offs; - if (stplyr->pflags & PF_AUTOBRAKE) - { - V_DrawThinString(hudinfo[HUD_LIVESPIC].x-2, hudinfo[HUD_LIVESPIC].y-13, - ((!stplyr->powers[pw_carry] - && (stplyr->pflags & PF_APPLYAUTOBRAKE) - && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) - && (stplyr->rmomx || stplyr->rmomy)) - ? 0 : V_GRAYMAP), - "AUTOBRAKE"); - } + INT32 x = hudinfo[HUD_LIVESPIC].x, y = hudinfo[HUD_LIVESPIC].y; + + // O backing + V_DrawFill(x, y-1, 16, 16, 20); + V_DrawFill(x, y+15, 16, 1, 29); if (cv_showinputjoy.value) // joystick render! { - /*V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y , 16, 1, 16); - V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y+15, 16, 1, 16); - V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y+ 1, 1, 14, 16); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+15, hudinfo[HUD_LIVESPIC].y+ 1, 1, 14, 16); -- red's outline*/ - V_DrawFill(hudinfo[HUD_LIVESPIC].x , hudinfo[HUD_LIVESPIC].y , 16, 16, 20); // O backing + /*V_DrawFill(x , y , 16, 1, 16); + V_DrawFill(x , y+15, 16, 1, 16); + V_DrawFill(x , y+ 1, 1, 14, 16); + V_DrawFill(x+15, y+ 1, 1, 14, 16); -- red's outline*/ if (stplyr->cmd.sidemove || stplyr->cmd.forwardmove) { - V_DrawFill(hudinfo[HUD_LIVESPIC].x+5, hudinfo[HUD_LIVESPIC].y+5, 6, 6, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+3+stplyr->cmd.sidemove/12, - hudinfo[HUD_LIVESPIC].y+3-stplyr->cmd.forwardmove/12, + // joystick hole + V_DrawFill(x+5, y+4, 6, 6, 29); + // joystick top + V_DrawFill(x+3+stplyr->cmd.sidemove/12, + y+2-stplyr->cmd.forwardmove/12, 10, 10, 29); + V_DrawFill(x+3+stplyr->cmd.sidemove/9, + y+1-stplyr->cmd.forwardmove/9, + 10, 10, accent); + } + else + { + // just a limited, greyed out joystick top + V_DrawFill(x+3, y+11, 10, 1, 29); + V_DrawFill(x+3, + y+1, + 10, 10, 16); } - V_DrawFill(hudinfo[HUD_LIVESPIC].x+3+stplyr->cmd.sidemove/9, - hudinfo[HUD_LIVESPIC].y+3-stplyr->cmd.forwardmove/9, - 10, 10, ((stplyr->cmd.sidemove || stplyr->cmd.forwardmove) ? accent : 16)); } else // arrows! { - V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y-1, 16, 16, 20); // O backing - // underside of base - /*if (stplyr->cmd.forwardmove > 0) - V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y+14, 16, 2, 29); - else if (!stplyr->cmd.forwardmove)*/ - V_DrawFill(hudinfo[HUD_LIVESPIC].x, hudinfo[HUD_LIVESPIC].y+15, 16, 1, 29); - // < if (stplyr->cmd.sidemove < 0) { @@ -833,13 +830,13 @@ static void ST_drawInput(void) { offs = 1; col = 16; - V_DrawFill(hudinfo[HUD_LIVESPIC].x- 2, hudinfo[HUD_LIVESPIC].y+10, 6, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 4, hudinfo[HUD_LIVESPIC].y+ 9, 1, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 8, 1, 1, 29); + V_DrawFill(x- 2, y+10, 6, 1, 29); + V_DrawFill(x+ 4, y+ 9, 1, 1, 29); + V_DrawFill(x+ 5, y+ 8, 1, 1, 29); } - V_DrawFill(hudinfo[HUD_LIVESPIC].x- 2, hudinfo[HUD_LIVESPIC].y+ 5-offs, 6, 6, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 4, hudinfo[HUD_LIVESPIC].y+ 6-offs, 1, 4, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 7-offs, 1, 2, col); + V_DrawFill(x- 2, y+ 5-offs, 6, 6, col); + V_DrawFill(x+ 4, y+ 6-offs, 1, 4, col); + V_DrawFill(x+ 5, y+ 7-offs, 1, 2, col); // ^ if (stplyr->cmd.forwardmove > 0) @@ -851,15 +848,15 @@ static void ST_drawInput(void) { offs = 1; col = 16; - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+ 3, 1, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+ 4, 1, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+ 5, 2, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 9, hudinfo[HUD_LIVESPIC].y+ 4, 1, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 3, 1, 1, 29); + V_DrawFill(x+ 5, y+ 3, 1, 1, 29); + V_DrawFill(x+ 6, y+ 4, 1, 1, 29); + V_DrawFill(x+ 7, y+ 5, 2, 1, 29); + V_DrawFill(x+ 9, y+ 4, 1, 1, 29); + V_DrawFill(x+10, y+ 3, 1, 1, 29); } - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y- 2-offs, 6, 6, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+ 4-offs, 4, 1, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+ 5-offs, 2, 1, col); + V_DrawFill(x+ 5, y- 2-offs, 6, 6, col); + V_DrawFill(x+ 6, y+ 4-offs, 4, 1, col); + V_DrawFill(x+ 7, y+ 5-offs, 2, 1, col); // > if (stplyr->cmd.sidemove > 0) @@ -871,13 +868,13 @@ static void ST_drawInput(void) { offs = 1; col = 16; - V_DrawFill(hudinfo[HUD_LIVESPIC].x+12, hudinfo[HUD_LIVESPIC].y+10, 6, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+11, hudinfo[HUD_LIVESPIC].y+ 9, 1, 1, 29); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 8, 1, 1, 29); + V_DrawFill(x+12, y+10, 6, 1, 29); + V_DrawFill(x+11, y+ 9, 1, 1, 29); + V_DrawFill(x+10, y+ 8, 1, 1, 29); } - V_DrawFill(hudinfo[HUD_LIVESPIC].x+12, hudinfo[HUD_LIVESPIC].y+ 5-offs, 6, 6, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+11, hudinfo[HUD_LIVESPIC].y+ 6-offs, 1, 4, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+10, hudinfo[HUD_LIVESPIC].y+ 7-offs, 1, 2, col); + V_DrawFill(x+12, y+ 5-offs, 6, 6, col); + V_DrawFill(x+11, y+ 6-offs, 1, 4, col); + V_DrawFill(x+10, y+ 7-offs, 1, 2, col); // v if (stplyr->cmd.forwardmove < 0) @@ -889,11 +886,11 @@ static void ST_drawInput(void) { offs = 1; col = 16; - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+17, 6, 1, 29); + V_DrawFill(x+ 5, y+17, 6, 1, 29); } - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 5, hudinfo[HUD_LIVESPIC].y+12-offs, 6, 6, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 6, hudinfo[HUD_LIVESPIC].y+11-offs, 4, 1, col); - V_DrawFill(hudinfo[HUD_LIVESPIC].x+ 7, hudinfo[HUD_LIVESPIC].y+10-offs, 2, 1, col); + V_DrawFill(x+ 5, y+12-offs, 6, 6, col); + V_DrawFill(x+ 6, y+11-offs, 4, 1, col); + V_DrawFill(x+ 7, y+10-offs, 2, 1, col); } #define drawbutt(xoffs, yoffs, butt, symb)\ @@ -906,10 +903,10 @@ static void ST_drawInput(void) {\ offs = 1;\ col = 16;\ - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+(xoffs), hudinfo[HUD_LIVESPIC].y+9+(yoffs), 10, 1, 29);\ + V_DrawFill(x+16+(xoffs), y+9+(yoffs), 10, 1, 29);\ }\ - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+(xoffs), hudinfo[HUD_LIVESPIC].y+(yoffs)-offs, 10, 10, col);\ - V_DrawCharacter(hudinfo[HUD_LIVESPIC].x+16+1+(xoffs), hudinfo[HUD_LIVESPIC].y+1+(yoffs)-offs, symb, false) + V_DrawFill(x+16+(xoffs), y+(yoffs)-offs, 10, 10, col);\ + V_DrawCharacter(x+16+1+(xoffs), y+1+(yoffs)-offs, symb, false) drawbutt( 4,-3, BT_JUMP, 'J'); drawbutt(15,-3, BT_USE, 'S'); @@ -923,24 +920,46 @@ static void ST_drawInput(void) if (ycomp == 4) ycomp = 3; - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+4, hudinfo[HUD_LIVESPIC].y+8, 21, 10, 20); // sundial backing + V_DrawFill(x+16+4, y+8, 21, 10, 20); // sundial backing if (ycomp > 0) - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+13-xcomp, hudinfo[HUD_LIVESPIC].y+11-ycomp, 3, 3, accent); // point (behind) + V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (behind) precision = max(3, abs(xcomp)); for (i = 0; i < precision; i++) { - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+14-(i*xcomp)/precision, - hudinfo[HUD_LIVESPIC].y+12-(i*ycomp)/precision, + V_DrawFill(x+16+14-(i*xcomp)/precision, + y+12-(i*ycomp)/precision, 1, 1, 16); } if (ycomp <= 0) - V_DrawFill(hudinfo[HUD_LIVESPIC].x+16+13-xcomp, hudinfo[HUD_LIVESPIC].y+11-ycomp, 3, 3, accent); // point (in front) + V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (in front) } #undef drawbutt + + // text above + x -= 2; + y -= 13; + if (stplyr->pflags & PF_AUTOBRAKE) + { + V_DrawThinString(x, y, + ((!stplyr->powers[pw_carry] + && (stplyr->pflags & PF_APPLYAUTOBRAKE) + && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) + && (stplyr->rmomx || stplyr->rmomy)) + ? 0 : V_GRAYMAP), + "AUTOBRAKE"); + y -= 8; + } + if (stplyr->pflags & PF_ANALOGMODE) + { + V_DrawThinString(x, y, 0, "ANALOG"); + y -= 8; + } + if (!demosynced) // should always be last, so it doesn't push anything else around + V_DrawThinString(x, y, ((leveltime & 2) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); } static void ST_drawLevelTitle(void) From 5c4247dd61492197995be0837af201d87e093ff4 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 18 Oct 2017 13:58:16 +0100 Subject: [PATCH 11/15] Allow for the combination of NiGHTS and record attack HUD. --- src/st_stuff.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index c3ce200f6..3f9ba1dee 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -787,6 +787,9 @@ static void ST_drawInput(void) INT32 x = hudinfo[HUD_LIVESPIC].x, y = hudinfo[HUD_LIVESPIC].y; + if (stplyr->powers[pw_carry] == CR_NIGHTSMODE) + y -= 16; + // O backing V_DrawFill(x, y-1, 16, 16, 20); V_DrawFill(x, y+15, 16, 1, 29); @@ -911,22 +914,23 @@ static void ST_drawInput(void) drawbutt( 4,-3, BT_JUMP, 'J'); drawbutt(15,-3, BT_USE, 'S'); + V_DrawFill(x+16+4, y+8, 21, 10, 20); // sundial backing if (stplyr->mo) { UINT8 i, precision; - angle_t ang = (stplyr->mo->angle - R_PointToAngle(stplyr->mo->x, stplyr->mo->y))>>ANGLETOFINESHIFT; + angle_t ang = (stplyr->powers[pw_carry] == CR_NIGHTSMODE) + ? (FixedAngle((stplyr->flyangle-90)<>ANGLETOFINESHIFT) + : (stplyr->mo->angle - R_PointToAngle(stplyr->mo->x, stplyr->mo->y))>>ANGLETOFINESHIFT; fixed_t xcomp = FINESINE(ang)>>13; fixed_t ycomp = FINECOSINE(ang)>>14; if (ycomp == 4) ycomp = 3; - V_DrawFill(x+16+4, y+8, 21, 10, 20); // sundial backing - if (ycomp > 0) V_DrawFill(x+16+13-xcomp, y+11-ycomp, 3, 3, accent); // point (behind) precision = max(3, abs(xcomp)); - for (i = 0; i < precision; i++) + for (i = 0; i < precision; i++) // line { V_DrawFill(x+16+14-(i*xcomp)/precision, y+12-(i*ycomp)/precision, @@ -942,21 +946,24 @@ static void ST_drawInput(void) // text above x -= 2; y -= 13; - if (stplyr->pflags & PF_AUTOBRAKE) + if (!stplyr->powers[pw_carry] == CR_NIGHTSMODE) { - V_DrawThinString(x, y, - ((!stplyr->powers[pw_carry] - && (stplyr->pflags & PF_APPLYAUTOBRAKE) - && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) - && (stplyr->rmomx || stplyr->rmomy)) - ? 0 : V_GRAYMAP), - "AUTOBRAKE"); - y -= 8; - } - if (stplyr->pflags & PF_ANALOGMODE) - { - V_DrawThinString(x, y, 0, "ANALOG"); - y -= 8; + if (stplyr->pflags & PF_AUTOBRAKE) + { + V_DrawThinString(x, y, + ((!stplyr->powers[pw_carry] + && (stplyr->pflags & PF_APPLYAUTOBRAKE) + && !(stplyr->cmd.sidemove || stplyr->cmd.forwardmove) + && (stplyr->rmomx || stplyr->rmomy)) + ? 0 : V_GRAYMAP), + "AUTOBRAKE"); + y -= 8; + } + if (stplyr->pflags & PF_ANALOGMODE) + { + V_DrawThinString(x, y, 0, "ANALOG"); + y -= 8; + } } if (!demosynced) // should always be last, so it doesn't push anything else around V_DrawThinString(x, y, ((leveltime & 2) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); @@ -2051,8 +2058,6 @@ static void ST_overlayDrawer(void) #endif ) ST_drawLives(); - else if (modeattacking) - ST_drawInput(); } } @@ -2274,6 +2279,9 @@ static void ST_overlayDrawer(void) } } + if (modeattacking) + ST_drawInput(); + ST_drawDebugInfo(); } From 77bcb5d502c6106ab6095f52f9fd772a4ccdaf4a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 18 Oct 2017 16:22:18 +0100 Subject: [PATCH 12/15] Slow the flash. --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 3f9ba1dee..d6fe2a860 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -966,7 +966,7 @@ static void ST_drawInput(void) } } if (!demosynced) // should always be last, so it doesn't push anything else around - V_DrawThinString(x, y, ((leveltime & 2) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); + V_DrawThinString(x, y, ((leveltime & 4) ? V_YELLOWMAP : V_REDMAP), "BAD DEMO!!"); } static void ST_drawLevelTitle(void) From 65e3cdc1fbb77f19c6e5742affaf1bdf6f80eeb1 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Mon, 23 Oct 2017 23:29:55 +0100 Subject: [PATCH 13/15] Fix Autobrake/analog not showing up properly in record attack mode. --- src/st_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index d6fe2a860..0d2b20157 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -946,7 +946,7 @@ static void ST_drawInput(void) // text above x -= 2; y -= 13; - if (!stplyr->powers[pw_carry] == CR_NIGHTSMODE) + if (stplyr->powers[pw_carry] != CR_NIGHTSMODE) { if (stplyr->pflags & PF_AUTOBRAKE) { From 548c120534216d4de2f781d5ddc78cceacdb2e0c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 26 Oct 2017 16:58:18 +0100 Subject: [PATCH 14/15] Since they give points now, make tokens spawn in record attack (and not add end-of-act tokens/continues). --- src/p_inter.c | 19 +++++++++++-------- src/p_mobj.c | 4 ---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index ba27dab63..f4a857845 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -581,18 +581,21 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_AddPlayerScore(player, 1000); - if (ALL7EMERALDS(emeralds)) // Got all 7 + if (!modeattacking) // score only there... { - if (!(netgame || multiplayer)) + if (ALL7EMERALDS(emeralds)) // Got all 7 { - player->continues += 1; - players->gotcontinue = true; - if (P_IsLocalPlayer(player)) - S_StartSound(NULL, sfx_s3kac); + if (!(netgame || multiplayer)) + { + player->continues += 1; + players->gotcontinue = true; + if (P_IsLocalPlayer(player)) + S_StartSound(NULL, sfx_s3kac); + } } + else + token++; } - else - token++; break; // Emerald Hunt diff --git a/src/p_mobj.c b/src/p_mobj.c index ad6bd4365..a6e65603d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9503,10 +9503,6 @@ void P_SpawnMapThing(mapthing_t *mthing) if (i == MT_STARPOST) return; - // Emerald Tokens -->> Score Tokens - else if (i == MT_TOKEN) - return; /// \todo - // 1UPs -->> Score TVs else if (i == MT_1UP_BOX) // 1UP { From 3994697fbdcf5a6047f7adaf3b68e7cbaf2c8268 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 26 Oct 2017 16:58:18 +0100 Subject: [PATCH 15/15] Fix all NiGHTS demo desyncs! (More specifically: compare with d_netcmd.c's order of operations - it's skin change, then g_initnew, then demo start, NOT g_initnew then skin change then demo start!!!!! --- src/g_game.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 74e6a6b73..5c6976622 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5496,6 +5496,9 @@ void G_DoPlayDemo(char *defdemoname) // didn't start recording right away. demo_start = false; + // Set skin + SetPlayerSkin(0, skin); + #ifdef HAVE_BLUA LUAh_MapChange(); #endif @@ -5505,9 +5508,6 @@ void G_DoPlayDemo(char *defdemoname) P_SetRandSeed(randseed); G_InitNew(false, G_BuildMapName(gamemap), true, true, false); - // Set skin - SetPlayerSkin(0, skin); - // Set color for (i = 0; i < MAXSKINCOLORS; i++) if (!stricmp(Color_Names[i],color))