Merge branch 'forwardmove-rng-what-da-hell' into 'next'

Remove P_RandomFixed call when players are moving

See merge request STJr/SRB2!2057
This commit is contained in:
Sal 2023-07-26 14:08:08 +00:00
commit a956aadb15
3 changed files with 10 additions and 3 deletions

View file

@ -58,6 +58,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
boolean demo_forwardmove_rng; // old demo backwards compatibility
boolean demosynced = true; // console warning message
boolean metalrecording; // recording as metal sonic
@ -2028,6 +2029,7 @@ void G_DoPlayDemo(char *defdemoname)
version = READUINT8(demo_p);
subversion = READUINT8(demo_p);
demoversion = READUINT16(demo_p);
demo_forwardmove_rng = (demoversion < 0x0010);
switch(demoversion)
{
case 0x000f:
@ -2339,6 +2341,7 @@ UINT8 G_CheckDemoForError(char *defdemoname)
demo_p++; // version
demo_p++; // subversion
demoversion = READUINT16(demo_p);
demo_forwardmove_rng = (demoversion < 0x0010);
switch(demoversion)
{
case 0x000d:

View file

@ -38,6 +38,7 @@ extern demo_file_override_e demofileoverride;
// Quit after playing a demo from cmdline.
extern boolean singledemo;
extern boolean demo_start;
extern boolean demo_forwardmove_rng;
extern boolean demosynced;
extern mobj_t *metalplayback;

View file

@ -11623,9 +11623,12 @@ void P_PlayerThink(player_t *player)
cmd = &player->cmd;
// Add some extra randomization.
if (cmd->forwardmove)
P_RandomFixed();
if (demoplayback && demo_forwardmove_rng)
{
// Smelly demo backwards compatibility
if (cmd->forwardmove)
P_RandomFixed();
}
#ifdef PARANOIA
if (player->playerstate == PST_REBORN)